Frame 1
mochi.as2.MochiAd.showPreGameAd({id:"841f62d32aed81e7", res:"560x400"});
stop();
addtolog("Ad called - stop() on Frame 2");
Frame 2
addtolog("stop() on Frame 7");
stop();
Frame 3
stop();
Symbol 325 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("3.0 as2");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
if (_local7._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 16 MovieClip Frame 20
stop();
Instance of Symbol 2 MovieClip in Symbol 17 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 5 MovieClip in Symbol 17 MovieClip Frame 2
onClipEvent (load) {
this.gotoAndStop(1);
}
Symbol 17 MovieClip Frame 34
stop();
_parent.play();
Symbol 19 Button
on (press) {
getURL ("http://www.tornadogames.com/?source=WHWings_FFA", "_blank");
}
Symbol 20 MovieClip Frame 93
stop();
_parent.play();
Symbol 25 MovieClip Frame 1
stop();
Symbol 31 Button
on (press) {
if (myactive == 1) {
_parent.actions.startfish(mydepth);
}
}
Symbol 36 MovieClip Frame 5
if (random(10) != 0) {
gotoAndPlay (1);
}
Symbol 44 MovieClip Frame 8
if (random(5) != 0) {
gotoAndPlay (1);
}
Instance of Symbol 103 MovieClip in Symbol 104 MovieClip Frame 1
onClipEvent (load) {
fdir = 1;
maxframe = 32;
}
onClipEvent (enterFrame) {
cf = this._currentframe;
if (random(10) == 0) {
fdir = fdir * -1;
}
cf = cf + fdir;
if (cf < 1) {
cf = maxframe;
}
if (cf > maxframe) {
cf = 1;
}
gotoAndStop(cf);
}
Symbol 158 MovieClip Frame 1
stop();
Instance of Symbol 59 MovieClip "fish2" in Symbol 158 MovieClip Frame 2
onClipEvent (load) {
this._visible = 0;
}
onClipEvent (enterFrame) {
if (_parent.fishframe == 0) {
this._visible = 0;
} else {
this._visible = 1;
this.gotoAndStop(_parent.fishframe);
this.fishg.gotoAndStop(1);
}
}
Instance of Symbol 59 MovieClip "fish1" in Symbol 158 MovieClip Frame 2
onClipEvent (load) {
this._visible = 0;
}
onClipEvent (enterFrame) {
if (_parent.fishframe == 0) {
this._visible = 0;
} else {
this._visible = 1;
this.gotoAndStop(_parent.fishframe);
this.fishg.gotoAndStop(1);
}
}
Symbol 158 MovieClip Frame 6
if (fishframe != 0) {
stop();
}
Instance of Symbol 103 MovieClip in Symbol 159 MovieClip Frame 1
onClipEvent (load) {
fdir = 1;
maxframe = 18;
}
onClipEvent (enterFrame) {
cf = this._currentframe;
if (random(10) == 0) {
fdir = fdir * -1;
}
cf = cf + fdir;
if (cf < 1) {
cf = maxframe;
}
if (cf > maxframe) {
cf = 1;
}
gotoAndStop(cf);
_parent.wingsfar.gotoAndStop(cf);
}
Symbol 175 MovieClip Frame 1
stop();
Instance of Symbol 172 MovieClip in Symbol 175 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(random(2) + 1);
}
Symbol 175 MovieClip Frame 6
_parent.checktnt();
Symbol 175 MovieClip Frame 15
_parent.killme();
stop();
Symbol 177 MovieClip Frame 1
stop();
Instance of Symbol 175 MovieClip "holder" in Symbol 178 MovieClip Frame 1
onClipEvent (load) {
}
Symbol 183 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.pausegame();
}
Symbol 189 MovieClip Frame 10
stop();
Instance of Symbol 186 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 189 MovieClip "textbox1" in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_name == "textbox1") {
this._visible = 0;
stop();
} else {
this._visible = 1;
}
}
Symbol 195 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.downloadtrial();
}
Symbol 197 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_root.hsactions.namebox();
}
Symbol 210 Button
on (press) {
_parent._parent.actions.doclick();
}
on (release) {
_parent.clicked(_name);
}
Symbol 216 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.dosound();
}
Instance of Symbol 58 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Symbol 229 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.moregames();
}
Symbol 231 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.startgame();
this.gotoAndStop(10);
}
Symbol 234 MovieClip Frame 1
function clicked(wname) {
trace("Clicked: " + wname);
if (wname == "More Help") {
trace("Call help on actions");
_parent.actions.showhelp();
}
}
stop();
Instance of Symbol 205 MovieClip in Symbol 234 MovieClip Frame 1
onClipEvent (enterFrame) {
if (random(30) == 0) {
_parent._parent.actions.blastbubbles();
}
}
Instance of Symbol 233 MovieClip in Symbol 234 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 238 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.unpausegame();
_parent.actions.quitgame();
}
Symbol 241 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.unpausegame();
}
Symbol 244 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.moregames();
}
Symbol 247 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.showhelp();
}
Symbol 248 MovieClip Frame 1
stop();
Instance of Symbol 233 MovieClip in Symbol 248 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 205 MovieClip in Symbol 248 MovieClip Frame 2
onClipEvent (enterFrame) {
if (random(30) == 0) {
_parent._parent.actions.blastbubbles();
}
}
Symbol 249 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.domenu();
this.gotoAndStop(1);
}
Symbol 255 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
_parent.actions.submitscore();
this.gotoAndStop(3);
}
Symbol 257 MovieClip Frame 1
stop();
Instance of Symbol 233 MovieClip in Symbol 257 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 205 MovieClip in Symbol 257 MovieClip Frame 2
onClipEvent (enterFrame) {
if (random(30) == 0) {
_parent._parent.actions.blastbubbles();
}
}
Symbol 258 Button
on (press) {
_parent.actions.doclick();
}
on (release) {
hideme();
}
Symbol 267 Button
on (press) {
movepage(this._ymouse);
}
Symbol 271 Button
on (press) {
if (this._name == "slidebox") {
this.startDrag(1, this._x, 0, this._x, _parent.theight);
}
_parent.wname = _name;
_parent.pressing = 1;
}
on (rollOut, release, dragOut) {
_parent.pressing = 0;
if (this._name == "slidebox") {
stopDrag();
}
}
Instance of Symbol 269 MovieClip "barheight" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 275 MovieClip Frame 1
stop();
Instance of Symbol 233 MovieClip in Symbol 275 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 205 MovieClip in Symbol 275 MovieClip Frame 2
onClipEvent (enterFrame) {
if (random(30) == 0) {
_parent._parent.actions.blastbubbles();
}
}
Instance of Symbol 274 MovieClip in Symbol 275 MovieClip Frame 2
onClipEvent (load) {
function setto() {
trace("Trace line - topy: " + topy);
trace("Tracking: " + tracking);
trace("Ratio: " + ratio);
trace(("Set help box to a new y: " + topy) - (tracking * ratio));
this.slidebox._y = tracking;
_parent[focus]._y = topy - (tracking * ratio);
}
function settobox() {
tracking = this.slidebox._y;
setto();
}
function scrolling(dir) {
tracking = tracking + ((dir * multi) * smallstep);
if (tracking < 0) {
tracking = 0;
}
if (tracking > theight) {
tracking = theight;
}
setto();
}
function movepage(ty) {
if (ty > tracking) {
dir = 1;
} else {
dir = -1;
}
tracking = tracking + ((dir * multi) * bigstep);
if (tracking < 0) {
tracking = 0;
}
if (tracking > theight) {
tracking = theight;
}
setto();
}
pressing = 0;
focus = "helptext";
topy = _parent[focus]._y;
bottomy = _parent[focus]._y + _parent[focus]._height;
theight = this.barheight._height;
trace("Theight: " + theight);
fheight = _parent[focus]._height - 150;
trace("Fheight: " + fheight);
ratio = fheight / theight;
trace("Made a ratio: " + ratio);
tracking = 0;
setto();
multi = 1;
times = 3;
smallstep = 1;
bigstep = 50;
}
onClipEvent (enterFrame) {
if (pressing == 1) {
if (wname eq "bottombox") {
scrolling(1);
} else if (wname eq "topbox") {
scrolling(-1);
} else {
settobox();
}
}
}
Symbol 278 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 1
stop();
Symbol 281 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 1
stop();
Symbol 284 MovieClip Frame 1
stop();
Symbol 285 MovieClip Frame 1
stop();
Symbol 287 MovieClip Frame 1
stop();
Symbol 289 MovieClip Frame 1
stop();
Symbol 291 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 293 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 1
stop();
Symbol 295 MovieClip Frame 1
stop();
Symbol 297 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 10
trace("Playing bgsounds");
stop();
Instance of Symbol 307 MovieClip in Symbol 310 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 310 MovieClip Frame 26
stop();
Symbol 315 Button
on (press) {
startDrag (this, false, lowx, thisy, highx, thisy);
}
on (rollOut, release, dragOut) {
stopDrag();
}
Instance of Symbol 316 MovieClip in Symbol 317 MovieClip Frame 1
onClipEvent (load) {
function adjustvolume() {
vol = this._x - lowx;
vol = int(100 * (vol / totallength));
soundcontrol.setVolume(vol);
lastx = this._x;
}
lastx = -1;
soundcontrol = new Sound(_parent._parent._parent.soundfx);
vol = 80;
lowx = this._x;
highx = (this._x + _parent.vline._width) - 5;
thisy = this._y;
totallength = highx - lowx;
this._x = this._x + (totallength * (vol / 100));
adjustvolume();
}
onClipEvent (enterFrame) {
if (lastx != this._x) {
adjustvolume();
}
}
Instance of Symbol 316 MovieClip in Symbol 318 MovieClip Frame 1
onClipEvent (load) {
function adjustvolume() {
vol = this._x - lowx;
vol = int(100 * (vol / totallength));
soundcontrol.setVolume(vol);
lastx = this._x;
}
lastx = -1;
soundcontrol = new Sound(_parent._parent._parent.bgmusic);
vol = 25;
lowx = this._x;
highx = (this._x + _parent.vline._width) - 5;
thisy = this._y;
totallength = highx - lowx;
this._x = this._x + (totallength * (vol / 100));
adjustvolume();
}
onClipEvent (enterFrame) {
if (lastx != this._x) {
adjustvolume();
}
}
Symbol 323 MovieClip Frame 1
stop();
Instance of Symbol 106 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 25 MovieClip "waterg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function updateme() {
this.water1._x = this.water1._x + stepx;
this.water2._x = this.water2._x + stepx;
if (this.water1._x >= breakpoint) {
this.water1._x = this.water2._x - mywidth;
}
if (this.water2._x >= breakpoint) {
this.water2._x = this.water1._x - mywidth;
}
}
actionbox = _parent.actions;
startx = 0;
breakpoint = 561;
mywidth = this.water1._width;
this.water2._x = this.water1._x - mywidth;
stepx = 2;
}
onClipEvent (enterFrame) {
if (actionbox.gameover == 0) {
updateme();
}
}
Instance of Symbol 29 MovieClip "sparkblue" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function updateme() {
zpos = zpos + zspeed;
scale = (int(zpos * 4) + 100) / 100;
factor = (int(zpos / 10) + 100) / 100;
this._x = this._x + (xspeed * factor);
yspeed = yspeed + 0.98;
this._y = this._y + (yspeed * factor);
this._xscale = scale * 100;
this._yscale = scale * 100;
this._alpha = this._alpha - fade;
if (this._alpha <= 0) {
removeMovieClip(this);
}
}
if (_name == "sparkblue") {
this._visible = 0;
active = 0;
} else {
active = 1;
this._visible = 1;
this.gotoAndStop(random(3));
}
zpos = 0;
xspeed = random(6) - 3;
if (xspeed == 0) {
if (random(2) == 0) {
xspeed = 1;
} else {
xspeed = -1;
}
}
yspeed = random(10) * -1;
zspeed = random(4) - 2;
fade = random(3) + 3;
}
onClipEvent (enterFrame) {
if (active == 1) {
updateme();
}
}
Instance of Symbol 25 MovieClip "waterg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function updateme() {
this.water1._x = this.water1._x + stepx;
this.water2._x = this.water2._x + stepx;
if (this.water1._x >= breakpoint) {
this.water1._x = this.water2._x - mywidth;
}
if (this.water2._x >= breakpoint) {
this.water2._x = this.water1._x - mywidth;
}
}
actionbox = _parent.actions;
startx = 0;
breakpoint = 561;
mywidth = this.water1._width;
this.water2._x = this.water1._x - mywidth;
stepx = 4;
}
onClipEvent (enterFrame) {
if (actionbox.gameover == 0) {
updateme();
}
}
Instance of Symbol 64 MovieClip "fishmaster" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setup() {
alive = 1;
hunger = 100;
hungerstep = -0.02;
this.hmeter.hbar._xscale = hunger;
myframe = random(4) + 1;
myid = int(_name);
this.frames.gotoAndStop(myframe);
t = 300;
r = 550;
b = 390;
l = 10;
xdir = random(2);
if (xdir == 0) {
xdir = -1;
}
this._xscale = 100 * xdir;
this.hmeter._xscale = 100 * xdir;
ydir = random(2);
if (ydir == 0) {
ydir = -1;
}
xstep = random(3) + 1;
ystep = random(2) + 0.5;
myactive = 1;
this._visible = 1;
}
function changeswim() {
if (this._x > r) {
this._x = r - 4;
xdir = xdir * -1;
this._xscale = 100 * xdir;
this.hmeter._xscale = 100 * xdir;
}
if (this._x < l) {
this._x = l + 4;
xdir = xdir * -1;
this._xscale = 100 * xdir;
this.hmeter._xscale = 100 * xdir;
}
if (this._y < t) {
this._y = t;
ydir = ydir * -1;
}
if (this._y > b) {
this._y = b;
ydir = ydir * -1;
}
if (myactive >= 2) {
return(0);
}
if (random(60) == 0) {
if (random(10) == 0) {
xdir = xdir * -1;
this._xscale = 100 * xdir;
this.hmeter._xscale = 100 * xdir;
}
xstep = random(3) + 1;
}
if (random(60) == 0) {
if (random(10) == 0) {
ydir = ydir * -1;
}
ystep = random(2) + 0.5;
}
}
function moveonx() {
if (this._x > r) {
this._x = r - 4;
xdir = xdir * -1;
this._xscale = 100 * xdir;
this.hmeter._xscale = 100 * xdir;
}
if (this._x < l) {
this._x = l + 4;
xdir = xdir * -1;
this._xscale = 100 * xdir;
this.hmeter._xscale = 100 * xdir;
}
this._x = this._x + (xdir * xstep);
}
function fooddeath() {
this._yscale = -100;
this.hmeter._visible = 0;
dofooddeath = 1;
this._alpha = 50;
_parent.actions.bubbleburst(this._x, this._y);
_parent.actions.makesound("sound_bubbles");
}
function updatefooddeath() {
this._y = this._y + 0.8;
if (random(2) == 0) {
xdir = 1;
} else {
xdir = -1;
}
this._x = this._x + (1 * xdir);
if (this._y > 400) {
actionbox.adjustfishcount(-1);
removeMovieClip(this);
}
}
function updatehunger(amt) {
hunger = hunger + amt;
if (hunger > 100) {
hunger = 100;
}
if (hunger <= 0) {
hunger = 0;
myactive = 0;
fooddeath();
}
this.hmeter.hbar._xscale = hunger;
}
function updateswim() {
changeswim();
this._x = this._x + (xdir * xstep);
if (myactive == 1) {
this._y = this._y + (ydir * ystep);
}
}
function dropback(yin) {
myactive = 2;
ystep = yin * -1;
ystep = ystep * 0.5;
ya = 0.5;
rstep = 3;
}
function updatedropback() {
if (this._y < 290) {
this._rotation = this._rotation + (rstep * xdir);
_parent.actions.checkforworms(mydepth);
}
if (xdir == 1) {
if (this._rotation > 35) {
this._rotation = 35;
}
} else if (xdir == -1) {
if (this._rotation < -35) {
this._rotation = -35;
}
}
this._y = this._y + ystep;
if (this._y < 300) {
ystep = ystep + ya;
}
if (ystep > 9) {
ystep = 9;
}
if (this._y > 290) {
this._rotation = this._rotation - ((rstep * xdir) * 0.3);
if (splash == 0) {
_parent.actions.makesound("sound_splashlanding");
_parent.actions.dobluespark(this._x, this._y);
splash = 1;
}
ystep = 2;
}
if (this._y > 340) {
this._rotation = 0;
ystep = random(2) + 0.5;
myactive = 1;
}
}
actionbox = _parent.actions;
if (_name == "fishmaster") {
myactive = 0;
this._visible = 0;
this.frames.stop();
} else {
setup();
}
}
onClipEvent (enterFrame) {
if (actionbox.gameover == 0) {
if (myactive > 0) {
if (this._y < 290) {
if (hunger > 10) {
this.frames.fishg.gotoAndStop(1);
}
} else if (hunger > 10) {
this.frames.fishg.gotoAndStop(2);
}
}
if (hunger <= 10) {
this.frames.fishg.play();
}
if (myactive == 2) {
updatedropback();
}
if (myactive == 1) {
hungerstep = 0.06 - (actionbox.numberoffish / 100);
if (actionbox.level > 4) {
hungerstep = hungerstep + 0.01;
}
if (actionbox.level > 8) {
hungerstep = hungerstep + 0.02;
}
if (actionbox.level > 12) {
hungerstep = hungerstep + 0.02;
}
if (actionbox.level > 16) {
hungerstep = hungerstep + 0.03;
}
updatehunger(hungerstep * -1);
}
if (myactive > 0) {
if (myactive == 1) {
updateswim();
this.hmeter._visible = 1;
} else {
moveonx();
this.hmeter._visible = 0;
}
} else {
this.heter._visible = 0;
}
if (dofooddeath == 1) {
updatefooddeath();
}
}
}
Instance of Symbol 104 MovieClip "wormmaster" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setup() {
if (random(2) == 0) {
xdir = -1;
} else {
xdir = 1;
this._x = -30;
this._xscale = this._xscale * -1;
}
this._y = random(230) + 30;
active = 1;
stepx = random(3 + actionbox.level) + 3;
if (stepx > 8) {
stepx = 8;
}
ystep = random(1) + 0.5;
ydir = 1;
}
function updateme() {
if (random(10) == 0) {
ydir = ydir * -1;
}
this._y = this._y + (ystep * ydir);
if (this._y > 280) {
this._y = 280;
}
if (this._y < 20) {
this._y = 20;
}
this._x = this._x + (stepx * xdir);
if (this._x < -40) {
_parent.actions.removeworm(mydepth);
}
if (this._x > 590) {
_parent.actions.removeworm(mydepth);
}
}
actionbox = _parent.actions;
if (_name == "wormmaster") {
this._visible = 0;
active = 0;
} else {
this._visible = 1;
setup();
}
}
onClipEvent (enterFrame) {
if (active && (actionbox.gameover == 0)) {
updateme();
}
}
Instance of Symbol 106 MovieClip "actions" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function quitgame() {
dogameover("You Quit");
}
function moregames() {
getURL ("http://www.tornadogames.com/?source=WHWings_FFA", "_blank");
}
function submitscore() {
_root.hsactions.submitscore(score, level);
}
function makesound(wsound) {
if (soundon == 1) {
_parent.soundfx[wsound].gotoAndPlay(2);
}
}
function showhelp() {
_parent.helpg.showme();
}
function dogameover(mess) {
if (gameover != 0) {
return(0);
}
gameover = 2;
_parent.gameoverg.gotoAndStop(3);
_parent.gameoverg.line1 = mess;
_parent.gameoverg.line2 = "Level: " + level;
_parent.gameoverg.line3 = "Final Score: " + makecomma(score);
}
function domenu() {
clearscreen();
_parent.menug.gotoAndStop(1);
}
function dosound() {
_parent.soundg.showme();
}
function gethighfxdepth() {
highfxdepth++;
if ((highfxdepth < 950000) || (highfxdepth > 960000)) {
highfxdepth = 950000 /* 0x0E7EF0 */;
}
return(highfxdepth);
}
function doclick() {
makesound("sound_click");
}
function bubbleburst(sx, sy) {
var _local2 = random(6) + 3;
b = 0;
while (b < _local2) {
td = gethighfxdepth();
duplicateMovieClip (_parent.bubblemaster, td, td);
rfoo = _parent[td];
xo = random(20);
xdir = random(2);
if (xdir == 0) {
xdir = -1;
}
xoff = xo * xdir;
yo = random(20);
ydir = random(2);
if (ydir == 0) {
ydir = -1;
}
yoff = yo * ydir;
rfoo._x = sx + xoff;
rfoo._y = sy + yoff;
b++;
}
}
function blastbubbles() {
var _local2 = random(6) + 3;
b = 0;
while (b < _local2) {
td = gethighfxdepth();
duplicateMovieClip (_parent.bubblemaster, td, td);
rfoo = _parent[td];
rfoo._x = random(540) + 10;
rfoo._y = 400 + random(100);
b++;
}
}
function startgame() {
_root.hsactions.highscoresetup("Name", "Score", "Level", "WormsHaveWings", "WormsHaveWings");
wormsperlevel = 30;
numberoffish = 0;
depth = 0;
level = 0;
birdrate = 6;
hdepth = 0;
activefish = 0;
score = 0;
wormcount = 10;
nextlevel();
setfish(5);
}
function pausegame() {
_parent.pauseg._visible = 0;
_parent.pauseframeg.gotoAndStop(2);
pgameover = gameover;
gameover = 2;
}
function unpausegame() {
_parent.pauseg._visible = 1;
_parent.pauseframeg.gotoAndStop(1);
gameover = pgameover;
}
function showlevelup() {
_parent.levelupg.setup("Level Complete");
_parent.pauseg._visible = 0;
}
function nextlevel() {
gameover = 0;
birdrate = birdrate - 1;
if (birdrate < 4) {
birdrate = 4;
}
level++;
_parent.showlevel = "Level: " + level;
wormstogo = wormsperlevel;
_parent.pauseg._visible = 1;
}
function updatescore(amt) {
score = score + amt;
_parent.showscore = "Score: " + makecomma(score);
}
function clearscreen() {
while (fishdepth >= 2000) {
removeMovieClip(_parent[fishdepth]);
fishdepth--;
}
len = wormlist.length;
x = 0;
while (x < len) {
td = wormlist[x];
removeMovieClip(_parent[td]);
x++;
}
wormlist.splice(0);
}
function setfish(amt) {
fishdepth = 2000;
while (amt > 0) {
amt--;
numberoffish++;
duplicateMovieClip (_parent.fishmaster, fishdepth, fishdepth);
foo = _parent[fishdepth];
foo.mydepth = fishdepth;
foo._x = random(500) + 20;
foo._y = random(80) + 310;
fishdepth++;
}
}
function startfish(mydepth) {
if (gameover == 0) {
trace("Start Jumping Fish number: " + mydepth);
activefish = mydepth;
_parent[activefish].myactive = 3;
_parent[activefish].wormcount = 0;
_parent[activefish].upsplash = 0;
_parent[activefish].splash = 1;
_parent[activefish]._rotation = _parent[activefish]._rotation - (30 * _parent[activefish].xdir);
jumphunger = (level * 0.5) + 5;
if (jumphunger > 11) {
jumphunger = 11;
}
if (jumphunger > _parent[activefish].hunger) {
_parent[activefish].hunger = 0.01;
jumphunger = 0;
}
jumphunger = jumphunger * -1;
_parent[activefish].updatehunger(jumphunger);
ydir = -1;
ystep = 10;
ya = 0.1;
}
}
function updatefish() {
ydir = -1;
_parent[activefish]._y = _parent[activefish]._y + (ydir * ystep);
ystep = ystep - ya;
if (ystep < 4) {
ystep = 4;
}
checkforworms(activefish);
if ((_parent[activefish].upsplash == 0) && (_parent[activefish]._y < 290)) {
_parent[activefish].upsplash = 1;
makesound("sound_splash");
dobluespark(_parent[activefish]._x, _parent[activefish]._y);
_parent[activefish].splash = 0;
}
if (_parent[activefish]._y < 60) {
stopfish();
}
}
function checktnt(tx, ty) {
f = 2000;
while (f < 2005) {
foo = _parent[f];
if (foo._x != undefined) {
dis = _parent.motions.getVector(foo._x, foo._y, tx, ty);
if ((((dis < 100) && (foo.myactive == 1)) && (foo._y >= waterline)) && (foo._rotation == 0)) {
trace((((("Fish boom on tnt: " + f) + " Distance from tnt: ") + dis) + " myactive: ") + foo.myactive);
dis = 100 - dis;
amt = int((dis * 0.5) * -1);
foo.updatehunger(amt);
if (foo._x > tx) {
foo._x = foo._x + dis;
} else {
foo._x = foo._x - dis;
}
}
}
f++;
}
}
function checkforworms(fishdepth) {
wormremove.splice(0);
len = wormlist.length;
x = 0;
while (x < len) {
wd = wormlist[x];
dis = _parent.motions.getVector(_parent[wd]._x, _parent[wd]._y, _parent[fishdepth]._x, _parent[fishdepth]._y);
if (dis < 30) {
if ((_parent[wd].mytype == 1) || (_parent[wd].mytype == 3)) {
wormremove.push(wd);
_parent[fishdepth].wormcount++;
bscore = int((_parent[fishdepth].wormcount * 100) + ((500 - _parent[wd]._y) * 0.1));
if (_parent[wd].mytype == 3) {
bscore = bscore * 2;
}
hungerscore = bscore;
levelper = 1 + ((level - 1) / 10);
bscore = bscore * levelper;
bscore = int(bscore);
updatescore(bscore);
_parent[fishdepth].updatehunger(bscore / 10);
doscorefloat("+" + bscore, _parent[wd]._x, _parent[wd]._y);
} else {
makesound("sound_bird");
_parent[wd].mouthg.gotoAndPlay(2);
fishframe = _parent[fishdepth].myframe;
_parent[wd].mouthg.fishframe = fishframe;
_parent[wd].mouthg.fish1.gotoAndStop(fishframe);
_parent[wd].mouthg.fish2.gotoAndStop(fishframe);
_parent[wd].stepx = _parent[wd].stepx * 1.2;
setskeleton(_parent[fishdepth]._x, _parent[fishdepth]._y, _parent[fishdepth]._xscale);
removeMovieClip(_parent[fishdepth]);
}
}
x++;
}
len = wormremove.length;
x = 0;
while (x < len) {
removeworm(wormremove[x]);
x++;
}
}
function setskeleton(sx, sy, xs) {
td = gethighdepth();
duplicateMovieClip (_parent.skeletong, td, td);
foo = _parent[td];
foo._x = sx;
foo._y = sy;
foo._xscale = xs;
}
function settnt() {
makesound("sound_droptnt");
td = gethighdepth();
duplicateMovieClip (_parent.tntg, td, td);
foo = _parent[td];
}
function adjustfishcount(amt) {
numberoffish = numberoffish + amt;
if (numberoffish == 0) {
dogameover("All Fishys Dead");
}
}
function doscorefloat(mess, sx, sy) {
makesound("sound_score1");
td = gethighdepth();
duplicateMovieClip (_parent.scorefloaterg, td, td);
foo = _parent[td];
foo._x = sx;
foo._y = sy;
foo.mess = mess;
}
function stopfish() {
_parent[activefish].dropback(ystep);
activefish = 0;
}
function makecomma(num) {
num = num.toString();
len = num.length;
if (num < 0) {
return(num);
}
clen = len;
setcomma = 0;
rnum = "";
while (clen > 3) {
clen = clen - 3;
}
setcomma = 3 - clen;
tempx = 0;
while (tempx < len) {
if (setcomma == 3) {
rnum = rnum + ",";
setcomma = 0;
}
char = num.substr(tempx, 1);
rnum = rnum + char;
rnum = rnum + "";
setcomma++;
tempx++;
}
return(rnum);
}
function gethighdepth() {
hdepth++;
if ((hdepth < 3000) || (hdepth > 3500)) {
hdepth = 3000;
}
return(hdepth);
}
function dobluespark(tx, ty) {
catches++;
sparkcount = 10;
x = 0;
while (x < sparkcount) {
td = gethighdepth();
duplicateMovieClip (_parent.sparkblue, td, td);
foo = _parent[td];
foo._x = tx;
foo._y = ty;
x++;
}
}
function getdepth() {
depth++;
if (depth > 1000) {
depth = 0;
}
return(depth);
}
function setworm(mytype) {
if (wormstogo == 0) {
return(0);
}
if (mytype == 1) {
wormstogo--;
}
td = getdepth();
if (mytype == 1) {
duplicateMovieClip (_parent.wormmaster, td, td);
} else if (mytype == 3) {
duplicateMovieClip (_parent.flymaster, td, td);
} else {
duplicateMovieClip (_parent.birdmaster, td, td);
}
foo = _parent[td];
foo.mytype = mytype;
foo.mydepth = td;
wormlist.push(td);
}
function removeworm(wdep) {
len = wormlist.length;
x = 0;
while (x < len) {
if (wormlist[x] == wdep) {
wormlist.splice(x, 1);
removeMovieClip(_parent[wdep]);
x = len + 10;
}
x++;
}
if ((wormlist.length == 0) && (wormstogo == 0)) {
gameover = 2;
showlevelup();
}
}
soundon = 1;
this._visible = 0;
wormlist = new Array();
wormremove = new Array();
wormlist.splice(0);
highfxdepth = 0;
waterline = 287;
}
onClipEvent (enterFrame) {
if (gameover == 0) {
updatehunger();
}
if ((wormcount > 0) && (gameover == 0)) {
wormcount--;
if (wormcount == 0) {
if (random(birdrate) == 0) {
setworm(2);
} else if (random(5) == 0) {
setworm(3);
} else {
setworm(1);
}
wormcount = random(20) + 30;
tntrate = 20 - level;
if (tntrate < 5) {
tntrate = 5;
}
if (random(tntrate) == 0) {
settnt();
}
}
}
if (fishactive != 0) {
updatefish();
}
}
onClipEvent (mouseUp) {
if (fishactive != 0) {
stopfish();
}
}
Instance of Symbol 110 MovieClip "motions" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setpoint(sp, sx, sy, mess) {
depth++;
duplicateMovieClip (_parent[sp], depth, depth);
foo = _parent[depth];
foo._x = sx;
foo._y = sy;
foo.messbox.mess = mess;
}
function findreflect(ca, cx, cy, hitobject) {
mydis = 5;
startangle = ca;
startx = cx;
starty = cy;
finaltopx = cx;
finaltopy = cy;
addsub = 1;
acheck = 0;
while (acheck < reflectsteps.length) {
checkangle = joinangles(ca, reflectsteps[acheck], addsub);
point = moveObj(startx, starty, checkangle, mydis);
r = hitting(point.x, point.y, hitobject);
if (r == 1) {
finaltopx = point.x;
finaltopy = point.y;
addsub = -1;
ca = checkangle;
} else {
addsub = 1;
ca = checkangle;
}
acheck++;
}
finalbottomx = startx;
finalbottomy = starty;
ca = startangle;
addsub = -1;
acheck = 0;
while (acheck < reflectsteps.length) {
checkangle = joinangles(ca, reflectsteps[acheck], addsub);
point = moveObj(startx, starty, checkangle, mydis);
r = hitting(point.x, point.y, hitobject);
if (r == 1) {
finalbottomx = point.x;
finalbottomy = point.y;
addsub = 1;
ca = checkangle;
} else {
addsub = -1;
ca = checkangle;
}
acheck++;
}
ra = getAngle(finaltopx, finaltopy, finalbottomx, finalbottomy);
_parent.showhit = (("Incoming angle: " + startangle) + " hit angle: ") + ra;
return(ra);
}
function stepback(cx, cy, ca, hitobject) {
stepsize = 2;
ca = ca + 180;
ca = ca % 360;
found = 0;
safety = 100;
while ((found == 0) && (safety > 0)) {
safety--;
point = moveObj(cx, cy, ca, stepsize);
cx = point.x;
cy = point.y;
r = hitting(cx, cy, hitobject);
if (r == 1) {
found = 1;
return(point);
}
}
}
function stepwatcher(ca, cx, cy, cs, ss, hitobject) {
track = ss;
if (track > cs) {
track = cs;
}
fullchecked = 0;
while (track <= cs) {
point = moveObj(cx, cy, ca, track);
r = hitting(point.x, point.y, hitobject);
if (r == 0) {
point.watcher = 0;
return(point);
}
track = track + ss;
if (fullchecked == 0) {
if (track >= cs) {
fullchecked = 1;
track = cs;
}
}
}
point.watcher = 1;
return(point);
}
function hitting(px, py, hitobject) {
if (hitobject.hitTest(px, py, 1) == 1) {
return(1);
}
return(0);
}
function getangledifference(a1, a2) {
dif = Math.abs(a1 - a2);
dif = dif % 360;
if (dif > 180) {
if (a1 > a2) {
dif = (360 - a1) + a2;
} else {
dif = (360 - a2) + a1;
}
}
t = dif / 180;
t = t * transferrange;
t = t + transferlow;
t = 1 - t;
point.dif = dif;
point.aenergy = t;
return(point);
}
function anglebetween(q, a1, a2) {
if (a2 < 360) {
if ((q >= a1) && (q <= a2)) {
return(1);
}
return(-1);
}
if ((q >= a1) && (q < 360)) {
return(1);
}
over = a2 - 360;
if ((q >= 0) && (q <= over)) {
return(1);
}
return(-1);
}
function joinangles(a1, a2, type) {
if (type == 1) {
t = a1 + a2;
t = t % 360;
return(t);
}
if (type == -1) {
t = a1 - a2;
if (t < 0) {
t = 360 + t;
}
t = t % 360;
return(t);
}
}
function initMath() {
Deg2Rad = (Math.PI/180);
Rad2Deg = 1 / Deg2Rad;
TABLE_SIZE = 720;
initTables();
}
function gethydis(x, y, angle, step) {
angle = int(angle);
if ((angle - 90) > 0) {
ang_adj = angle - 90;
} else {
ang_adj = angle + 270;
}
sideviewx = x + (step * myCos[ang_adj]);
sideviewy = y + (step * mySin[ang_adj]);
difsideviewx = sideviewx - x;
return(difsideviewx);
}
function moveObj(x, y, angle, step) {
angle = int(angle);
if ((angle - 90) > 0) {
ang_adj = angle - 90;
} else {
ang_adj = angle + 270;
}
point.x = x + (step * myCos[ang_adj]);
point.y = y + (step * mySin[ang_adj]);
return(point);
}
function motionsteps(x1, y1, x2, y2, steps) {
dx = Math.abs(x1 - x2);
dy = Math.abs(y1 - y2);
stepx = dx / steps;
stepy = dy / steps;
if (x1 > x2) {
stepx = stepx * -1;
}
if (y1 > y2) {
stepy = stepy * -1;
}
str = (stepx + "%") + stepy;
return(str);
}
function reflectAngle(objAng, hitAng) {
objAng = objAng - hitAng;
objAng = (360 - objAng) + hitAng;
if (objAng >= 360) {
objAng = objAng % 360;
}
return(objAng);
}
function getAngle(x, y, x1, y1) {
distX = x - x1;
distY = y - y1;
t = Math.atan2(distY, distX) * Rad2Deg;
if (t < 0) {
t = t + 360;
}
remain = t - Math.floor(t);
if (remain <= 0.25) {
t = Math.floor(t);
} else if ((remain > 0.25) && (remain <= 0.75)) {
t = Math.floor(t) + 0.5;
} else {
t = Math.ceil(t);
}
t = t - 90;
if (t < 0) {
t = t + 360;
}
return(t);
}
function Rand(min, max) {
return(Math.floor(Math.random() * ((max + 1) - min)) + min);
}
function getVector(x1, y1, x2, y2) {
return(Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))));
}
function initTables() {
mySin = new Array(TABLE_SIZE);
myCos = new Array(TABLE_SIZE);
i = 0;
while (i < TABLE_SIZE) {
temp = Deg2Rad * i;
mySin[i] = Math.sin(temp);
myCos[i] = Math.cos(temp);
i = i + 0.5;
}
}
function moveObj2(object, angle, step) {
angle = int(angle);
if ((angle - 90) > 0) {
ang_adj = angle - 90;
} else {
ang_adj = angle + 270;
}
object._x = object._x + (step * myCos[ang_adj]);
object._y = object._y + (step * mySin[ang_adj]);
}
this._visible = 0;
depth = 100;
initMath();
point = new Object();
reflectsteps = new Array(90, 45, 22, 11, 5, 2, 1);
transferhigh = 0.3;
transferlow = 0.05;
transferrange = transferhigh - transferlow;
}
Instance of Symbol 114 MovieClip "scorefloaterg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setup() {
stepy = -1;
astep = 3;
steps = 33;
}
function updateme() {
steps--;
if (steps == 0) {
removeMovieClip(this);
}
this._y = this._y + stepy;
}
if (_name == "scorefloaterg") {
active = 0;
this._visible = 0;
} else {
active = 1;
this._visible = 1;
setup();
}
}
onClipEvent (enterFrame) {
if (active) {
updateme();
}
}
Instance of Symbol 159 MovieClip "birdmaster" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setup() {
this.mouthg.fishframe = 0;
if (random(2) == 0) {
xdir = -1;
} else {
xdir = 1;
this._x = -30;
this._xscale = this._xscale * -1;
}
this._y = random(200) + 30;
active = 1;
stepx = random(4) + 4;
ystep = random(1) + 0.5;
ydir = 1;
}
function updateme() {
if (this.mouthg.fishframe == 0) {
this.mouthg.gotoAndStop(random(8) + 1);
}
if (random(10) == 0) {
ydir = ydir * -1;
}
this._y = this._y + (ystep * ydir);
if (this._y > 280) {
this._y = 280;
}
if (this._y < 20) {
this._y = 20;
}
this._x = this._x + (stepx * xdir);
if (this._x < -40) {
_parent.actions.removeworm(mydepth);
}
if (this._x > 590) {
_parent.actions.removeworm(mydepth);
}
}
actionbox = _parent.actions;
if (_name == "birdmaster") {
this._visible = 0;
active = 0;
} else {
this._visible = 1;
setup();
}
}
onClipEvent (enterFrame) {
if (active && (actionbox.gameover == 0)) {
updateme();
}
}
Instance of Symbol 163 MovieClip "flymaster" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setup() {
if (random(2) == 0) {
xdir = -1;
} else {
xdir = 1;
this._x = -30;
this._xscale = this._xscale * -1;
}
this._y = random(230) + 30;
active = 1;
stepx = random(4) + 4;
ystep = random(1) + 0.5;
ydir = 1;
}
function updateme() {
if (random(10) == 0) {
ydir = ydir * -1;
}
this._y = this._y + (ystep * ydir);
if (this._y > 280) {
this._y = 280;
}
if (this._y < 20) {
this._y = 20;
}
this._x = this._x + (stepx * xdir);
if (random(2) == 0) {
this._x = this._x + (random(stepx) * -1);
} else {
this._x = this._x + random(stepx);
}
if (random(2) == 0) {
this._y = this._y + (random(stepx) * -1);
} else {
this._y = this._y + random(stepx);
}
if (this._y > 300) {
this._y = 300;
}
if (this._y < 20) {
this._y = 20;
}
if (this._x < -40) {
_parent.actions.removeworm(mydepth);
}
if (this._x > 590) {
_parent.actions.removeworm(mydepth);
}
}
actionbox = _parent.actions;
if (_name == "flymaster") {
this._visible = 0;
active = 0;
} else {
this._visible = 1;
setup();
}
}
onClipEvent (enterFrame) {
if (active && (actionbox.gameover == 0)) {
updateme();
}
}
Instance of Symbol 166 MovieClip "skeletong" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setup() {
ystep = -2;
accel = -0.1;
active = 1;
this._visible = 1;
this._alpha = 40;
}
function updateme() {
this._y = this._y + ystep;
ystep = ystep + accel;
this._rotation = this._rotation + 3;
if (this._rotation >= 180) {
this._rotation = 180;
}
if (this._y < -50) {
_parent.actions.adjustfishcount(-1);
removeMovieClip(this);
}
}
if (_name == "skeletong") {
this._visible = 0;
active = 0;
} else {
setup();
}
}
onClipEvent (enterFrame) {
if (active == 1) {
updateme();
}
}
Instance of Symbol 178 MovieClip "tntg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setup() {
splash = 0;
active = 1;
this._visible = 1;
this._x = this._x + random(550);
ystep = random(4) + 9;
ystep = 0;
accel = 1;
ystepmax = random(4) + 9;
}
function updateme() {
this._y = this._y + ystep;
ystep = ystep + accel;
if (ystep > ystepmax) {
ystep = ystepmax;
}
if (this._y > 300) {
this.bluemeg.gotoAndStop(2);
_parent.actions.dobluespark(this._x, this._y);
active = 2;
r = random(20);
rdir = random(2);
if (rdir == 0) {
rdir = -1;
}
this._rotation = this._rotation + (r * rdir);
ystep = random(2) + 1;
explodein = random(30) + 30;
}
}
function updateme2() {
this._y = this._y + ystep;
if (this._y > 380) {
active = 3;
}
updateexplode();
}
function updateme3() {
updateexplode();
}
function updateexplode() {
if (explodein < 15) {
if (this._visible == 1) {
this._visible = 0;
} else {
this._visible = 1;
}
}
explodein--;
if (explodein == 0) {
blowme();
}
}
function blowme() {
active = 0;
this.holder.gotoAndPlay(2);
this.bluemeg._visible = 0;
_parent.actions.bubbleburst(this._x, this._y);
_parent.actions.makesound("sound_explode");
}
function killme() {
removeMovieClip(this);
}
function checktnt() {
_parent.actions.checktnt(this._x, this._y);
}
if (_name == "tntg") {
this.holder.stop();
active = 0;
this._visible = 0;
} else {
setup();
}
}
onClipEvent (enterFrame) {
if (_parent.actions.gameover == 0) {
if (active == 3) {
updateme3();
}
if (active == 2) {
updateme2();
}
if (active == 1) {
updateme();
}
}
}
Instance of Symbol 190 MovieClip "levelupg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function setletter(l, sx, sy) {
depth++;
duplicateMovieClip (this.textbox1, depth, depth);
foo = this[depth];
foo.letter = l;
foo._x = sx;
}
function setup(fs) {
depth = 0;
finalstring = fs;
len = fs.length;
setletters = len;
letterorder.splice(0);
letterpos.splice(0);
x = len - 1;
while (x >= 0) {
letterorder.push(fs.substr(x, 1));
letterpos.push(x);
x--;
}
if (inorder == 0) {
loop = 0;
while (loop < 20) {
x = 0;
while (x < len) {
spot = random(len);
l1 = letterorder[spot];
s1 = letterpos[spot];
letterorder[spot] = letterorder[x];
letterpos[spot] = letterpos[x];
letterorder[x] = l1;
letterpos[x] = s1;
x++;
}
loop++;
}
}
}
function setnextletter() {
l = " ";
while ((l == " ") && (setletters >= 0)) {
setletters--;
l = letterorder[setletters];
}
if ((l != " ") && (setletters >= 0)) {
backx = mywidth * letterpos.length;
backx = backx / 2;
myx = (this.textbox1._x - backx) + (letterpos[setletters] * this.textbox1._width);
setletter(l, myx, myy);
}
killme = 40;
}
function done() {
while (depth >= 0) {
removeMovieClip(this[depth]);
depth--;
}
_parent.actions.nextlevel();
}
this.swapDepths(10000);
active = 0;
depth = 0;
setletters = 0;
delayset = 3;
mywidth = this.textbox1._width;
delay = delayset;
inorder = 1;
letterorder = new Array();
letterpos = new Array();
}
onClipEvent (enterFrame) {
if (setletters >= 0) {
delay--;
if (delay == 0) {
setnextletter();
delay = delayset;
}
}
if (killme > 0) {
killme--;
if (killme == 0) {
done();
}
}
}
Instance of Symbol 234 MovieClip "menug" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(800503);
}
Instance of Symbol 248 MovieClip "pauseframeg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(800500);
}
Instance of Symbol 227 MovieClip "bubblemaster" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function updateme() {
stepsize = stepsize - 0.5;
this._x = this._x + (random(4) - 2);
this._y = this._y + stepsize;
if (this._y < -10) {
removeMovieClip(this);
}
}
if (_name != "bubblemaster") {
this._visible = 1;
active = 1;
} else {
stop();
this._visible = 0;
active = 0;
}
if (fishbubble == 1) {
scale = 12 - random(9);
} else {
scale = 25 - random(20);
}
this._width = scale;
this._height = scale;
this._x = this._x + (scale / 2);
this._y = this._y + (scale / 2);
if (fishbubble == 1) {
stepsize = random(2) + 1;
} else {
stepsize = random(3) + 1;
}
stepsize = stepsize * -1;
}
onClipEvent (enterFrame) {
if (active) {
updateme();
}
}
Instance of Symbol 257 MovieClip "gameoverg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(800505);
}
Instance of Symbol 275 MovieClip "helpg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function showme() {
this._alpha = 0;
this._visible = 1;
active = 1;
this.gotoAndStop(2);
}
function hideme() {
this._alpha = 100;
active = -1;
}
function updateme() {
if (active == 1) {
this._alpha = this._alpha + astep;
if (this._alpha >= 100) {
active = 0;
}
}
if (active == -1) {
this._alpha = this._alpha - astep;
if (this._alpha <= 0) {
active = 0;
this._visible = 0;
this.gotoAndStop(1);
}
}
}
this.swapDepths(800506);
this._visible = 0;
astep = 35;
active = 0;
}
onClipEvent (enterFrame) {
if (active != 0) {
updateme();
}
}
Instance of Symbol 300 MovieClip "soundfx" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 304 MovieClip "bgmusic" in Symbol 324 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 323 MovieClip "soundg" in Symbol 324 MovieClip Frame 1
onClipEvent (load) {
function showme() {
this._alpha = 0;
this._visible = 1;
active = 1;
this.soundtextg.gotoAndPlay(2);
}
function hideme() {
this._alpha = 100;
active = -1;
}
function updateme() {
if (active == 1) {
this._alpha = this._alpha + astep;
if (this._alpha >= 100) {
active = 0;
}
}
if (active == -1) {
this._alpha = this._alpha - astep;
if (this._alpha <= 0) {
active = 0;
this._visible = 0;
}
}
}
this.swapDepths(800515);
this._visible = 0;
astep = 10;
active = 0;
}
onClipEvent (enterFrame) {
if (active != 0) {
updateme();
}
}