Frame 1
StinkomanXMLData.load();
Frame 10
if (((_root._totalframes > 0) && (_root._framesloaded == _root._totalframes)) && (StinkomanXMLData.allLoaded())) {
var version = System.capabilities.version;
var firstSpace = version.indexOf(" ");
var tempString = version.substring(firstSpace + 1, version.length);
var tempArray = tempString.split(",");
var majorVersion = parseInt(tempArray[0]);
trace(majorVersion + "= Flash player version");
if (majorVersion >= 7) {
_root.gotoAndPlay("loadedGo");
} else {
gotoAndStop (1);
}
} else {
_root.gotoAndPlay("loopLoader");
}
Frame 12
stop();
Frame 19
if (_global.$tweenManager == undefined) {
_global.$tweenManager = new zigo.tweenManager();
} else {
_global.$tweenManager.cleanUp();
_global.$tweenManager.init();
}
com.robertpenner.easing.Back;
com.robertpenner.easing.Bounce;
com.robertpenner.easing.Circ;
com.robertpenner.easing.Cubic;
com.robertpenner.easing.Elastic;
com.robertpenner.easing.Expo;
com.robertpenner.easing.Linear;
com.robertpenner.easing.Quad;
com.robertpenner.easing.Quart;
com.robertpenner.easing.Quint;
com.robertpenner.easing.Sine;
var Mp = MovieClip.prototype;
Mp.addListener = function () {
if (!this._listeners) {
AsBroadcaster.initialize(this);
}
this.addListener.apply(this, arguments);
};
ASSetPropFlags(Mp, "addListener", 1, 0);
Mp.tween = function (props, pEnd, seconds, animType, delay, callback, extra1, extra2) {
if (_global.$tweenManager.isTweenLocked(this)) {
trace("tween not added, this movieclip is locked");
return(undefined);
}
if (arguments.length < 2) {
trace("tween not added, props & pEnd must be defined");
return(undefined);
}
if (typeof(props) == "string") {
if (props.indexOf(",") > -1) {
props = props.split(" ").join("").split(",");
} else {
props = [props];
}
}
if (!(pEnd instanceof Array)) {
pEnd = [pEnd];
while (pEnd.length < props.length) {
pEnd.push(pEnd[0]);
}
}
if (seconds == undefined) {
seconds = 2;
} else if (seconds < 0.01) {
seconds = 0;
}
if ((delay < 0.01) || (delay == undefined)) {
delay = 0;
}
switch (typeof(animType)) {
case "string" :
animType = animType.toLowerCase();
if (animType == "linear") {
var eqf = com.robertpenner.easing.Linear.easeNone;
} else if (animType.indexOf("easeoutin") == 0) {
var t = animType.substr(9);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeOutIn;
} else if (animType.indexOf("easeinout") == 0) {
var t = animType.substr(9);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeInOut;
} else if (animType.indexOf("easein") == 0) {
var t = animType.substr(6);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeIn;
} else if (animType.indexOf("easeout") == 0) {
var t = animType.substr(7);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeOut;
}
if (eqf == undefined) {
var eqf = com.robertpenner.easing.Expo.easeOut;
}
break;
case "function" :
var eqf = animType;
break;
case "object" :
if ((animType.ease != undefined) && (animType.pts != undefined)) {
var eqf = animType.ease;
extra1 = animType.pts;
} else {
var eqf = com.robertpenner.easing.Expo.easeOut;
}
break;
default :
var eqf = com.robertpenner.easing.Expo.easeOut;
}
switch (typeof(callback)) {
case "function" :
callback = {func:callback, scope:this._parent};
break;
case "string" :
var ilp;
var funcp;
var scope;
var args;
var a;
ilp = callback.indexOf("(");
funcp = callback.slice(0, ilp);
scope = eval (funcp.slice(0, funcp.lastIndexOf(".")));
func = eval (funcp);
args = callback.slice(ilp + 1, callback.lastIndexOf(")")).split(",");
var i = 0;
while (i < args.length) {
a = eval (args[i]);
if (a != undefined) {
args[i] = a;
}
i++;
}
callback = {func:func, scope:scope, args:args};
}
if (_global.$tweenManager.autoStop) {
_global.$tweenManager.removeTween(this);
}
if (delay > 0) {
_global.$tweenManager.addTweenWithDelay(delay, this, props, pEnd, seconds, eqf, callback, extra1, extra2);
} else {
_global.$tweenManager.addTween(this, props, pEnd, seconds, eqf, callback, extra1, extra2);
}
};
Mp.stopTween = function (props) {
if (typeof(props) == "string") {
if (props.indexOf(",") > -1) {
props = props.split(" ").join("").split(",");
} else {
props = [props];
}
}
_global.$tweenManager.removeTween(this, props);
};
Mp.isTweening = function (prop) {
return(_global.$tweenManager.isTweening(this, prop));
};
Mp.getTweens = function () {
return(_global.$tweenManager.getTweens(this));
};
Mp.lockTween = function () {
_global.$tweenManager.lockTween(this, true);
};
Mp.unlockTween = function () {
_global.$tweenManager.lockTween(this, false);
};
Mp.isTweenLocked = function () {
return(_global.$tweenManager.isTweenLocked(this));
};
Mp.isTweenPaused = function (prop) {
return(_global.$tweenManager.isTweenPaused(this, prop));
};
Mp.pauseTween = function (props) {
var _local4;
if (props != undefined) {
if (typeof(props) == "string") {
if (props.indexOf(",") > -1) {
props = props.split(" ").join("").split(",");
} else {
props = [props];
}
}
_local4 = {};
for (var _local5 in props) {
_local4[props[_local5]] = true;
}
}
_global.$tweenManager.pauseTween(this, _local4);
};
Mp.unpauseTween = function (props) {
var _local4;
if (props != undefined) {
if (typeof(props) == "string") {
if (props.indexOf(",") > -1) {
props = props.split(" ").join("").split(",");
} else {
props = [props];
}
}
_local4 = {};
for (var _local5 in props) {
_local4[props[_local5]] = true;
}
}
_global.$tweenManager.unpauseTween(this, _local4);
};
Mp.pauseAllTweens = function () {
_global.$tweenManager.pauseTween();
};
Mp.unpauseAllTweens = function () {
_global.$tweenManager.unpauseTween();
};
Mp.stopAllTweens = function () {
_global.$tweenManager.stopAll();
};
Mp.ffTween = function (props) {
var _local4;
if (props != undefined) {
if (typeof(props) == "string") {
if (props.indexOf(",") > -1) {
props = props.split(" ").join("").split(",");
} else {
props = [props];
}
}
_local4 = {};
for (var _local5 in props) {
_local4[props[_local5]] = true;
}
}
_global.$tweenManager.ffTween(this, _local4);
};
Mp.rewTween = function (props) {
var _local4;
if (props != undefined) {
if (typeof(props) == "string") {
if (props.indexOf(",") > -1) {
props = props.split(" ").join("").split(",");
} else {
props = [props];
}
}
_local4 = {};
for (var _local5 in props) {
_local4[props[_local5]] = true;
}
}
_global.$tweenManager.rewTween(this, _local4);
};
Mp.alphaTo = function (destAlpha, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_alpha"], [destAlpha], seconds, animType, delay, callback, extra1, extra2);
};
Mp.scaleTo = function (destScale, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_xscale", "_yscale"], [destScale, destScale], seconds, animType, delay, callback, extra1, extra2);
};
Mp.sizeTo = function (destSize, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_width", "_height"], [destSize, destSize], seconds, animType, delay, callback, extra1, extra2);
};
Mp.slideTo = function (destX, destY, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_x", "_y"], [destX, destY], seconds, animType, delay, callback, extra1, extra2);
};
Mp.rotateTo = function (destRotation, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_rotation"], [destRotation], seconds, animType, delay, callback, extra1, extra2);
};
_global.getColorTransObj = function (type, amt, rgb) {
switch (type) {
case "brightness" :
var _local4 = 100 - Math.abs(amt);
var _local6 = 0;
if (amt > 0) {
_local6 = 256 * (amt / 100);
}
return({ra:_local4, rb:_local6, ga:_local4, gb:_local6, ba:_local4, bb:_local6});
case "brightOffset" :
_local6 = 256 * (amt / 100);
return({ra:100, rb:_local6, ga:100, gb:_local6, ba:100, bb:_local6});
case "contrast" :
var _local2 = {};
_local2.ra = (_local2.ga = (_local2.ba = amt));
_local2.rb = (_local2.gb = (_local2.bb = 128 - (1.28 * amt)));
return(_local2);
case "invertColor" :
_local2 = {};
_local2.ra = (_local2.ga = (_local2.ba = 100 - (2 * amt)));
_local2.rb = (_local2.gb = (_local2.bb = amt * 2.55));
return(_local2);
case "tint" :
if ((rgb == undefined) || (rgb == null)) {
} else {
var _local8 = rgb >> 16;
var _local9 = (rgb >> 8) & 255;
var _local7 = rgb & 255;
var _local5 = amt / 100;
_local2 = {rb:_local8 * _local5, gb:_local9 * _local5, bb:_local7 * _local5};
_local2.ra = (_local2.ga = (_local2.ba = 100 - amt));
return(_local2);
}
}
return({rb:0, ra:100, gb:0, ga:100, bb:0, ba:100});
};
Mp.brightnessTo = function (bright, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_ct_"], [getColorTransObj("brightness", bright)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.brightOffsetTo = function (percent, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_ct_"], [getColorTransObj("brightOffset", percent)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.contrastTo = function (percent, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_ct_"], [getColorTransObj("contrast", percent)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.colorTo = function (rgb, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_ct_"], [getColorTransObj("tint", 100, rgb)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.colorTransformTo = function (ra, rb, ga, gb, ba, bb, aa, ab, seconds, animType, delay, callback, extra1, extra2) {
var _local2 = {ra:ra, rb:rb, ga:ga, gb:gb, ba:ba, bb:bb, aa:aa, ab:ab};
this.tween(["_ct_"], [_local2], seconds, animType, delay, callback, extra1, extra2);
};
Mp.invertColorTo = function (percent, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_ct_"], [getColorTransObj("invertColor", percent)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.tintTo = function (rgb, percent, seconds, animType, delay, callback, extra1, extra2) {
this.tween(["_ct_"], [getColorTransObj("tint", percent, rgb)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.getFrame = function () {
return(this._currentframe);
};
Mp.setFrame = function (fr) {
this.gotoAndStop(Math.round(fr));
};
Mp.addProperty("_frame", Mp.getFrame, Mp.setFrame);
Mp.frameTo = function (endframe, duration, animType, delay, callback, extra1, extra2) {
if (endframe == undefined) {
endframe = this._totalframes;
}
this.tween("_frame", endframe, duration, animType, delay, callback, extra1, extra2);
};
var TFP = TextField.prototype;
if (!TFP.origAddListener) {
TFP.origAddListener = TFP.addListener;
ASSetPropFlags(TFP, "origAddListener", 1, 0);
TFP.addListener = function () {
if (!this._listeners) {
AsBroadcaster.initialize(this);
}
this.origAddListener.apply(this, arguments);
};
}
var $_$methods = ["tween", "stopTween", "isTweening", "getTweens", "lockTween", "isTweenLocked", "unlockTween", "isTweenPaused", "pauseTween", "unpauseTween", "pauseAllTweens", "unpauseAllTweens", "stopAllTweens", "ffTween", "rewTween", "getFrame", "setFrame", "_frame", "frameTo", "alphaTo", "brightnessTo", "colorTo", "colorTransformTo", "invertColorTo", "tintTo", "scaleTo", "sizeTo", "slideTo", "rotateTo", "brightOffsetTo", "contrastTo"];
for (var $_$i in $_$methods) {
ASSetPropFlags(Mp, $_$methods[$_$i], 1, 0);
if ($_$methods[$_$i].toLowerCase().indexOf("frame") == -1) {
TFP[$_$methods[$_$i]] = Mp[$_$methods[$_$i]];
ASSetPropFlags(TFP, $_$methods[$_$i], 1, 0);
}
}
delete Mp;
delete TFP;
delete $_$methods;
delete $_$i;
StinkoSaveData.convertOldData();
_quality = "HIGH";
stop();
Frame 35
gotoAndStop ("titleScreen");
Frame 60
gotoAndStop ("titleScreen");
Frame 76
_quality = "HIGH";
stop();
Frame 78
gotoAndStop(_currentframe - 1 +18);
Frame 86
_quality = "HIGH";
stop();
Frame 88
gotoAndStop(_currentframe - 1 +18);
Frame 95
_quality = "HIGH";
stop();
Frame 97
gotoAndStop(_currentframe - 1 +18);
Frame 105
_quality = "HIGH";
stop();
Frame 107
gotoAndStop(_currentframe - 1 +18);
Frame 116
_quality = "HIGH";
stop();
Frame 118
gotoAndStop(_currentframe - 1 +18);
Frame 126
function cutSceneEnded() {
GlobalData.cutSceneEnded();
}
_quality = "HIGH";
_root.cutSceneAllowed = true;
GlobalData.showCutScene();
stop();
Frame 135
_quality = "HIGH";
stop();
Frame 143
trace("GamePlay reached " + this._name);
trace("GamePlay GlobalData.subsublevel = " + GlobalData.subsublevel);
var iFace = new Interface(interface_mc);
Interface.showStartUpMessage();
var sGame;
if ((GlobalData.sublevel == 3) && (GlobalData.subsublevel < 3)) {
new JumpingGame(_root, viewbox_mc);
} else {
if ((GlobalData.sublevel > 2) && (GlobalData.subsublevel == 3)) {
_root.lData = new LevelData(_root, _root.gameStage_mc, false);
_root.lData.setXML(StinkomanXMLData.getXML(GlobalData.sublevel, GlobalData.subsublevel));
}
trace("_root: Stinkogame!");
lData.gameStage_mc = gameStage_mc;
_root.lData.reset();
delete sGame;
Bulllet.killAll();
if (GlobalData.sublevel == 9) {
sGame = new ShootingGame(_root, _root.lData, viewbox_mc);
} else {
sGame = new StinkoGame(_root, _root.lData, viewbox_mc);
Platform.unpause();
}
}
stop();
Instance of Symbol 1079 MovieClip "viewbox_mc" in Frame 143
/* no clip actions */
Frame 145
gotoAndStop(_currentframe - 1 +18);
Frame 153
_quality = "HIGH";
GlobalData.lastSceneStorage.gameStageX = undefined;
GlobalData.lastSceneStorage.playerX = undefined;
stop();
Frame 161
_quality = "HIGH";
stop();
Frame 172
StinkoGame.doneDyingAndCrying();
Symbol 53 MovieClip Frame 12
StinkoGame.killAll();
Symbol 53 MovieClip Frame 41
Interface.showKeepTry();
Symbol 53 MovieClip Frame 80
if (_parent.gameMode == "jumping") {
JumpingGame.doneDying();
} else {
StinkoGame.doneDying();
}
stop();
Symbol 66 MovieClip Frame 82
StinkoGame.levelDoneDone();
Symbol 98 MovieClip Frame 95
_parent.mPlayer.getFrozen();
Symbol 98 MovieClip Frame 200
_parent.mPlayer.getUnfrozen();
Symbol 102 MovieClip [playerRegular] Frame 1
stop();
Symbol 102 MovieClip [playerRegular] Frame 7
stop();
Symbol 102 MovieClip [playerRegular] Frame 13
stop();
Symbol 102 MovieClip [playerRegular] Frame 19
stop();
Symbol 102 MovieClip [playerRegular] Frame 25
stop();
Symbol 102 MovieClip [playerRegular] Frame 31
stop();
Symbol 102 MovieClip [playerRegular] Frame 37
stop();
Symbol 102 MovieClip [playerRegular] Frame 43
stop();
Symbol 102 MovieClip [playerRegular] Frame 49
stop();
Symbol 102 MovieClip [playerRegular] Frame 55
stop();
Symbol 102 MovieClip [playerRegular] Frame 61
stop();
Symbol 102 MovieClip [playerRegular] Frame 69
stop();
Symbol 102 MovieClip [playerRegular] Frame 77
stop();
Symbol 102 MovieClip [playerRegular] Frame 85
stop();
Symbol 102 MovieClip [playerRegular] Frame 93
stop();
Symbol 102 MovieClip [playerRegular] Frame 104
stop();
Symbol 102 MovieClip [playerRegular] Frame 115
stop();
Symbol 102 MovieClip [playerRegular] Frame 123
stop();
Symbol 102 MovieClip [playerRegular] Frame 131
stop();
Symbol 102 MovieClip [playerRegular] Frame 143
stop();
Symbol 102 MovieClip [playerRegular] Frame 154
stop();
Symbol 102 MovieClip [playerRegular] Frame 167
stop();
Symbol 102 MovieClip [playerRegular] Frame 180
stop();
Symbol 102 MovieClip [playerRegular] Frame 188
stop();
Symbol 102 MovieClip [playerRegular] Frame 198
stop();
Symbol 102 MovieClip [playerRegular] Frame 208
stop();
Symbol 102 MovieClip [playerRegular] Frame 219
stop();
Symbol 102 MovieClip [playerRegular] Frame 232
play();
Symbol 102 MovieClip [playerRegular] Frame 306
gotoAndStop ("levelDone");
Symbol 116 MovieClip [cloudskymiddle] Frame 1
stop();
Symbol 116 MovieClip [cloudskymiddle] Frame 80
gotoAndStop (1);
Symbol 126 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 6
trace("bossBrain_mc.animator_mc: " + _parent.myBoss.dead);
if (!_parent.myBoss.dead) {
gotoAndPlay ("flash");
}
Symbol 126 MovieClip Frame 11
if (!_parent.myBoss.dead) {
gotoAndPlay ("off");
_parent.myBoss.shootBullets();
}
Symbol 126 MovieClip Frame 72
_parent.myBoss.doneDying();
stop();
Symbol 127 MovieClip [brainBoss] Frame 1
stop();
Symbol 130 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 36
this._parent.myBoss.doneStomping(this.mID);
stop();
Symbol 138 MovieClip Frame 3
gotoAndPlay ("normal");
Symbol 139 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 13
this._parent.myBoss.doneHeadEnter();
Symbol 139 MovieClip Frame 49
stop();
Symbol 139 MovieClip Frame 55
this._parent.myBoss.doneHeadLeave();
stop();
Symbol 142 MovieClip [bossChicken_mc] Frame 1
stop();
Symbol 142 MovieClip [bossChicken_mc] Frame 95
myBoss.doneDying();
stop();
Symbol 143 MovieClip [bossBrain_mc] Frame 1
stop();
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 9
stop();
Symbol 147 MovieClip Frame 15
stop();
Symbol 147 MovieClip Frame 20
stop();
Symbol 147 MovieClip Frame 28
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 7
stop();
Symbol 174 MovieClip [bossWall_mc] Frame 1
stop();
Symbol 188 MovieClip [1up_walker_mc] Frame 1
stop();
Symbol 188 MovieClip [1up_walker_mc] Frame 14
stop();
Symbol 188 MovieClip [1up_walker_mc] Frame 55
stop();
StinkoGame.levelDoneDone();
Symbol 188 MovieClip [1up_walker_mc] Frame 63
stop();
Symbol 196 MovieClip Frame 1
stop();
Symbol 196 MovieClip Frame 14
stop();
Symbol 201 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 14
stop();
Symbol 206 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 14
stop();
Symbol 212 MovieClip Frame 13
gotoAndPlay (1);
Symbol 212 MovieClip Frame 19
_parent._parent.mBoss.fireBullet();
Symbol 212 MovieClip Frame 22
gotoAndPlay (1);
Symbol 212 MovieClip Frame 35
gotoAndPlay (1);
Symbol 213 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 41
stop();
mBoss.doneFrooshing();
Symbol 233 MovieClip [moonsky2] Frame 1
stop();
Symbol 236 MovieClip [cloudskyfront] Frame 1
stop();
Symbol 236 MovieClip [cloudskyfront] Frame 80
gotoAndStop (1);
Symbol 240 MovieClip [cloudskyback] Frame 1
stop();
Symbol 248 MovieClip [dropCloudBaddie] Frame 6
gotoAndPlay ("loop");
Symbol 248 MovieClip [dropCloudBaddie] Frame 9
this.myDrop.collectable = true;
Symbol 248 MovieClip [dropCloudBaddie] Frame 40
myDrop.kill();
stop();
Symbol 248 MovieClip [dropCloudBaddie] Frame 42
myDrop.kill();
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 70
_parent.mBoss.halfwayPointReached();
Symbol 263 MovieClip [BossTornado_mc] Frame 1
stop();
Symbol 1121 MovieClip [__Packages.StinkoGame] Frame 0
class StinkoGame
{
static var ld, _mc, bullet_mc, scrollLimitR, scrollLimitL, scrollLimitB, scrollLimitT, activeStageCounterX, activeStageCounterY, viewBox, sScrollA, sScrollB, sScrollC, oneUp, player1, originX, originY, scrollLockX, scrollLockY, gameSound, bossMan;
function StinkoGame (p_mc, pld, viewBox_mc) {
var _local5 = this;
if (GlobalData.bossLevel()) {
_root._quality = "HIGH";
} else {
_root._quality = "LOW";
}
ld = pld;
_root.lData = new LevelData(_root, _root.gameStage_mc, false);
_root.lData.setXML(StinkomanXMLData.getXML(GlobalData.sublevel, GlobalData.subsublevel));
_mc = p_mc;
bullet_mc = _mc.bullet_mc;
BulletFriendly.onScreenCounter = 0;
Bullet.killAll();
scrollLimitR = 300;
scrollLimitL = 200;
scrollLimitB = 200;
scrollLimitT = 200;
activeStageCounterX = 0;
activeStageCounterY = 0;
viewBox = new Object();
viewBox.l = viewBox_mc._x;
viewBox.t = viewBox_mc._y;
viewBox.r = viewBox_mc._x + viewBox_mc._width;
viewBox.b = viewBox_mc._y + viewBox_mc._height;
if ((GlobalData.level == 1) && (GlobalData.sublevel == 1)) {
sScrollA = new SeamlessScroll("sky", _mc.skyA_mc, false, true, 2, {x:0, y:0}, viewBox);
sScrollB = new SeamlessScroll("sky2", _mc.skyB_mc, false, true, 0, {x:0, y:0}, viewBox);
} else if ((GlobalData.level == 1) && (GlobalData.sublevel == 2)) {
sScrollA = new SeamlessScroll("sky", _mc.skyA_mc, false, true, 0, {x:0, y:0}, viewBox);
sScrollB = new SeamlessScroll("kitchenWall", _mc.skyB_mc, false, true, 2, {x:0, y:0}, viewBox);
} else if ((GlobalData.level == 1) && (GlobalData.sublevel == 3)) {
sScrollA = new SeamlessScroll("sky", _mc.skyA_mc, false, true, 2, {x:0, y:0}, viewBox);
} else if (GlobalData.sublevel == 4) {
sScrollA = new SeamlessScroll("cavern", _mc.skyA_mc, false, true, 0, {x:0, y:0}, viewBox);
sScrollB = new SeamlessScroll("level4_foreground", _mc.skyB_mc, false, true, 2, {x:0, y:0}, viewBox);
} else if (GlobalData.sublevel == 5) {
sScrollA = new SeamlessScroll("moonsky2", _mc.skyA_mc, false, true, 2, {x:0, y:0}, viewBox);
sScrollB = new SeamlessScroll("moonsky1", _mc.skyB_mc, false, true, 0, {x:0, y:0}, viewBox);
if (GlobalData.subsublevel != 3) {
sScrollC = _mc.skyC_mc.attachMovie("shipFlyBy", "shipFlyBy", 1);
}
} else if (GlobalData.sublevel == 6) {
sScrollA = new SeamlessScroll("cloudskyback", _mc.skyA_mc, false, true, 0, {x:0, y:0}, viewBox);
sScrollB = new SeamlessScroll("cloudskymiddle", _mc.skyB_mc, false, true, 0, {x:0, y:0}, viewBox);
sScrollC = new SeamlessScroll("cloudskyfront", _mc.skyC_mc, false, true, 0, {x:3, y:0}, viewBox);
} else if (GlobalData.sublevel == 7) {
sScrollA = new SeamlessScroll("iceskyback", _mc.skyA_mc, false, true, 0, {x:0, y:0}, viewBox);
sScrollB = new SeamlessScroll("iceskyfront", _mc.skyB_mc, false, true, 2, {x:0, y:0}, viewBox);
} else if (GlobalData.sublevel == 8) {
if (GlobalData.subsublevel < 3) {
sScrollA = new SeamlessScroll("negativeSkyBack", _mc.skyA_mc, false, true, 0, {x:0, y:0}, viewBox);
sScrollB = new SeamlessScroll("negativeSkyFront", _mc.skyB_mc, false, true, 2, {x:0, y:0}, viewBox);
}
} else if (GlobalData.sublevel == 9) {
sScrollA = new SeamlessScroll("level9_background", _mc.skyA_mc, false, true, 2, {x:0, y:0}, viewBox);
}
if ((GlobalData.sublevel == 4) && (GlobalData.subsublevel < 3)) {
oneUp = new Homestar(_mc.gameStage_mc);
} else {
delete oneUp;
}
ld.redrawStageFromXML();
trace("StinkoGame::instantiator: ld.redrawStageFromXML " + ld.stageObjSource.length);
var _local3;
if (GlobalData.sublevel == 4) {
_local3 = _mc.playerClip_mc.attachMovie("playerFistman", "playerClip", 1);
player1 = new PlayerWithFist(_local3);
} else if (GlobalData.sublevel == 5) {
_local3 = _mc.playerClip_mc.attachMovie("playerOneUp", "playerClip", 1);
player1 = new PlayerOneUp(_local3);
} else if (GlobalData.sublevel == 7) {
_local3 = _mc.playerClip_mc.attachMovie("playerRegular", "playerClip", 1);
player1 = new PlayerIce(_local3);
} else if (GlobalData.sublevel == 9) {
_local3 = _mc.playerClip_mc.attachMovie("playerShooter", "playerClip", 1);
player1 = new PlayerShip(_local3);
} else {
_local3 = _mc.playerClip_mc.attachMovie("playerRegular", "playerClip", 1);
player1 = new Player(_local3);
}
if (GlobalData.sublevel < 3) {
if ((((((GlobalData.lastSceneStorage.playerX != undefined) && (GlobalData.bossLevel())) && (GlobalData.sublevel != 3)) && (GlobalData.sublevel != 4)) && (GlobalData.sublevel != 5)) && (GlobalData.sublevel != 6)) {
player1._mc._x = GlobalData.lastSceneStorage.playerX;
player1._mc._y = GlobalData.lastSceneStorage.playerY;
}
if ((((GlobalData.lastSceneStorage.gameStageX != undefined) && (GlobalData.sublevel != 4)) && (GlobalData.sublevel != 5)) && (GlobalData.sublevel != 6)) {
trace("GlobalData.lastSceneStorage.gameStageX was defined!");
_mc.gameStage_mc._x = GlobalData.lastSceneStorage.gameStageX;
_mc.gameStage_mc._y = GlobalData.lastSceneStorage.gameStageY;
} else {
trace("GlobalData.lastSceneStorage.gameStageX was not defined or not applicable!");
}
}
drawActiveStage(true);
bullet_mc._x = (originX = _mc.gameStage_mc._x);
bullet_mc._y = (originY = _mc.gameStage_mc._y);
scrollLockX = ld.levelProperties.ScrollLockX == "true";
scrollLockY = ld.levelProperties.ScrollLockY == "true";
inProgress = true;
trace("GlobalData.bossLevel() = " + GlobalData.bossLevel());
if (GlobalData.bossLevel()) {
initBoss();
} else {
gameSound.stop();
gameSound = new SoundTrack(_mc);
gameSound.startFromBeginning();
}
trace((("StinkoGame: Re-init: scrollLockX = " + scrollLockX) + ", scrollLockY = ") + scrollLockY);
}
static function nudge(x, y) {
activeStageCounterX = activeStageCounterX + x;
activeStageCounterY = activeStageCounterY + y;
if (x != 0) {
if ((_mc.gameStage_mc._x + x) > originX) {
return(false);
}
}
if (y != 0) {
if ((_mc.gameStage_mc._y + y) < originY) {
return(false);
}
}
_mc.gameStage_mc._x = _mc.gameStage_mc._x + x;
_mc.gameStage_mc._y = _mc.gameStage_mc._y + y;
bossMan._mc._y = bossMan._mc._y + y;
_mc.bullet_mc._x = _mc.gameStage_mc._x;
_mc.bullet_mc._y = _mc.gameStage_mc._y;
if (GlobalData.sublevel == 4) {
sScrollA.nudge(x / 2, y);
sScrollB.nudge(x, y);
} else if (GlobalData.sublevel == 8) {
sScrollA.nudge(-x, y);
sScrollB.nudge(x / 2, y);
} else {
sScrollA.nudge(x / 3, y);
sScrollB.nudge(x / 2, y);
sScrollC.nudge(x * 2, y);
}
if ((Math.floor(Math.abs(activeStageCounterX) / 10) > 1) || (Math.floor(Math.abs(activeStageCounterY) / 10) > 1)) {
drawActiveStage();
activeStageCounterX = 0;
activeStageCounterY = 0;
}
return(true);
}
static function getGlobalCoord(clip_mc) {
var _local1 = new Object();
_local1.x = clip_mc._x + _mc.gameStage_mc._x;
_local1.y = clip_mc._y + _mc.gameStage_mc._y;
return(_local1);
}
static function getPlayerGlobal() {
var _local1 = new Object();
_local1.x = player1._mc._x - _mc.gameStage_mc._x;
_local1.y = player1._mc._y - _mc.gameStage_mc._y;
return(_local1);
}
static function drawActiveStage(force) {
var _local2 = 0;
while (_local2 < ld.stageObjSource.length) {
var _local1 = ld.stageObjSource[_local2];
if (!_local1.__get__active()) {
if (isWithinActiveStage(_local1.x, _local1.y, 200, 200)) {
_local1.assignedObject = ld.addStageObject(_local1.classType, _local1.subType, _local1.x, _local1.y, _local1.depth, _local1.propObj);
_local1.__set__active(true);
}
} else if ((_local1.assignedObject.dontRespawn == false) && (!isWithinActiveStage(_local1.assignedObject._mc._x, _local1.assignedObject._mc._y, 200, 200))) {
_local1.__set__active(false);
_local1.assignedObject.kill();
_local1.assignedObject = undefined;
}
_local2++;
}
}
static function resetEnemies() {
var _local1 = 0;
while (_local1 < ld.stageObjSource.length) {
var _local2 = ld.stageObjSource[_local1];
_local2.__set__active(false);
_local1++;
}
}
static function isWithinActiveStage(x, y, xBuf, yBuf) {
return((((x > ((viewBox.l - _mc.gameStage_mc._x) - xBuf)) && (x < ((viewBox.r - _mc.gameStage_mc._x) + xBuf))) && (y > ((viewBox.t - _mc.gameStage_mc._y) - yBuf))) && (y < ((viewBox.b - _mc.gameStage_mc._y) + yBuf)));
}
static function jumpToOrigin() {
_mc.gameStage_mc._x = (bullet_mc._x = originX);
_mc.gameStage_mc._y = (bullet_mc._y = originY);
drawActiveStage(true);
}
static function winLevel() {
if (!inProgress) {
return(undefined);
}
trace("Won the frekaing levelbub!");
oneUp._mc.gotoAndStop("waitHappy");
oneUp.enabled = false;
delete player1._mc.onEnterFrame;
gameSound.stop();
if (GlobalData.shouldLevelWarp()) {
if (GlobalData.sublevel != 4) {
player1._mc.gotoAndStop("levelDone");
} else {
oneUp.win();
}
} else {
GlobalData.lastSceneStorage = new Object();
GlobalData.lastSceneStorage.gameStageX = _mc.gameStage_mc._x;
GlobalData.lastSceneStorage.gameStageY = _mc.gameStage_mc._y;
GlobalData.lastSceneStorage.playerX = player1._mc._x;
GlobalData.lastSceneStorage.playerY = player1._mc._y;
player1._mc.animator_mc.stop();
levelDoneDone();
}
inProgress = false;
}
static function loseLife(homestarInstead) {
trace("Totally died. Please play end level animation!");
inProgress = false;
delete player1._mc.onEnterFrame;
player1._mc.stop();
bossMan.stop();
GlobalData.mans--;
GlobalData.hits = 0;
Interface.update();
if (homestarInstead) {
} else if (GlobalData.sublevel == 6) {
var _local1;
_local1 = _mc.playerYouDead_mc.attachMovie("playerRegular", "playerClip", 1);
_local1._x = player1._mc._x;
_local1._y = player1._mc._y;
_local1.gotoAndStop("youDead_" + player1.facingDir);
player1._mc.removeMovieClip();
} else {
player1.gotoYouDead();
}
gameSound.stop();
}
static function doneDying() {
trace("spotlight_mc" + _root.spotlight_mc._xscale);
if (GlobalData.mans > 0) {
_root.gotoAndPlay("youDead");
} else {
_root.gotoAndPlay("gameOver");
}
}
static function spotlightWait() {
trace("StinkoGame::spotlightWait");
_root.spotlight_mc.gotoAndPlay("wait");
}
static function doneDyingAndCrying() {
_root.gotoAndStop("gamePlayGo");
ld.reset();
player1.reset();
resetEnemies();
if (GlobalData.bossLevel()) {
gameSound.stop();
gameSound = new SoundTrack(_mc);
if (GlobalData.sublevel != 4) {
gameSound.startFromBeginning();
}
}
}
static function levelDoneDone() {
GlobalData.levelUp();
_root.gotoAndPlay("cutScene");
}
static function initBoss() {
trace("initBoss() called");
scrollLockX = true;
scrollLockY = true;
switch (GlobalData.sublevel) {
case 1 :
bossMan = new BossBrain(_mc.boss_mc);
break;
case 2 :
bossMan = new BossChicken(_mc.boss_mc);
break;
case 3 :
bossMan = new BossWall(_mc.boss_mc);
break;
case 4 :
bossMan = new BossSnake(_mc.boss_mc);
break;
case 5 :
bossMan = new BossNebulon(_mc.boss_mc);
break;
case 6 :
bossMan = new BossTornado(_mc.boss_mc);
break;
case 7 :
bossMan = new BossIceMachine(_mc.boss_mc);
break;
case 8 :
bossMan = new BossNegative(_mc.boss_mc);
scrollLockY = false;
break;
case 9 :
bossMan = new BossGangster(_mc.boss_mc);
scrollLockY = false;
break;
}
var _local2 = new Sound(_mc);
if (GlobalData.sublevel == 5) {
_local2.attachSound("1up_guy2.wav");
} else {
_local2.attachSound("stinko_challenge.wav");
}
_local2.start();
_local2.onSoundComplete = function () {
};
}
static function killAll() {
var _local1 = 0;
while (_local1 < ld.stageObjects.length) {
ld.stageObjects[_local1]._mc.removeMovieClip();
ld.stageObjects[_local1]._mc.mStageObject.kill();
_local1++;
}
ld.clearStageObjects();
}
static var inProgress = false;
}
Symbol 1122 MovieClip [__Packages.Homestar] Frame 0
class Homestar
{
static var levelBeaten;
var _mc, xVel, yVel, happy, facingDir, enabled, happyCounter;
function Homestar (parent_mc) {
var thisHomestar = this;
levelBeaten = false;
_mc = parent_mc.attachMovie("1up_walker_mc", "1up_walker_mc", -1);
xVel = 1.5;
yVel = 2;
happy = false;
facingDir = "right";
_mc.onEnterFrame = function () {
thisHomestar.update();
};
_mc._x = 46;
_mc._y = 280;
enabled = true;
makeSad();
}
function update() {
if (!enabled) {
return(undefined);
}
happyCounter--;
if (happyCounter == 0) {
makeSad();
}
_mc._x = _mc._x + xVel;
var _local2;
_mc._y = _mc._y + yVel;
_local2 = MoveablePlatform.hitWalkies(_mc.hitTestWalk_mc);
if (_local2 == undefined) {
_local2 = Platform.hit(_mc.hitTestWalk_mc);
}
if (_local2 != undefined) {
_mc._y = _local2._y;
yVel = 0;
} else {
yVel = yVel + 1;
}
if (yVel >= 10) {
yVel = 0;
}
if (_mc._y > 500) {
kill();
return(undefined);
}
var _local3 = LavaFall.hitToHurt(_mc.hitTestBlock_mc);
if (_local3.length == 0) {
_local3 = Enemy.anyPlayerDangerTest(_mc.hitTestBlock_mc);
} else {
kill();
return(undefined);
}
if (_local3 != undefined) {
kill();
return(undefined);
}
}
function kill() {
_mc.gotoAndStop("hurt");
xVel = 0;
yVel = 0;
StinkoGame.player1.enabled = false;
StinkoGame.player1._mc.animator_mc.stop();
var _local3 = this;
enabled = false;
StinkoGame.loseLife(true);
var _local2 = new CameraEffectPan(_mc, _mc._x, _mc._y, 10, doneCentering);
}
function doneCentering() {
trace(("Homestar::doneCentering() The camera has centered! " + _mc._parent._parent.spotlight_mc._name) + levelBeaten);
var _local2 = _mc._parent._parent.spotlight_mc;
var _local3 = new Object();
_local3.x = _mc._x;
_local3.y = _mc._y - 25;
_mc._parent.localToGlobal(_local3);
_local2._x = _local3.x;
_local2._y = _local3.y;
_local2.gotoAndStop("on");
_local2._xscale = 1000;
_local2._yscale = 1000;
if (levelBeaten) {
trace("Homestar::doneCentering() scaling thing");
_local2.scaleTo(100, 1, "linear", 0, doneZoomingPlaySound);
} else {
_local2.scaleTo(100, 1, "linear", 0, StinkoGame.spotlightWait);
}
}
function win() {
xVel = 0;
yVel = 0;
levelBeaten = true;
StinkoGame.player1.enabled = false;
StinkoGame.player1._mc.animator_mc.stop();
var _local2 = new CameraEffectPan(_mc, _mc._x, _mc._y, 10, doneCentering);
}
function waitForMoment() {
_root.spotlight_mc.gotoAndPlay("wait");
}
function correctHappyState() {
if (happy) {
_mc.gotoAndStop("walkHappy");
} else {
_mc.gotoAndStop("walk");
}
}
static function doneZoomingPlaySound() {
StinkoGame.oneUp._mc.gotoAndPlay("waitHappyTalk");
}
function makeHappy() {
if (!enabled) {
return(undefined);
}
happy = true;
happyCounter = 20;
var _local2 = _mc.animator_mc._currentframe;
_mc.gotoAndStop("walkHappy");
_mc.animator_mc._currentframe = _local2;
}
function makeSad() {
if (!enabled) {
return(undefined);
}
happy = false;
var _local2 = _mc.animator_mc._currentframe;
_mc.gotoAndStop("walk");
_mc.animator_mc._currentframe = _local2;
}
}
Symbol 1123 MovieClip [__Packages.StageObject] Frame 0
class StageObject
{
static var namingCounter;
var subType, symbolName, parent_mc, dontRespawn, _mc, depth;
function StageObject (pParent_mc, x, y, pSubType, pSymbolName, depth) {
var _local2 = this;
if (namingCounter == undefined) {
namingCounter = 0;
}
subType = pSubType;
symbolName = pSymbolName;
parent_mc = pParent_mc;
dontRespawn = false;
if (symbolName == "YMovingPlatform0") {
symbolName = "YMovingPlatform0fix";
}
_mc = parent_mc.attachMovie(symbolName, (symbolName + "_so") + (namingCounter++), depth);
_mc._x = x;
_mc._y = y;
_mc.mStageObject = this;
}
function updateDepthParam() {
depth = _mc.getDepth();
}
function kill() {
clearFromObjectsArray();
_mc.removeMovieClip();
}
function clearFromObjectsArray() {
die();
}
function die() {
}
function getAdditonalAttributes() {
return(null);
}
static var stageObjectArray = new Array();
}
Symbol 1124 MovieClip [__Packages.MoveablePlatform] Frame 0
class MoveablePlatform extends StageObject
{
static var MoveablePlatformArray;
var movementOffset, switchCode, axis, range, start, dir, pos, classType, _mc;
function MoveablePlatform (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "MoveablePlatform" + typeNum, depth);
if (MoveablePlatformArray == undefined) {
MoveablePlatformArray = new Array();
}
movementOffset = new Array();
movementOffset._x = 16;
movementOffset._y = 8;
switchCode = Number(initObj.switchCode);
if ((switchCode == undefined) || (isNaN(switchCode))) {
switchCode = 0;
}
axis = initObj.axis;
if (axis == undefined) {
axis = "_x";
}
range = Number(initObj.range);
if ((range == undefined) || (isNaN(range))) {
range = 0;
}
start = Number(initObj.start);
if ((start == undefined) || (isNaN(start))) {
start = 0;
}
if (start > range) {
start = range;
}
dir = Number(initObj.dir);
if ((dir == undefined) || (isNaN(dir))) {
dir = 1;
}
pos = start;
classType = "MoveablePlatform";
var _local5 = this;
trace((((((((("MoveablePlatform(): " + _mc._name) + ", MoveablePlatform parent = ") + _mc._parent) + ",axis=") + axis) + ",range=") + range) + ",start=") + start);
MoveablePlatformArray.push(this);
if (LevelEditor.editorActive) {
updateRangeLife();
updateStartPos();
} else {
_mc[axis] = _mc[axis] + (pos * movementOffset[axis]);
}
updateArrowDir();
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < MoveablePlatformArray.length) {
if (this == MoveablePlatformArray[_local2]) {
MoveablePlatformArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < MoveablePlatformArray.length) {
if (test_mc.hitTest(MoveablePlatformArray[_local1]._mc) && (test_mc != MoveablePlatformArray[_local1]._mc)) {
return(MoveablePlatformArray[_local1]._mc);
}
_local1++;
}
return(undefined);
}
static function hitWalkies(test_mc) {
var _local1 = 0;
while (_local1 < MoveablePlatformArray.length) {
if (test_mc.hitTest(MoveablePlatformArray[_local1]._mc.hitTest_mc)) {
return(MoveablePlatformArray[_local1]._mc);
}
_local1++;
}
return(undefined);
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.switchCode = switchCode;
_local2.axis = axis;
_local2.range = range;
_local2.start = start;
_local2.dir = dir;
return(_local2);
}
static function affectAll(code) {
var _local1 = 0;
while (_local1 < MoveablePlatformArray.length) {
if (MoveablePlatformArray[_local1].switchCode == code) {
MoveablePlatformArray[_local1].affect();
}
_local1++;
}
}
function affect() {
trace("MoveablePlatform::move() " + axis);
var _local2 = pos;
pos = pos + dir;
if (pos > range) {
pos = pos - 2;
dir = -1;
}
if (pos < 0) {
pos = pos + 2;
dir = 1;
}
_mc[axis] = _mc[axis] + (movementOffset[axis] * dir);
if (hit(_mc) != undefined) {
trace("MoveablePlatform::affect() rejected because of interference");
_mc[axis] = _mc[axis] - (movementOffset[axis] * dir);
pos = _local2;
}
updateArrowDir();
}
function updateRangeLife(newRange) {
if (newRange != undefined) {
range = newRange;
}
trace("MoveablePlatform::updateRangeLife() " + range);
var _local2 = 0;
while (_mc["guide" + _local2]._name != undefined) {
_mc["guide" + _local2].removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 <= range) {
var _local3 = _mc.attachMovie("MovablePlatformGhost", "guide" + _local2, _local2);
_local3[axis] = _local2 * movementOffset[axis];
_local2++;
}
}
function updateStartPos(newPos) {
if (newPos != undefined) {
start = newPos;
}
_mc.panel_mc[axis] = start * movementOffset[axis];
}
function resetAxis(newAxis) {
if (newAxis != undefined) {
axis = newAxis;
}
_mc.panel_mc._x = 0;
_mc.panel_mc._y = 0;
updateRangeLife();
updateStartPos();
updateArrowDir();
}
function updateArrowDir() {
var _local2 = dir;
if (!LevelEditor.editorActive) {
if ((pos + dir) > range) {
indicateLimitHit();
_local2 = -1;
}
if ((pos + dir) < 0) {
indicateLimitHit();
_local2 = 1;
}
}
if (axis == "_x") {
if (_local2 > 0) {
_mc.panel_mc.gotoAndStop("r");
} else {
_mc.panel_mc.gotoAndStop("l");
}
} else if (_local2 > 0) {
_mc.panel_mc.gotoAndStop("d");
} else {
_mc.panel_mc.gotoAndStop("u");
}
}
function indicateLimitHit() {
trace("MoveablePlatform::indicateLimitHit()");
_mc.indicator_mc.gotoAndPlay("go");
}
}
Symbol 1125 MovieClip [__Packages.LevelEditor] Frame 0
class LevelEditor
{
static var _mc, lData, gameStage_mc, gameStageStartingX, gameStageStartingY, viewProps, zoomLevel, stageVelX, stageVelY, gridSize, mainMenuBar, selectedObjects, keyListener, lastSelectedObjIndex, palDepthCount, palHeightCount, typeArray, palHeightSpacer, palChangeListener;
function LevelEditor (p_mc, pGameStage_mc) {
var _local5 = this;
editorActive = true;
var _local4 = new Sound(_root);
_local4.setVolume(0);
_mc = p_mc;
var _local6 = new PropertyInspector(_mc.propertyInspector_mc);
lData = new LevelData(p_mc, pGameStage_mc, true);
gameStage_mc = pGameStage_mc;
gameStageStartingX = _mc.gameStage_mc._x;
gameStageStartingY = _mc.gameStage_mc._y;
trace("gameStageStartingX " + gameStageStartingX);
viewProps = new Object();
zoomLevel = 0;
stageVelX = 0;
stageVelY = 0;
gridSize = 8;
gameStage_mc.onEnterFrame = function () {
LevelEditor.updateGameStage();
};
mainMenuBar = _mc.mainMenuBar;
initMenus();
pGameStage_mc.onMouseDown = function () {
LevelEditor.stagePressed();
};
pGameStage_mc.onMouseUp = function () {
LevelEditor.stageReleased();
};
selectedObjects = new Array();
initStagePal();
updateButtonEnabled();
_mc.levelXML_mc._visible = false;
_mc.loadLevel_mc._visible = false;
_mc.levelProperties_mc._visible = false;
_mc.confirmBufferWrite_mc._visible = false;
keyListener = new Object();
keyListener.onKeyDown = function () {
LevelEditor.keyPressed();
};
Key.addListener(keyListener);
_mc.gameStage_mc.playerloc_mc.onPress = function () {
this.startDrag(false);
};
_mc.gameStage_mc.playerloc_mc.onRelease = function () {
_root.stopDrag();
};
}
static function initMenus() {
var _local2 = mainMenuBar.addMenu("File");
_local2.addMenuItem({label:"Load from XML", instanceName:"openXML_menuItem", type:"command"});
_local2.addMenuItem({label:"Load from Buffer", instanceName:"openBuffer_menuItem", type:"command"});
_local2.addMenuItem({label:"Save to Buffer", instanceName:"saveBuffer_menuItem", type:"command"});
_local2.addMenuItem({label:"Show XML", instanceName:"showXML_menuItem", type:"command"});
var _local4 = mainMenuBar.addMenu("Edit");
_local4.addMenuItem({label:"Clear all", instanceName:"clear_menuItem", type:"command"});
_local4.addMenuItem({label:"Select all (A)", instanceName:"selectAll_menuItem", type:"command"});
_local4.addMenuItem({label:"Level Properties", instanceName:"prop_menuItem", type:"command"});
var _local6 = mainMenuBar.addMenu("View");
_local6.addMenuItem({label:"Zoom Out (Z)", instanceName:"zoom_menuItem", type:"command"});
_local6.addMenuItem({label:"Unzoom (Z,U)", instanceName:"unzoom_menuItem", type:"command"});
var _local5 = new Object();
_local5.change = function (event) {
var _local1 = event.menuItem;
trace("Item selected: " + _local1.attributes.label);
for (var _local2 in _local1.attributes) {
trace((_local2 + ":") + _local1.attributes[_local2]);
}
switch (_local1.attributes.instanceName) {
case "openBuffer_menuItem" :
trace("Open level from buffer");
LevelEditor.lData.setXML(LocalData.load("stinkomanLevel", "lDataXML", "/"));
LevelEditor._mc.sky_mc.gotoAndStop(LevelEditor._mc.levelProperties_mc.backgroundA.value);
break;
case "saveBuffer_menuItem" :
trace("Save level to buffer");
LevelEditor.saveBufferChosen();
break;
case "openXML_menuItem" :
trace("Open existing level");
LevelEditor.createOpenWindow();
break;
case "clear_menuItem" :
trace("Clear all");
LevelEditor.clearAll();
break;
case "prop_menuItem" :
LevelEditor._mc.levelProperties_mc._visible = true;
break;
case "showXML_menuItem" :
trace("Show XML");
LevelEditor.openXMLwindow();
break;
case "selectAll_menuItem" :
trace("Select all");
LevelEditor.selectAll();
break;
case "zoom_menuItem" :
trace("Zoom out");
LevelEditor.zoomOut();
break;
case "unzoom_menuItem" :
trace("Unzoom");
LevelEditor.unzoom();
break;
default :
trace("Couldn't find a match");
}
LevelEditor._mc.bringUp_btn.setFocus();
};
_local2.addEventListener("change", _local5);
_local4.addEventListener("change", _local5);
_local6.addEventListener("change", _local5);
var _local7 = new Object();
_local7.change = function (eventObj) {
trace("event: " + eventObj.target.value);
if (eventObj.target.value == 0) {
LevelEditor._mc.sky_mc._visible = false;
} else {
LevelEditor._mc.sky_mc.gotoAndStop(eventObj.target.value);
LevelEditor._mc.sky_mc._visible = true;
}
};
_mc.levelProperties_mc.backgroundA.maximum = _mc.sky_mc._totalframes;
_mc.levelProperties_mc.backgroundA.addEventListener("change", _local7);
}
static function centerGameStage() {
gameStage_mc._x = gameStageStartingX;
gameStage_mc._y = gameStageStartingY;
}
static function moveGameStageToEndpoint() {
gameStage_mc._x = (gameStageStartingX - gameStage_mc._width) + _mc.mask_mc._width;
}
static function setSelected(obj) {
var _local1 = 0;
while (_local1 < selectedObjects.length) {
selectedObjects[_local1]._mc._alpha = 100;
_local1++;
}
selectedObjects = new Array();
if (obj != undefined) {
addSelected(obj);
}
updateButtonEnabled();
}
static function addSelected(obj) {
var _local1 = 0;
while (_local1 < selectedObjects.length) {
if (selectedObjects[_local1] == obj) {
lastSelectedObjIndex = _local1;
return(undefined);
}
_local1++;
}
selectedObjects.push(obj);
lastSelectedObjIndex = selectedObjects.length - 1;
obj._mc._alpha = 70;
updateButtonEnabled();
}
static function removeSelected(num) {
selectedObjects.splice(num, 1);
updateButtonEnabled();
}
static function deleteSelected() {
var _local1 = 0;
while (_local1 < selectedObjects.length) {
lData.removeObject(selectedObjects[_local1]);
_local1++;
}
selectedObjects = new Array();
updateButtonEnabled();
lData.compressDepths();
trace("LevelEditor::deleteSelected(): selectedObjects.length = " + selectedObjects.length);
}
static function scrollOn(dir, alignment) {
if (alignment == "v") {
stageVelY = 10 * (-dir);
} else {
stageVelX = 10 * (-dir);
}
}
static function scrollOff() {
stageVelX = 0;
stageVelY = 0;
}
static function updateGameStage() {
gameStage_mc._x = gameStage_mc._x + stageVelX;
gameStage_mc._y = gameStage_mc._y - stageVelY;
if (stageVelX > 0) {
stageVelX = stageVelX + 0.2;
} else if (stageVelX < 0) {
stageVelX = stageVelX - 0.2;
}
if (gameStage_mc._x > gameStageStartingX) {
gameStage_mc._x = gameStageStartingX;
stageVelX = 0;
}
if (stageVelY > 0) {
stageVelY = stageVelY + 0.2;
} else if (stageVelY < 0) {
stageVelY = stageVelY - 0.2;
}
if (gameStage_mc._y < gameStageStartingY) {
gameStage_mc._y = gameStageStartingY;
stageVelY = 0;
}
}
static function stagePressed() {
if (!_mc.mask_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
return(undefined);
}
var _local3 = 0;
while (_local3 < lData.stageObjects.length) {
if (lData.stageObjects[_local3]._mc.hitTest(_root._xmouse, _root._ymouse, true)) {
gameStage_mc.createEmptyMovieClip("dragGuide", -1);
gameStage_mc.dragGuide._x = lData.stageObjects[_local3]._mc._x;
gameStage_mc.dragGuide._y = lData.stageObjects[_local3]._mc._y;
gameStage_mc.dragGuide.startDrag(false);
gameStage_mc.dragGuide.onEnterFrame = function () {
LevelEditor.followDragGuide();
};
var _local4 = -1;
var _local2 = 0;
while (_local2 < selectedObjects.length) {
if (selectedObjects[_local2] == lData.stageObjects[_local3]) {
_local4 = _local2;
}
_local2++;
}
if (_local4 > -1) {
if (Key.isDown(17)) {
removeSelected(_local4);
lastSelectedObjIndex = 0;
} else {
lastSelectedObjIndex = _local4;
}
return(undefined);
}
if (Key.isDown(17)) {
addSelected(lData.stageObjects[_local3]);
} else {
setSelected(lData.stageObjects[_local3]);
}
return(undefined);
}
_local3++;
}
setSelected(undefined);
}
static function stageReleased() {
delete gameStage_mc.dragGuide.onEnterFrame;
_root.stopDrag();
gameStage_mc.dragGuide.removeMovieClip();
}
static function followDragGuide() {
var _local3 = Math.round(gameStage_mc.dragGuide._x / gridSize) * gridSize;
var _local2 = Math.round(gameStage_mc.dragGuide._y / gridSize) * gridSize;
var _local1 = 0;
while (_local1 < selectedObjects.length) {
if (lastSelectedObjIndex != _local1) {
selectedObjects[_local1]._mc._x = _local3 + (selectedObjects[_local1]._mc._x - selectedObjects[lastSelectedObjIndex]._mc._x);
selectedObjects[_local1]._mc._y = _local2 + (selectedObjects[_local1]._mc._y - selectedObjects[lastSelectedObjIndex]._mc._y);
}
_local1++;
}
selectedObjects[lastSelectedObjIndex]._mc._x = _local3;
selectedObjects[lastSelectedObjIndex]._mc._y = _local2;
}
static function changeStagePal(num) {
var _local3 = 0;
while (_local3 < palDepthCount) {
_mc.stageObjPal_sp.content[_local3.toString()].removeMovieClip();
_local3++;
}
_mc.stageObjPal_sp.refreshPane();
palDepthCount = 0;
palHeightCount = 10;
var _local6 = true;
_local3 = 0;
while (_local6) {
var _local2 = _mc.stageObjPal_sp.content.attachMovie(typeArray[num] + _local3, _local3, palDepthCount++);
trace("changeStagePal(num): attempting to add stage pal item #" + _local3);
if (_local2._name == undefined) {
trace("changeStagePal(num): not available");
_local6 = false;
break;
}
if (_local2._height > 60) {
_local2._height = 60;
_local2._xscale = _local2._yscale;
}
var _local4 = _local2.getBounds(_mc.stageObjPal_sp.content);
_local2.animator_mc.stop();
trace("new_button exists with" + _local2._name);
_local2._y = palHeightCount;
_local2._x = 10;
_local2.stop();
if (((_local3 == 37) || (_local3 == 38)) && (typeArray[num] == "Enemy")) {
_local2.animator_mc.gotoAndStop(30);
if (_local3 == 37) {
_local2._y = _local2._y - 30;
}
}
if (_local4.yMin < 0) {
_local2._y = _local2._y + (-_local4.yMin);
}
if (_local4.xMin < 0) {
_local2._x = _local2._x + (-_local4.xMin);
}
_local2.mID = _local3;
_local2.mType = typeArray[num];
palHeightCount = palHeightCount + (_local2._height + palHeightSpacer);
_local2.onRelease = function () {
LevelEditor.addStageObject(this.mType, this.mID);
};
_local3++;
}
var _local7 = _mc.stageObjPal_sp.content.attachMovie("spacer", "spacer", palDepthCount++);
_local7._y = palHeightCount;
_local7._height = 50;
_mc.stageObjPal_sp.vPosition = 0;
}
static function initStagePal() {
palDepthCount = 0;
palHeightCount = 10;
palHeightSpacer = 4;
typeArray = new Array("Platform", "Ornament", "Obstacle", "XMovingPlatform", "YMovingPlatform", "Enemy", "Ladder", "Wall", "Hazard", "Trap", "Powerup", "Goal", "Switch", "SwitchedWall", "LavaFall", "MoveablePlatform", "WarpPad", "ShooterSpeedTrigger", "ShooterObstacle");
var _local1 = 0;
while (_local1 < typeArray.length) {
_mc.objectPalChooser.addItem(typeArray[_local1], _local1);
_local1++;
}
palChangeListener = new Object();
palChangeListener.change = function (eventObj) {
trace("palChange event: " + LevelEditor._mc.objectPalChooser.selectedIndex);
LevelEditor.changeStagePal(LevelEditor._mc.objectPalChooser.selectedIndex);
};
_mc.objectPalChooser.addEventListener("change", palChangeListener);
changeStagePal(0);
}
static function addStageObject(type, id) {
trace("LevelEditor::addStageObject lData.stageObjects.length bef = " + lData.stageObjects.length);
trace("LevelEditor::addStageObject clipname = " + lData.addStageObject(type, id)._mc._name);
trace("LevelEditor::addStageObject lData.stageObjects.length aft = " + lData.stageObjects.length);
}
static function clearAll() {
var _local1 = 0;
while (_local1 < lData.stageObjects.length) {
lData.stageObjects[_local1].kill();
_local1++;
}
lData.stageObjects = new Array();
}
static function shiftDepth(dir, allTheWay) {
var _local1 = selectedObjects[lastSelectedObjIndex];
if ((_local1 == null) || (_local1 == undefined)) {
return(undefined);
}
if ((_local1._mc.getDepth() == 0) && (dir < 0)) {
return(undefined);
}
if ((_local1._mc.getDepth() >= (lData.stageObjects.length - 1)) && (dir > 0)) {
return(undefined);
}
if (allTheWay) {
if (dir < 0) {
var _local2 = _local1._mc.getDepth();
while (_local2 > 0) {
_local1._mc.swapDepths(_local1._mc.getDepth() - 1);
_local2--;
}
} else {
var _local2 = _local1._mc.getDepth();
while (_local2 <= lData.stageObjects.length) {
_local1._mc.swapDepths(_local1._mc.getDepth() + 1);
_local2++;
}
}
} else {
_local1._mc.swapDepths(_local1._mc.getDepth() + dir);
}
}
static function shiftGroupDepthOneNotch(dir) {
var _local1 = 0;
while (_local1 < selectedObjects.length) {
selectedObjects[_local1]._mc.swapDepths(selectedObjects[_local1]._mc.getDepth() + dir);
_local1++;
}
}
static function updateButtonEnabled() {
_mc.bringUp_btn.enabled = selectedObjects.length == 1;
_mc.bringToTop_btn.enabled = selectedObjects.length == 1;
_mc.bringToBottom_btn.enabled = selectedObjects.length == 1;
_mc.bringDown_btn.enabled = selectedObjects.length == 1;
_mc.trash_btn.enabled = selectedObjects.length > 0;
if (selectedObjects.length == 1) {
PropertyInspector.activate(selectedObjects[0]);
} else {
PropertyInspector.disable();
}
}
static function openXMLwindow() {
_mc.levelXML_mc._visible = true;
_mc.levelXML_mc._txt.text = lData.getXML();
}
static function closeXMLwindow() {
_mc.levelXML_mc._visible = false;
_mc.levelXML_mc._txt.text = "";
}
static function createOpenWindow() {
_mc.loadLevel_mc._visible = true;
_mc.loadLevel_mc.fileName.text = LocalData.load("stinkomanLevel", "filename");
}
static function loadLevel() {
LocalData.save("stinkomanLevel", "filename", _mc.loadLevel_mc.fileName.text);
lData.loadFromFile(_mc.loadLevel_mc.fileName.text);
_mc.sky_mc.gotoAndStop(_mc.levelProperties_mc.backgroundA.value);
closeLoadLevelWindow();
}
static function closeLoadLevelWindow() {
_mc.loadLevel_mc._visible = false;
}
static function isActive() {
if ((editorActive == false) || (editorActive == undefined)) {
return(false);
}
return(true);
}
static function keyPressed() {
var _local1 = Key.getCode();
if (((_mc.levelXML_mc._visible || (_mc.loadLevel_mc._visible)) || (_mc.levelProperties_mc._visible)) || (_mc.confirmBufferWrite_mc._visible)) {
return(undefined);
}
switch (_local1) {
case 37 :
nudge(-1, 0);
break;
case 39 :
nudge(1, 0);
break;
case 38 :
nudge(0, -1);
break;
case 40 :
nudge(0, 1);
break;
case 27 :
setSelected(undefined);
break;
case 8 :
deleteSelected();
break;
case 46 :
deleteSelected();
break;
case 65 :
selectAll();
break;
case 90 :
if (!Key.isDown(17)) {
if (zoomLevel == 0) {
zoomOut();
} else {
unzoom();
}
}
break;
case 85 :
unzoom();
break;
}
}
static function selectAll() {
setSelected(undefined);
for (var _local1 in lData.stageObjects) {
addSelected(lData.stageObjects[_local1]);
}
}
static function nudge(x, y) {
var _local5 = Key.isDown(16);
var _local2 = 1;
if (_local5) {
_local2 = 5;
}
var _local1 = 0;
while (_local1 < selectedObjects.length) {
selectedObjects[_local1]._mc._x = selectedObjects[_local1]._mc._x + ((x * gridSize) * _local2);
selectedObjects[_local1]._mc._y = selectedObjects[_local1]._mc._y + ((y * gridSize) * _local2);
_local1++;
}
}
static function applyProperties() {
_mc.levelProperties_mc.scrollX.selected = lData.levelProperties.ScrollLockX == "true";
_mc.levelProperties_mc.scrollY.selected = lData.levelProperties.ScrollLockY == "true";
_mc.levelProperties_mc.backgroundA.value = lData.levelProperties.bkgrdA;
_mc.gameStage_mc.playerloc_mc._x = lData.levelProperties.playerStartX;
_mc.gameStage_mc.playerloc_mc._y = lData.levelProperties.playerStartY;
}
static function zoomOut() {
if (zoomLevel != 0) {
return(undefined);
}
viewProps.x = _mc.gameStage_mc._x;
viewProps.y = _mc.gameStage_mc._y;
var _local1 = 0;
_mc.gameStage_mc._width = _mc.mask_mc._width;
trace((("LevelEditor::zoomOut " + _mc.mask_mc._width) + ",") + _mc.gameStage_mc._xscale);
_local1 = _mc.gameStage_mc._xscale;
_mc.gameStage_mc._yscale = (_mc.gameStage_mc._xscale = 100);
_mc.gameStage_mc._height = _mc.mask_mc._height;
if (_mc.gameStage_mc._xscale < _local1) {
_local1 = _mc.gameStage_mc._xscale;
}
_mc.gameStage_mc._yscale = (_mc.gameStage_mc._xscale = _local1);
zoomLevel = 1;
centerGameStage();
}
static function unzoom() {
if (zoomLevel == 0) {
return(undefined);
}
zoomLevel = 0;
_mc.gameStage_mc._yscale = (_mc.gameStage_mc._xscale = 100);
_mc.gameStage_mc._x = viewProps.x;
_mc.gameStage_mc._y = viewProps.y;
}
static function saveBufferChosen() {
_mc.confirmBufferWrite_mc._visible = true;
_mc.confirmBufferWrite_mc.num_txt.text = lData.stageObjects.length;
if (lData.stageObjects.length < 10) {
_mc.confirmBufferWrite_mc.num_txt.text = _mc.confirmBufferWrite_mc.num_txt.text + "!!!!";
_mc.confirmBufferWrite_mc.num_txt.textColor = 16711680 /* 0xFF0000 */;
} else {
_mc.confirmBufferWrite_mc.num_txt.textColor = 6710886 /* 0x666666 */;
}
}
static function saveBufferConfirmed() {
LocalData.save("stinkomanLevel", "lDataXML", lData.getXML(), "/");
_mc.confirmBufferWrite_mc._visible = false;
}
static function saveBufferCancelled() {
_mc.confirmBufferWrite_mc._visible = false;
}
static var editorActive = false;
}
Symbol 1126 MovieClip [__Packages.LevelData] Frame 0
class LevelData
{
var stageObjects, stageObjSource, editorMode, _mc, gameStage_mc, levelXML, levelProperties;
function LevelData (p_mc, pgameStage_mc, pEditorMode) {
var _local2 = this;
stageObjects = new Array();
stageObjSource = new Array();
editorMode = pEditorMode;
_mc = p_mc;
gameStage_mc = pgameStage_mc;
gameStage_mc = _mc.gameStage_mc;
}
function reset() {
var _local2 = 0;
while (_local2 < stageObjSource.length) {
delete stageObjSource[_local2];
_local2++;
}
stageObjSource = new Array();
_local2 = 0;
while (_local2 < stageObjects.length) {
delete stageObjects[_local2];
_local2++;
}
stageObjects = new Array();
setXML(levelXML);
}
function addObject(newObject) {
stageObjects.push(newObject);
}
function removeObject(deadObject) {
var _local2 = 0;
while (_local2 < stageObjects.length) {
if (stageObjects[_local2]._mc.getDepth() == deadObject._mc.getDepth()) {
stageObjects[_local2].kill();
stageObjects.splice(_local2, 1);
trace("LevelData::removeObject(): after stageObjects.length = " + stageObjects.length);
return(undefined);
}
_local2++;
}
}
function getXML() {
levelXML = new XML();
compressDepths();
var _local2 = 0;
while (_local2 < stageObjects.length) {
var _local3 = new Object();
_local3.sT = stageObjects[_local2].subType;
_local3.cT = stageObjects[_local2].classType;
_local3.d = stageObjects[_local2]._mc.getDepth();
_local3.x = stageObjects[_local2]._mc._x;
_local3.y = stageObjects[_local2]._mc._y;
if (stageObjects[_local2].getAdditonalAttributes() != null) {
_local3.addProps = stageObjects[_local2].getAdditonalAttributes();
}
levelXML.appendChild(XMLUtil.createNodeFromObjects(levelXML, "SO", _local3));
levelXML.appendChild(levelXML.createTextNode(newline));
_local2++;
}
levelProperties = new Object();
levelProperties.ScrollLockX = _mc.levelProperties_mc.scrollX.selected;
levelProperties.ScrollLockY = _mc.levelProperties_mc.scrollY.selected;
levelProperties.playerStartX = _mc.gameStage_mc.playerloc_mc._x;
levelProperties.playerStartY = _mc.gameStage_mc.playerloc_mc._y;
levelProperties.bkgrdA = _mc.levelProperties_mc.backgroundA.value;
levelXML.appendChild(XMLUtil.createNodeFromObjects(levelXML, "levelProperties", levelProperties));
levelXML.ignoreWhite = true;
return(levelXML);
}
function clearStageObjects() {
var _local2 = 0;
while (_local2 < stageObjects.length) {
stageObjects[_local2].kill();
_local2++;
}
stageObjects = new Array();
}
function compressDepths() {
var _local2 = 0;
while (_local2 < stageObjects.length) {
stageObjects[_local2].updateDepthParam();
_local2++;
}
stageObjects.sortOn("depth", Array.NUMERIC);
_local2 = 0;
while (_local2 < stageObjects.length) {
_local2++;
}
_local2 = 0;
while (_local2 < stageObjects.length) {
if (stageObjects[_local2]._mc.getDepth() > _local2) {
stageObjects[_local2]._mc.swapDepths(_local2);
}
_local2++;
}
_local2 = 0;
while (_local2 < stageObjects.length) {
if (stageObjects[_local2]._mc.getDepth() == undefined) {
trace((((((("There is an erroneous object: " + _local2) + ", classType") + stageObjects[_local2].classType) + ",") + stageObjects[_local2].subType) + ",_mc: = ") + _mc._name);
stageObjects[_local2].kill();
stageObjects.splice(_local2, 1);
_local2--;
}
_local2++;
}
return(stageObjects.length);
}
function setXML(newData) {
levelXML = new XML(newData.toString());
levelXML.ignoreWhite = true;
if (editorMode) {
redrawStageFromXML();
}
}
function redrawStageFromXML() {
clearStageObjects();
var _local3 = 0;
while (_local3 < levelXML.childNodes.length) {
var _local5 = new Object();
var _local6 = new Object();
if (levelXML.childNodes[_local3].nodeName != "SO") {
} else {
var _local2 = 0;
while (_local2 < levelXML.childNodes[_local3].childNodes.length) {
if (levelXML.childNodes[_local3].childNodes[_local2].nodeName == "addProps") {
var _local4 = 0;
while (_local4 < levelXML.childNodes[_local3].childNodes[_local2].childNodes.length) {
_local6[levelXML.childNodes[_local3].childNodes[_local2].childNodes[_local4].nodeName] = levelXML.childNodes[_local3].childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
} else {
_local5[levelXML.childNodes[_local3].childNodes[_local2].nodeName] = levelXML.childNodes[_local3].childNodes[_local2].firstChild.nodeValue;
}
_local2++;
}
stageObjSource.push(new StageObjectData(_local5.cT, Number(_local5.sT), Number(_local5.x), Number(_local5.y), _local5.d, _local6));
if (editorMode) {
addStageObject(_local5.cT, Number(_local5.sT), Number(_local5.x), Number(_local5.y), Number(_local5.d), _local6);
}
}
_local3++;
}
levelProperties = XMLUtil.createObjectFromNode(XMLUtil.getNamedNode(levelXML, "levelProperties", 0));
if (editorMode) {
LevelEditor.applyProperties();
}
}
function addStageObject(type, subtype, x, y, depth, initObj) {
if (x == undefined) {
x = (Math.floor((-gameStage_mc._x) / LevelEditor.gridSize) * LevelEditor.gridSize) + (40 * LevelEditor.gridSize);
}
if (y == undefined) {
y = (Math.floor((-gameStage_mc._y) / LevelEditor.gridSize) * LevelEditor.gridSize) + (16 * LevelEditor.gridSize);
}
var _local3;
if (depth == undefined) {
depth = stageObjects.length;
}
switch (type) {
case "Platform" :
_local3 = new Platform(gameStage_mc, x, y, subtype, depth);
break;
case "Ornament" :
_local3 = new Ornament(gameStage_mc, x, y, subtype, depth);
break;
case "XMovingPlatform" :
_local3 = new XMovingPlatform(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "YMovingPlatform" :
_local3 = new YMovingPlatform(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Enemy" :
trace("it's an enemy -> tell me what the subtype is: " + subtype);
if (subtype == 0) {
_local3 = new EnemyMiniToothbot(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 1) {
_local3 = new EnemyToothbot(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 2) {
_local3 = new EnemyChick(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 3) {
_local3 = new EnemyBouncebot(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 4) {
_local3 = new EnemyCabbage(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 5) {
_local3 = new EnemyBouncechick(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 6) {
_local3 = new EnemyChickJogger(gameStage_mc, x, y, subtype, depth, initObj);
} else if ((subtype == 7) || (subtype == 22)) {
_local3 = new EnemyFlyingToothbot(gameStage_mc, x, y, subtype, depth, initObj);
} else if ((subtype == 8) || (subtype == 16)) {
_local3 = new EnemyVacgun(gameStage_mc, x, y, subtype, depth, initObj);
} else if ((((subtype == 9) || (subtype == 19)) || (subtype == 20)) || (subtype == 27)) {
_local3 = new EnemyTriggerable(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 10) {
_local3 = new EnemyGokul(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 11) {
_local3 = new EnemyFlyingToothbot(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 12) {
_local3 = new EnemyPoorbt(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 13) {
_local3 = new EnemyGaspeau(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 14) {
_local3 = new EnemyChamCham(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 15) {
_local3 = new EnemyAstromund(gameStage_mc, x, y, subtype, depth, initObj);
} else if ((((subtype == 17) || (subtype == 18)) || (subtype == 40)) || (subtype == 41)) {
_local3 = new EnemyDometant(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 21) {
_local3 = new EnemyPlugman(gameStage_mc, x, y, subtype, depth, initObj);
} else if ((subtype == 23) || (subtype == 28)) {
_local3 = new EnemyStothos(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 24) {
_local3 = new EnemyFullbide(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 25) {
_local3 = new EnemyMybenj(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 26) {
_local3 = new EnemyBiztar(gameStage_mc, x, y, subtype, depth, initObj);
} else if (((subtype == 29) || (subtype == 31)) || (subtype == 32)) {
_local3 = new EnemyShooter(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 30) {
_local3 = new EnemyShark(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 33) {
_local3 = new EnemyJellyfish(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 34) {
_local3 = new EnemyClam(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 35) {
_local3 = new EnemyManta(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 36) {
_local3 = new EnemyVolcano(gameStage_mc, x, y, subtype, depth, initObj);
} else if ((subtype == 37) || (subtype == 38)) {
_local3 = new EnemyThorn(gameStage_mc, x, y, subtype, depth, initObj);
} else if (subtype == 39) {
_local3 = new EnemyCoral(gameStage_mc, x, y, subtype, depth, initObj);
}
break;
case "Ladder" :
_local3 = new Ladder(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Obstacle" :
_local3 = new Obstacle(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Wall" :
_local3 = new Wall(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Hazard" :
_local3 = new Hazard(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Trap" :
_local3 = new Trap(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Goal" :
_local3 = new Goal(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Powerup" :
_local3 = new Powerup(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "SwitchedWall" :
_local3 = new SwitchedWall(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "Switch" :
_local3 = new Switch(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "LavaFall" :
_local3 = new LavaFall(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "MoveablePlatform" :
_local3 = new MoveablePlatform(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "WarpPad" :
_local3 = new WarpPad(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "ShooterSpeedTrigger" :
_local3 = new ShooterSpeedTrigger(gameStage_mc, x, y, subtype, depth, initObj);
break;
case "ShooterObstacle" :
_local3 = new ShooterObstacle(gameStage_mc, x, y, subtype, depth, initObj);
break;
}
addObject(_local3);
return(_local3);
}
function loadFromFile(XMLfilename) {
var thisLD = this;
levelXML = new XML();
levelXML.ignoreWhite = true;
levelXML.load(XMLfilename);
levelXML.onLoad = function () {
if (thisLD.editorMode) {
thisLD.redrawStageFromXML();
} else {
thisLD._mc.levelStart_mc.gotoAndPlay("levelLoaded");
}
};
}
}
Symbol 1127 MovieClip [__Packages.XMLUtil] Frame 0
class XMLUtil
{
function XMLUtil () {
}
static function getNamedNode(parentNode, desiredName, desiredNum) {
var _local3 = 0;
if (desiredNum == undefined) {
desiredNum = 1;
}
var _local1 = 0;
while (_local1 < parentNode.childNodes.length) {
if (parentNode.childNodes[_local1].nodeName == desiredName) {
if (_local3 < (desiredNum - 1)) {
_local3++;
} else {
return(parentNode.childNodes[_local1]);
}
}
_local1++;
}
return(new XMLNode());
}
static function createNodeFromObjects(parentXML, nodeName, objToCopy) {
var _local4 = parentXML.createElement(nodeName);
for (var _local5 in objToCopy) {
var _local1 = parentXML.createElement(_local5);
if (typeof(objToCopy[_local5]) == "object") {
_local1 = createNodeFromObjects(parentXML, _local5, objToCopy[_local5]);
} else {
_local1.appendChild(parentXML.createTextNode(objToCopy[_local5]));
}
_local4.appendChild(_local1);
}
return(_local4);
}
static function createObjectFromNode(node) {
var _local3 = new Object();
var _local1 = 0;
while (_local1 < node.childNodes.length) {
_local3[node.childNodes[_local1].nodeName] = node.childNodes[_local1].firstChild.nodeValue;
_local1++;
}
return(_local3);
}
}
Symbol 1128 MovieClip [__Packages.StageObjectData] Frame 0
class StageObjectData
{
var classType, subType, x, y, depth, propObj, _active, assignedObject, canSpawn;
function StageObjectData (pclassType, psubType, px, py, pdepth, ppropObj) {
classType = pclassType;
subType = psubType;
x = px;
y = py;
depth = pdepth;
propObj = new Object();
for (var _local3 in ppropObj) {
propObj[_local3] = ppropObj[_local3];
}
_active = false;
assignedObject = undefined;
canSpawn = true;
}
function get active() {
return(_active);
}
function set active(val) {
_active = val;
canSpawn = false;
//return(active);
}
}
Symbol 1129 MovieClip [__Packages.Platform] Frame 0
class Platform extends StageObject
{
static var PlatformArray;
var classType, standable, disappearing, _mc, subType;
function Platform (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Platform" + typeNum, depth);
if (PlatformArray == undefined) {
PlatformArray = new Array();
}
classType = "Platform";
standable = true;
disappearing = false;
var _local4 = this;
PlatformArray.push(this);
_mc.animator_mc.stop();
_mc.mType = "vert";
_mc.subtype = subType;
_mc.mPlatform = this;
if (!LevelEditor.isActive()) {
_mc.editorGuide_mc._visible = false;
}
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < PlatformArray.length) {
if (this == PlatformArray[_local2]) {
PlatformArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < PlatformArray.length) {
if (!PlatformArray[_local1].standable) {
} else {
if (PlatformArray[_local1].subType == 41) {
if (test_mc.hitTest(PlatformArray[_local1]._mc.hitTest_mc)) {
if (!PlatformArray[_local1].disappearing) {
PlatformArray[_local1].disappearing = true;
PlatformArray[_local1]._mc.gotoAndPlay("disappear");
}
return(PlatformArray[_local1]._mc);
}
}
if (PlatformArray[_local1]._mc.hitTest_mc._name != undefined) {
if (test_mc.hitTest(PlatformArray[_local1]._mc.hitTest_mc)) {
return(PlatformArray[_local1]._mc);
}
} else if (test_mc.hitTest(PlatformArray[_local1]._mc)) {
return(PlatformArray[_local1]._mc);
}
}
_local1++;
}
_local1 = 0;
while (_local1 < Obstacle.ObstacleArray.length) {
if (test_mc.hitTest(Obstacle.ObstacleArray[_local1]._mc.hitTest_mc)) {
return(Obstacle.ObstacleArray[_local1]._mc);
}
_local1++;
}
_local1 = 0;
while (_local1 < EnemyBiztar.biztarArray.length) {
if (test_mc.hitTest(EnemyBiztar.biztarArray[_local1]._mc.hitTest_mc)) {
return(EnemyBiztar.biztarArray[_local1]._mc.hitTest_mc);
}
_local1++;
}
return(undefined);
}
function doneDisappearing() {
disappearing = false;
}
static function unpause() {
var _local1 = 0;
while (_local1 < PlatformArray.length) {
PlatformArray[_local1]._mc.animator_mc.play();
_local1++;
}
}
}
Symbol 1130 MovieClip [__Packages.Obstacle] Frame 0
class Obstacle extends StageObject
{
static var ObstacleArray;
var classType, _mc;
function Obstacle (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Obstacle" + typeNum, depth);
if (ObstacleArray == undefined) {
ObstacleArray = new Array();
}
classType = "Obstacle";
var _local4 = this;
trace((("Obstacle(): " + _mc._name) + ", Obstacle parent = ") + _mc._parent);
ObstacleArray.push(this);
_mc.animator_mc.stop();
_mc.mType = "vert";
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < ObstacleArray.length) {
if (this == ObstacleArray[_local2]) {
ObstacleArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < ObstacleArray.length) {
if (test_mc.hitTest(ObstacleArray[_local1]._mc)) {
return(ObstacleArray[_local1]._mc);
}
_local1++;
}
return(undefined);
}
static function unpause() {
var _local1 = 0;
while (_local1 < ObstacleArray.length) {
ObstacleArray[_local1]._mc.animator_mc.play();
_local1++;
}
}
}
Symbol 1131 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends StageObject
{
static var EnemyArray;
var dead, classType, _mc, maxVelX, maxVelY, velX, velY, vulnerable, hurtFlashCounter, hurtFlashColor, hurtFlashTrans, deadAnimateCounter, dontRespawn, subType, facingDir;
function Enemy (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Enemy" + typeNum, depth);
if (EnemyArray == undefined) {
EnemyArray = new Array();
}
dead = false;
classType = "Enemy";
var thisEnemy = this;
trace((("Enemy(): " + _mc._name) + ", Enemy parent = ") + _mc._parent);
EnemyArray.push(this);
maxVelX = (maxVelY = 2);
velX = 2;
velY = 2;
if (!LevelEditor.editorActive) {
_mc.onEnterFrame = function () {
thisEnemy.update();
};
}
vulnerable = true;
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < EnemyArray.length) {
if (this == EnemyArray[_local2]) {
EnemyArray.splice(_local2, 1);
break;
}
_local2++;
}
}
function update() {
}
function updateHurtFlasher() {
hurtFlashCounter--;
if (hurtFlashCounter == 0) {
trace("hurtFlashColor.getTransform().ra = " + hurtFlashColor.getTransform().ra);
if (hurtFlashColor.getTransform().ra == 100) {
hurtFlashColor.setTransform(hurtFlashTrans);
} else {
hurtFlashColor.setTransform({ra:100, ga:100, ba:100, rb:0});
}
hurtFlashCounter = 3;
}
}
function clearHurtFlasher() {
hurtFlashColor.setTransform({ra:100, rb:0, ga:100, ba:100});
hurtFlashCounter = 3;
}
function initHurtFlasher(clip_mc) {
if (clip_mc == undefined) {
clip_mc = _mc;
}
hurtFlashTrans = new Object();
hurtFlashColor = new Color(clip_mc);
hurtFlashTrans.ra = 39;
hurtFlashTrans.ga = 39;
hurtFlashTrans.ba = 39;
hurtFlashTrans.rb = 156;
hurtFlashCounter = 3;
}
function updateDead() {
_mc._x = _mc._x + velX;
_mc._y = _mc._y + velY;
deadAnimateCounter--;
if ((_mc._y < -200) || (deadAnimateCounter < 0)) {
remove();
}
}
function die(x, y) {
var thisEnemy = this;
dontRespawn = true;
_mc.onEnterFrame = function () {
thisEnemy.updateDead();
};
_mc.gotoAndPlay("dieRight");
dead = true;
velX = 20 * x;
velY = 20 * y;
deadAnimateCounter = 200;
}
function takeDamage(x, y) {
die(x, y);
}
function remove() {
trace((("Enemy::remove() called for type " + subType) + ",") + _mc._name);
var _local3;
delete _mc.onEnterFrame;
_mc.removeMovieClip();
var _local2 = 0;
while (_local2 < EnemyArray.length) {
if (EnemyArray[_local2]._mc._name == undefined) {
_local3 = _local2;
}
_local2++;
}
EnemyArray.splice(_local3, 1);
}
function collideTest(test_mc) {
return(_mc.hitTest(test_mc));
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest(test_mc));
}
static function anyHurtByPlayerTest(test_mc) {
var _local2 = new Array();
var _local1 = 0;
while (_local1 < EnemyArray.length) {
if ((!EnemyArray[_local1].dead) && (EnemyArray[_local1].hurtByPlayerTest(test_mc))) {
_local2.push(EnemyArray[_local1]);
}
_local1++;
}
return(_local2);
}
function playerDangerTest(test_mc) {
return(_mc.hitTest(test_mc));
}
static function anyPlayerDangerTest(test_mc) {
var _local1 = 0;
while (_local1 < EnemyArray.length) {
if ((!EnemyArray[_local1].dead) && (EnemyArray[_local1].playerDangerTest(test_mc))) {
return(EnemyArray[_local1]);
}
_local1++;
}
return(undefined);
}
function reverse() {
velX = -velX;
if (velX >= 0) {
_mc.gotoAndStop("right");
facingDir = "right";
} else {
_mc.gotoAndStop("left");
facingDir = "left";
}
}
function reverseFacingDir() {
if (facingDir == "right") {
facingDir = "left";
} else {
facingDir = "right";
}
}
function applyFacingDir() {
if (facingDir == "right") {
_mc.gotoAndStop("right");
} else {
_mc.gotoAndStop("left");
}
}
function applyInitObjProperties(initObj) {
for (var _local3 in initObj) {
if (isNaN(initObj[_local3])) {
this[_local3] = initObj[_local3];
} else {
this[_local3] = Number(initObj[_local3]);
}
}
}
static var FLASH_COUNTER_LENGTH = 3;
}
Symbol 1132 MovieClip [__Packages.EnemyBiztar] Frame 0
class EnemyBiztar extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, hitPoints, invincibleCounter, die;
function EnemyBiztar (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyBiztar(): " + _mc._name) + ", EnemyBiztar parent = ") + _mc._parent);
_mc.animator_mc.stop();
maxVelY = 0;
maxVelX = -2;
velX = -2;
velY = 0;
hitPoints = 6;
invincibleCounter--;
biztarArray.push(this);
}
function takeDamage(x, y) {
if ((invincibleCounter <= 0) && (hitPoints > 0)) {
hitPoints--;
_mc.nextFrame();
invincibleCounter = 6;
}
if (hitPoints == 0) {
die(x, y);
removeFromBiztarArray();
}
}
function updateDead() {
delete _mc.onEnterFrame;
}
function update() {
if (invincibleCounter > 0) {
invincibleCounter--;
}
}
function playerDangerTest(test_mc) {
return(false);
}
function removeFromBiztarArray() {
var _local3;
var _local2 = 0;
while (_local2 < biztarArray.length) {
if (biztarArray[_local2]._mc._name == _mc._name) {
_local3 = _local2;
break;
}
_local2++;
}
biztarArray.splice(_local3, 1);
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < biztarArray.length) {
if (test_mc.hitTest(biztarArray[_local1]._mc)) {
return(biztarArray[_local1]._mc);
}
_local1++;
}
return(undefined);
}
static function clearAll() {
var _local1 = 0;
while (_local1 < biztarArray.length) {
delete biztarArray[_local1];
_local1++;
}
biztarArray = new Array();
}
static var biztarArray = new Array();
}
Symbol 1133 MovieClip [__Packages.Ornament] Frame 0
class Ornament extends StageObject
{
var classType, _mc;
function Ornament (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Ornament" + typeNum, depth);
classType = "Ornament";
var _local4 = this;
trace((("Ornament(): " + _mc._name) + ", Ornament parent = ") + _mc._parent);
if (!LevelEditor.isActive()) {
_mc.editorGuide_mc._visible = false;
}
}
function clearFromObjectsArray() {
}
}
Symbol 1134 MovieClip [__Packages.XMovingPlatform] Frame 0
class XMovingPlatform extends StageObject
{
static var XMovingPlatformArray;
var classType, lRange, rRange, maxVel, vel, _mc;
function XMovingPlatform (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "XMovingPlatform" + typeNum, depth);
if (XMovingPlatformArray == undefined) {
XMovingPlatformArray = new Array();
}
classType = "XMovingPlatform";
var thisXMovingPlatform = this;
XMovingPlatformArray.push(this);
lRange = x;
rRange = 100;
maxVel = 3;
vel = 2;
for (var _local4 in initObj) {
this[_local4] = Number(initObj[_local4]);
}
trace((("Retrieving initObj" + initObj) + initObj.rRange) + rRange);
_mc.rangeGuide_mc._x = rRange;
if (LevelEditor.isActive()) {
} else {
_mc.rangeGuide_mc._visible = false;
_mc.onEnterFrame = function () {
thisXMovingPlatform.update();
};
}
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < XMovingPlatformArray.length) {
if (this == XMovingPlatformArray[_local2]) {
XMovingPlatformArray.splice(_local2, 1);
break;
}
_local2++;
}
}
function update() {
if ((vel > 0) && (_mc._x >= (lRange + rRange))) {
vel = -vel;
}
if ((vel < 0) && (_mc._x <= lRange)) {
vel = -vel;
}
if (_mc._x < (lRange + 30)) {
vel = vel + 0.4;
}
if (_mc._x > ((lRange + rRange) - 30)) {
vel = vel - 0.4;
}
if (vel >= maxVel) {
vel = maxVel;
}
if (vel <= (-maxVel)) {
vel = -maxVel;
}
_mc._x = _mc._x + vel;
}
function moveRangeGuideTo(newVal) {
if (newVal < _mc.x) {
newVal = _mc.x;
}
rRange = newVal;
_mc.rangeGuide_mc._x = rRange;
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.rRange = rRange;
_local2.maxVel = maxVel;
return(_local2);
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < XMovingPlatformArray.length) {
if (test_mc.hitTest(XMovingPlatformArray[_local1]._mc.hitArea_mc)) {
return(XMovingPlatformArray[_local1]);
}
_local1++;
}
return(undefined);
}
}
Symbol 1135 MovieClip [__Packages.YMovingPlatform] Frame 0
class YMovingPlatform extends StageObject
{
static var YMovingPlatformArray;
var classType, _mc, bRange, tRange, maxVel, vel;
function YMovingPlatform (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "YMovingPlatform" + typeNum, depth);
if (YMovingPlatformArray == undefined) {
YMovingPlatformArray = new Array();
}
classType = "YMovingPlatform";
var thisYMovingPlatform = this;
trace((((("YMovingPlatform(): " + _mc._name) + ", YMovingPlatform parent = ") + _mc._parent) + ",") + y);
YMovingPlatformArray.push(this);
bRange = y;
tRange = -100;
maxVel = 3;
vel = 2;
for (var _local4 in initObj) {
this[_local4] = Number(initObj[_local4]);
}
maxVel = 3;
trace((("Retrieving initObj" + initObj) + initObj.tRange) + tRange);
_mc.rangeGuide_mc._y = tRange;
if (LevelEditor.isActive()) {
} else {
_mc.rangeGuide_mc._visible = false;
_mc.onEnterFrame = function () {
thisYMovingPlatform.update();
};
}
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < YMovingPlatformArray.length) {
if (this == YMovingPlatformArray[_local2]) {
YMovingPlatformArray.splice(_local2, 1);
break;
}
_local2++;
}
}
function update() {
var _local3 = bRange + tRange;
var _local2 = bRange;
if ((vel < 0) && (_mc._y <= _local3)) {
vel = -vel;
}
if ((vel > 0) && (_mc._y >= _local2)) {
vel = -vel;
}
if (vel > maxVel) {
vel = maxVel;
}
if (vel < (-maxVel)) {
vel = -maxVel;
}
_mc._y = _mc._y + vel;
}
function moveYRangeGuideTo(newVal) {
trace("moveRangeGuideTo()" + newVal);
tRange = newVal;
_mc.rangeGuide_mc._y = tRange;
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.tRange = tRange;
_local2.maxVel = maxVel;
return(_local2);
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < YMovingPlatformArray.length) {
if (test_mc.hitTest(YMovingPlatformArray[_local1]._mc.hitArea_mc)) {
return(YMovingPlatformArray[_local1]);
}
_local1++;
}
return(undefined);
}
}
Symbol 1136 MovieClip [__Packages.EnemyMiniToothbot] Frame 0
class EnemyMiniToothbot extends Enemy
{
var classType, facingDir, _mc, maxVelY, maxVelX, velX, velY, crouching, vulnerable, reverse;
function EnemyMiniToothbot (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
facingDir = "left";
var _local3 = this;
trace((("EnemyMiniToothbot(): " + _mc._name) + ", EnemyMiniToothbot parent = ") + _mc._parent);
_mc.animator_mc.stop();
maxVelY = 0;
maxVelX = -1.5;
velX = -1.5;
velY = 0;
}
function update() {
if ((((_mc._x > StinkoGame.getPlayerGlobal().x) && (StinkoGame.player1.facingDir == "right")) || ((_mc._x < StinkoGame.getPlayerGlobal().x) && (StinkoGame.player1.facingDir == "left"))) && (Math.abs(_mc._y - StinkoGame.getPlayerGlobal().y) < 30)) {
velX = 0;
_mc.gotoAndStop("crouch" + facingDir);
crouching = true;
vulnerable = false;
return(undefined);
}
crouching = false;
vulnerable = true;
if (facingDir == "right") {
velX = 1.5;
} else {
velX = -1.5;
}
_mc.gotoAndStop(facingDir);
if (velX == 0) {
_mc.animator_mc.stop();
} else {
_mc.animator_mc.play();
}
_mc._x = _mc._x + velX;
if (Platform.hit(_mc.hitTest_mc) == undefined) {
reverse();
}
if (Obstacle.hit(_mc) != undefined) {
var _local2 = 0;
while (_local2 < 5) {
_mc._x = _mc._x - velX;
if (Obstacle.hit(_mc) == undefined) {
_local2 = 6;
}
_local2++;
}
reverse();
}
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest(test_mc));
}
}
Symbol 1137 MovieClip [__Packages.EnemyToothbot] Frame 0
class EnemyToothbot extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, reverse;
function EnemyToothbot (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyToothbot(): " + _mc._name) + ", EnemyToothbot parent = ") + _mc._parent);
_mc.animator_mc.stop();
maxVelY = 0;
maxVelX = -1.5;
velX = -1.5;
velY = 0;
}
function updateDead() {
delete _mc.onEnterFrame;
}
function update() {
if (velX == 0) {
_mc.animator_mc.stop();
} else {
_mc.animator_mc.play();
}
_mc._x = _mc._x + velX;
if (Platform.hit(_mc.hitTest_mc) == undefined) {
reverse();
}
if (Obstacle.hit(_mc) != undefined) {
var _local2 = 0;
while (_local2 < 5) {
_mc._x = _mc._x - velX;
if (Obstacle.hit(_mc) == undefined) {
_local2 = 6;
}
_local2++;
}
reverse();
}
}
}
Symbol 1138 MovieClip [__Packages.EnemyChick] Frame 0
class EnemyChick extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, hitPoints, invincibleCounter, initHurtFlasher, facingDir, applyInitObjProperties, applyFacingDir, dead, dontRespawn, updateHurtFlasher, clearHurtFlasher;
function EnemyChick (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyChick(): " + _mc._name) + ", EnemyChick parent = ") + _mc._parent);
maxVelY = 0;
maxVelX = -1.5;
velX = -1.5;
velY = 0;
hitPoints = 4;
invincibleCounter = 0;
initHurtFlasher(_mc.chickun_mc.animator_mc);
facingDir = "left";
applyInitObjProperties(initObj);
applyFacingDir();
}
function takeDamage(x, y) {
if (invincibleCounter == 0) {
hitPoints--;
invincibleCounter = 24;
}
if (hitPoints == 0) {
die(x, y);
}
}
function die(x, y) {
var _local2 = this;
delete _mc.onEnterFrame;
_mc.chickun_mc.gotoAndPlay("die");
dead = true;
dontRespawn = true;
velX = 0;
velY = 0;
}
function update() {
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function collideTest(test_mc) {
if (_mc.chickun_mc.animator_mc.chickbone_mc.hitTest(test_mc) || (_mc.chickun_mc.hurtTest_mc.hitTest(test_mc))) {
return(true);
}
return(false);
}
function hurtByPlayerTest(test_mc) {
return(_mc.chickun_mc.hurtByPlayer_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.chickun_mc.hurtTest_mc.hitTest(test_mc) || (_mc.chickun_mc.boneAttack_mc.hitTest(test_mc)));
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.facingDir = facingDir;
return(_local2);
}
}
Symbol 1139 MovieClip [__Packages.EnemyBouncebot] Frame 0
class EnemyBouncebot extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, jumpingDir, reverse;
function EnemyBouncebot (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyBouncebot(): " + _mc._name) + ", EnemyBouncebot parent = ") + _mc._parent);
maxVelY = 0;
maxVelX = -1.5;
velX = 0;
velY = 0;
jumpingDir = -1;
if (LevelEditor.editorActive) {
_mc.stop();
}
_mc.myEnemyBouncebot = this;
}
function update() {
_mc._x = _mc._x + velX;
if (Math.random() > 0.7) {
jumpingDir = -jumpingDir;
}
_mc._x = _mc._x + (30 * jumpingDir);
if (Platform.hit(_mc.hitTest_mc) == undefined) {
_mc._x = _mc._x - (30 * jumpingDir);
jumpingDir = -jumpingDir;
} else {
_mc._x = _mc._x - (30 * jumpingDir);
}
if (Obstacle.hit(_mc) != undefined) {
reverse();
}
}
function startJump() {
velX = 2 * jumpingDir;
}
function stopJump() {
velX = 0;
}
}
Symbol 1140 MovieClip [__Packages.EnemyCabbage] Frame 0
class EnemyCabbage extends Enemy
{
var classType, _mc, vulnerable;
function EnemyCabbage (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyCabbage(): " + _mc._name) + ", EnemyCabbage parent = ") + _mc._parent);
if (LevelEditor.editorActive) {
_mc.stop();
}
_mc.myEnemyCabbage = this;
vulnerable = false;
}
function update() {
}
function hurtByPlayerTest(test_mc) {
return(_mc.hurtByPlayer_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return((_mc.bulletL_mc.hitTest(test_mc) || (_mc.bulletL_mc.hitTest(test_mc))) || (_mc.hurtByPlayer_mc.hitTest(test_mc)));
}
}
Symbol 1141 MovieClip [__Packages.EnemyBouncechick] Frame 0
class EnemyBouncechick extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, jumpingDir, reverse, dead, dontRespawn, deadAnimateCounter;
function EnemyBouncechick (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyBouncechick(): " + _mc._name) + ", EnemyBouncechick parent = ") + _mc._parent);
maxVelY = 0;
maxVelX = 2;
velX = 0;
velY = 0;
if (LevelEditor.editorActive) {
_mc.stop();
}
if (initObj.jumpingDir != undefined) {
jumpingDir = Number(initObj.jumpingDir);
} else {
jumpingDir = 1;
}
_mc.myEnemyBouncechick = _local4;
}
function update() {
_mc._x = _mc._x + velX;
if (Obstacle.hit(_mc) != undefined) {
reverse();
}
}
function startJump() {
_mc._x = _mc._x + (jumpLength * jumpingDir);
if (Platform.hit(_mc.hitTest_mc) == undefined) {
_mc._x = _mc._x - (jumpLength * jumpingDir);
jumpingDir = -jumpingDir;
} else {
_mc._x = _mc._x - (jumpLength * jumpingDir);
}
velX = 4 * jumpingDir;
}
function stopJump() {
velX = 0;
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.jumpingDir = jumpingDir;
return(_local2);
}
function die(x, y) {
dead = true;
var thisEnemy = this;
dontRespawn = true;
_mc.onEnterFrame = function () {
thisEnemy.updateDead();
};
_mc._y = _mc._y - (_mc._height - 5);
_mc.gotoAndPlay("dieRight");
deadAnimateCounter = 200;
}
function updateDead() {
_mc.gotoAndPlay("dieRight");
delete _mc.onEnterFrame;
}
var jumpLength = 73;
}
Symbol 1142 MovieClip [__Packages.EnemyChickJogger] Frame 0
class EnemyChickJogger extends Enemy
{
var classType, _mc, facingDir, applyInitObjProperties, applyFacingDir, maxVelY, maxVelX, velX, velY, reverseFacingDir;
function EnemyChickJogger (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyChickJogger(): " + _mc._name) + ", EnemyChickJogger parent = ") + _mc._parent);
_mc.animator_mc.stop();
facingDir = "left";
applyInitObjProperties(initObj);
applyFacingDir();
maxVelY = 0;
maxVelX = 5;
if (facingDir == "left") {
velX = -0.5;
} else {
velX = 0.5;
}
velY = 0;
}
function update() {
if (velX == 0) {
_mc.animator_mc.stop();
} else {
_mc.animator_mc.play();
}
_mc._x = _mc._x + velX;
if (velX > 0) {
velX = velX + 0.04;
if (velX > maxVelX) {
velX = maxVelX;
}
} else {
velX = velX - 0.04;
if (velX < (-maxVelX)) {
velX = maxVelX;
}
}
if (Platform.hit(_mc.hitTest_mc) == undefined) {
_mc._x = _mc._x - velX;
if (velX < 0) {
velX = 0.5;
} else {
velX = -0.5;
}
reverseFacingDir();
applyFacingDir();
} else if (Obstacle.hit(_mc) != undefined) {
var _local2 = 0;
while (_local2 < 5) {
_mc._x = _mc._x - velX;
if (Obstacle.hit(_mc) == undefined) {
_local2 = 6;
}
_local2++;
}
if (velX < 0) {
velX = 0.5;
} else {
velX = -0.5;
}
reverseFacingDir();
applyFacingDir();
}
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.facingDir = facingDir;
return(_local2);
}
function updateDead() {
delete _mc.onEnterFrame;
}
}
Symbol 1143 MovieClip [__Packages.EnemyFlyingToothbot] Frame 0
class EnemyFlyingToothbot extends Enemy
{
var classType, maxVelY, maxVelX, velX, velY, lRange, rRange, facingDir, _mc, subType, vulnerable, reverse;
function EnemyFlyingToothbot (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var thisEnemyFlyingToothbot = this;
maxVelY = 0;
maxVelX = 4;
velX = -3;
velY = 0;
lRange = x;
rRange = 100;
facingDir = "left";
for (var _local4 in initObj) {
this[_local4] = Number(initObj[_local4]);
}
if (LevelEditor.isActive()) {
} else {
_mc.rangeGuide_mc._visible = false;
_mc.onEnterFrame = function () {
thisEnemyFlyingToothbot.update();
};
}
if (subType == 22) {
vulnerable = false;
}
}
function collideTest(test_mc) {
return(_mc.animator_mc.hurtTest_mc.hitTest(test_mc));
}
function hurtByPlayerTest(test_mc) {
return(_mc.animator_mc.hurtTest_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.animator_mc.hurtTest_mc.hitTest(test_mc));
}
function update() {
if ((velX > 0) && (_mc._x >= (lRange + rRange))) {
reverse();
}
if ((velX < 0) && (_mc._x <= lRange)) {
reverse();
}
if (velX >= maxVelX) {
velX = maxVelX;
}
if (velX <= (-maxVelX)) {
velX = -maxVelX;
}
_mc._x = _mc._x + velX;
}
function updateDead() {
delete _mc.onEnterFrame;
}
function moveRangeGuideTo(newVal) {
if (newVal < _mc.x) {
newVal = _mc.x;
}
rRange = newVal;
_mc.rangeGuide_mc._x = rRange;
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.rRange = rRange;
_local2.maxVelX = maxVelX;
return(_local2);
}
}
Symbol 1144 MovieClip [__Packages.EnemyVacgun] Frame 0
class EnemyVacgun extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, hitPoints, invincibleCounter, initHurtFlasher, facingDir, applyInitObjProperties, applyFacingDir, dead, dontRespawn, updateHurtFlasher, clearHurtFlasher, subType;
function EnemyVacgun (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyVacgun(): " + _mc._name) + ", EnemyVacgun parent = ") + _mc._parent);
maxVelY = 0;
maxVelX = -1.5;
velX = -1.5;
velY = 0;
hitPoints = 3;
invincibleCounter = 0;
initHurtFlasher(_mc.chickun_mc.animator_mc);
facingDir = "left";
_mc.mVacgun = this;
applyInitObjProperties(initObj);
applyFacingDir();
}
function takeDamage(x, y) {
if (invincibleCounter == 0) {
hitPoints--;
invincibleCounter = 24;
}
if (hitPoints == 0) {
die(x, y);
}
}
function die(x, y) {
var _local2 = this;
_mc.gotoAndPlay("die");
dead = true;
dontRespawn = true;
velX = 0;
velY = 0;
}
function update() {
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function collideTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.facingDir = facingDir;
return(_local2);
}
function shoot() {
var _local2;
if (subType == 8) {
_local2 = "Bullet2";
} else {
_local2 = "Bullet7";
}
if (facingDir == "left") {
var _local3 = new Bullet(_local2, _mc._x - 14, _mc._y - 29, -13, 0, false);
} else {
var _local3 = new Bullet(_local2, _mc._x + 14, _mc._y - 29, 13, 0, false);
}
}
}
Symbol 1145 MovieClip [__Packages.Bullet] Frame 0
class Bullet
{
static var bulletArray;
var classType, xVel, yVel, friendly, deflectable, active, _mc;
function Bullet (symbolName, start_x, start_y, pxVel, pyVel, pFriendly, pGrav, pDeflectable) {
if (bulletArray == undefined) {
bulletArray = new Array();
depthCount = 0;
}
if (pGrav == undefined) {
gravity = 0;
} else {
gravity = pGrav;
}
classType = "Bullet";
xVel = pxVel;
yVel = pyVel;
friendly = pFriendly;
deflectable = pDeflectable;
if (pDeflectable == undefined) {
deflectable = true;
}
active = true;
_mc = StinkoGame.bullet_mc.attachMovie(symbolName, "bullet" + depthCount, depthCount++);
_mc._x = start_x;
_mc._y = start_y;
if (xVel > 0) {
_mc.gotoAndStop("right");
} else {
_mc.gotoAndStop("left");
}
var thisBullet = this;
_mc.onEnterFrame = function () {
thisBullet.update();
};
bulletArray.push(this);
}
function update() {
_mc._x = _mc._x + xVel;
_mc._y = _mc._y + yVel;
yVel = yVel + gravity;
if (!StinkoGame.isWithinActiveStage(_mc._x, _mc._y, 20, 20)) {
kill();
}
testForHits();
subClassUpdate();
}
function subClassUpdate() {
}
static function anyPlayerDangerTest(test_mc) {
var _local1 = 0;
while (_local1 < bulletArray.length) {
if (((!bulletArray[_local1].friendly) && (bulletArray[_local1].active)) && (bulletArray[_local1]._mc.hitTest(test_mc))) {
return(bulletArray[_local1]);
}
_local1++;
}
return(undefined);
}
function kill() {
clearFromObjectsArray();
_mc.removeMovieClip();
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < bulletArray.length) {
if (this == bulletArray[_local2]) {
bulletArray.splice(_local2, 1);
break;
}
_local2++;
}
}
function testForHits() {
}
static function killAll() {
var _local1 = 0;
while (_local1 < bulletArray.length) {
bulletArray[_local1]._mc.removeMovieClip();
delete bulletArray[_local1];
_local1++;
}
bulletArray = new Array();
}
function deflect() {
if (!deflectable) {
return(undefined);
}
_mc.myBullet = this;
if (xVel > 0) {
_mc.gotoAndPlay("deflect_right");
} else {
_mc.gotoAndPlay("deflect_left");
}
xVel = 0;
active = false;
delete _mc.onEnterFrame;
}
var gravity = 0;
static var depthCount = 0;
}
Symbol 1146 MovieClip [__Packages.EnemyTriggerable] Frame 0
class EnemyTriggerable extends Enemy
{
var classType, _mc, vulnerable, triggered, subType;
function EnemyTriggerable (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyTriggerable(): " + _mc._name) + ", EnemyTriggerable parent = ") + _mc._parent);
if (LevelEditor.editorActive) {
_mc.stop();
}
_mc.myEnemyTriggerable = this;
vulnerable = false;
triggered = false;
if (!LevelEditor.isActive()) {
_mc.triggerGuide_mc._visible = false;
}
}
function update() {
if ((!triggered) && (StinkoGame.player1._mc.hitTest(_mc))) {
trace("UFO was hit!!!");
triggered = true;
_mc.gotoAndPlay("go");
}
}
function hurtByPlayerTest(test_mc) {
return(_mc.hurtByPlayer_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
if (subType == 9) {
return((((_mc.animator_mc.ship_mc.hitTest(test_mc) || (_mc.animator_mc.bullet1.hitTest(test_mc))) || (_mc.animator_mc.bullet2.hitTest(test_mc))) || (_mc.animator_mc.bullet3.hitTest(test_mc))) || (_mc.animator_mc.bullet4.hitTest(test_mc)));
}
return(_mc.hitTest_mc.hitTest(test_mc));
}
}
Symbol 1147 MovieClip [__Packages.EnemyGokul] Frame 0
class EnemyGokul extends Enemy
{
var classType, _mc, dead, dontRespawn, velX, velY;
function EnemyGokul (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyGokul(): " + _mc._name) + ", EnemyGokul parent = ") + _mc._parent);
}
function update() {
}
function die(x, y) {
var _local2 = this;
_mc.gotoAndPlay("die");
dead = true;
dontRespawn = true;
velX = 0;
velY = 0;
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
}
Symbol 1148 MovieClip [__Packages.EnemyPoorbt] Frame 0
class EnemyPoorbt extends Enemy
{
var classType, _mc, shotsFired, shotsToFire, vulnerable, triggered, enterFrom, facingDir, velX, enterCounter, deadAnimateCounter, remove;
function EnemyPoorbt (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyPoorbt(): " + _mc._name) + ", EnemyPoorbt parent = ") + _mc._parent);
if (LevelEditor.editorActive) {
_mc.stop();
}
shotsFired = 0;
_mc.mPoorbt = this;
shotsToFire = Number(initObj.shotsToFire);
if ((shotsToFire == undefined) || (isNaN(initObj.shotsToFire))) {
shotsToFire = 1;
}
vulnerable = false;
triggered = false;
enterFrom = initObj.facingDir;
if (enterFrom == undefined) {
enterFrom = "left";
}
if (enterFrom == "left") {
facingDir = "right";
velX = 6;
} else {
facingDir = "left";
velX = -4;
}
if (!LevelEditor.isActive()) {
_mc.triggerGuide_mc._visible = false;
}
}
function update() {
var thisPoorbt = this;
if ((!triggered) && (StinkoGame.player1._mc.hitTest(_mc))) {
triggered = true;
vulnerable = true;
var _local2 = new Object({y:0});
if (enterFrom == "left") {
_local2.x = StinkoGame.viewBox.l - 10;
} else {
_local2.x = StinkoGame.viewBox.r + 10;
}
StinkoGame._mc.gameStage_mc.globalToLocal(_local2);
_mc.gotoAndStop(facingDir + "with");
_mc._x = _local2.x;
enterCounter = 24;
_mc.onEnterFrame = function () {
thisPoorbt.updateEnter();
};
}
}
function updateEnter() {
_mc._x = _mc._x + velX;
enterCounter--;
var _local2 = new Object({x:_mc._x, y:0});
_mc._parent.localToGlobal(_local2);
if ((_local2.x > (StinkoGame.viewBox.l + 30)) && (_local2.x < (StinkoGame.viewBox.r - 30))) {
_mc.gotoAndStop(facingDir + "Shoot");
delete _mc.onEnterFrame;
}
}
function updateExit() {
_mc._x = _mc._x + velX;
var _local2 = new Object({x:_mc._x, y:0});
_mc._parent.localToGlobal(_local2);
if ((_local2.x < (StinkoGame.viewBox.l - 30)) || (_local2.x > (StinkoGame.viewBox.r + 30))) {
_mc.gotoAndStop("done");
delete _mc.onEnterFrame;
}
}
function hurtByPlayerTest(test_mc) {
return(_mc.hurtByPlayer_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return((((_mc.animator_mc.ship_mc.hitTest(test_mc) || (_mc.animator_mc.bullet1.hitTest(test_mc))) || (_mc.animator_mc.bullet2.hitTest(test_mc))) || (_mc.animator_mc.bullet3.hitTest(test_mc))) || (_mc.animator_mc.bullet4.hitTest(test_mc)));
}
function createBullet() {
if (facingDir == "left") {
var _local2 = new Bullet("Bullet5", _mc._x - 14, _mc._y - 24, -13, 0, false);
} else {
var _local2 = new Bullet("Bullet4", _mc._x + 14, _mc._y - 24, 13, 0, false);
}
shotsFired++;
}
function resumeRunning() {
if (shotsFired < shotsToFire) {
_mc.gotoAndStop(facingDir + "Shoot");
return(undefined);
}
var thisPoorbt = this;
velX = (-velX) * 2;
if (facingDir == "left") {
facingDir = "right";
} else {
facingDir = "left";
}
enterCounter = 30;
_mc.gotoAndStop(facingDir + "Without");
_mc.onEnterFrame = function () {
thisPoorbt.updateExit();
};
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.facingDir = facingDir;
_local2.shotsToFire = shotsToFire;
return(_local2);
}
function updateDead() {
deadAnimateCounter--;
if ((_mc._y < -200) || (deadAnimateCounter < 0)) {
remove();
}
}
}
Symbol 1149 MovieClip [__Packages.EnemyGaspeau] Frame 0
class EnemyGaspeau extends Enemy
{
var classType, _mc, vulnerable, triggered, facingDir, velX, deadAnimateCounter, remove;
function EnemyGaspeau (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyGaspeau(): " + _mc._name) + ", EnemyGaspeau parent = ") + _mc._parent);
if (LevelEditor.editorActive) {
_mc.stop();
}
_mc.mGaspeau = this;
vulnerable = false;
triggered = false;
facingDir = initObj.facingDir;
if (facingDir == undefined) {
facingDir = "left";
}
if (!LevelEditor.isActive()) {
_mc.triggerGuide_mc._visible = false;
}
}
function update() {
var thisGaspeau = this;
if ((!triggered) && (StinkoGame.oneUp._mc.hitTest(_mc) || (StinkoGame.player1._mc.hitTest(_mc)))) {
triggered = true;
vulnerable = true;
var _local2 = new Object({y:0});
if (facingDir == "right") {
_local2.x = StinkoGame.viewBox.l - 10;
velX = 6;
} else {
_local2.x = StinkoGame.viewBox.r + 10;
velX = -3;
}
StinkoGame._mc.gameStage_mc.globalToLocal(_local2);
_mc.gotoAndStop(facingDir);
_mc._x = _local2.x;
trace((("EnemyGaspeau::update: Gaspeau was triggered" + _mc._x) + ",") + velX);
_mc.onEnterFrame = function () {
thisGaspeau.updateEnter();
};
}
}
function updateEnter() {
trace("EnemyGaspeau::update: Gaspeau is updating for Entry and _x = " + _mc._x);
_mc._x = _mc._x + velX;
var _local2 = new Object({x:_mc._x, y:0});
_mc._parent.localToGlobal(_local2);
if ((_local2.x < (StinkoGame.viewBox.l - 50)) || (_local2.x > (StinkoGame.viewBox.r + 50))) {
_mc.gotoAndStop("done");
delete _mc.onEnterFrame;
}
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.facingDir = facingDir;
return(_local2);
}
function updateDead() {
deadAnimateCounter--;
if ((_mc._y < -200) || (deadAnimateCounter < 0)) {
remove();
}
}
}
Symbol 1150 MovieClip [__Packages.EnemyChamCham] Frame 0
class EnemyChamCham extends Enemy
{
var classType, _mc, dead, dontRespawn, velX, velY;
function EnemyChamCham (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyChamCham(): " + _mc._name) + ", EnemyChamCham parent = ") + _mc._parent);
_mc.mChamCham = this;
}
function update() {
}
function die(x, y) {
var _local2 = this;
_mc.gotoAndPlay("die");
dead = true;
dontRespawn = true;
velX = 0;
velY = 0;
}
function shoot() {
var _local2 = new Bullet("Bullet6", _mc._x - 45, _mc._y - 30, 0, -7, false, 0, false);
var _local3 = new Bullet("Bullet6", _mc._x + 45, _mc._y - 30, 0, -7, false, 0, false);
}
function hurtByPlayerTest(test_mc) {
return(_mc.hurtByPlayer_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
}
Symbol 1151 MovieClip [__Packages.EnemyAstromund] Frame 0
class EnemyAstromund extends Enemy
{
var classType, _mc, vulnerable, triggered, facingDir, enterFrom, velX, yVel, remove, deadAnimateCounter;
function EnemyAstromund (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyAstromund(): " + _mc._name) + ", EnemyAstromund parent = ") + _mc._parent);
if (LevelEditor.isActive()) {
_mc.stop();
delete _mc.onEnterFrame;
} else {
_mc.triggerGuide_mc._visible = false;
}
_mc.mAstromund = this;
vulnerable = false;
triggered = false;
facingDir = initObj.facingDir;
if (facingDir == undefined) {
facingDir = "left";
}
if (facingDir == "left") {
enterFrom = "right";
velX = -6;
} else {
enterFrom = "left";
velX = 6;
}
}
function update() {
var thisAstromund = this;
if ((!triggered) && (StinkoGame.player1._mc.hitTest(_mc))) {
trace("EnemyAstromund::update: Astromund was triggered");
triggered = true;
vulnerable = true;
var _local2 = new Object({y:0});
if (enterFrom == "left") {
_local2.x = StinkoGame.viewBox.l - 10;
} else {
_local2.x = StinkoGame.viewBox.r + 10;
}
StinkoGame._mc.gameStage_mc.globalToLocal(_local2);
_mc.gotoAndStop(facingDir);
_mc._x = _local2.x;
_mc.onEnterFrame = function () {
thisAstromund.updateRunning();
};
}
}
function updateRunning() {
trace("EnemyAstromund::update: Astromund is updating for Entry and _x = " + _mc._x);
_mc._x = _mc._x + velX;
var _local2;
_mc._y = _mc._y + yVel;
_local2 = MoveablePlatform.hitWalkies(_mc.hitTestWalk_mc);
if (_local2 == undefined) {
_local2 = Platform.hit(_mc.hitTestWalk_mc);
}
if (_local2 != undefined) {
_mc._y = _local2._y;
yVel = 0;
} else {
yVel = yVel + 1;
}
if (yVel >= 10) {
yVel = 0;
}
if (_mc._y > 500) {
remove();
return(undefined);
}
}
function applyFacingDir() {
}
function hurtByPlayerTest(test_mc) {
if (_mc.hurtByPlayer_mc.hitTest(test_mc)) {
var _local2 = new Object({x:test_mc._x, y:test_mc._y});
test_mc._parent.localToGlobal(_local2);
var _local3 = new Object({x:_mc.hurtByPlayer_mc._x, y:_mc.hurtByPlayer_mc._y});
_mc.localToGlobal(_local3);
if (((facingDir == "right") && (_local2.x < _local3.x)) || ((facingDir == "left") && (_local2.x > _local3.x))) {
return(true);
}
} else {
return(false);
}
}
function playerDangerTest(test_mc) {
return(_mc.hurtPlayer_mc.hitTest(test_mc));
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.facingDir = facingDir;
return(_local2);
}
function updateDead() {
deadAnimateCounter--;
if ((_mc._y < -200) || (deadAnimateCounter < 0)) {
remove();
}
}
}
Symbol 1152 MovieClip [__Packages.EnemyDometant] Frame 0
class EnemyDometant extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, hitPoints, invincibleCounter, initHurtFlasher, applyInitObjProperties, dead, dontRespawn, updateHurtFlasher, clearHurtFlasher, subType;
function EnemyDometant (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyDometant(): " + _mc._name) + ", EnemyDometant parent = ") + _mc._parent);
maxVelY = 0;
maxVelX = -1.5;
velX = -1.5;
velY = 0;
hitPoints = 2;
invincibleCounter = 0;
initHurtFlasher(_mc);
_mc.mDometant = this;
applyInitObjProperties(initObj);
}
function takeDamage(x, y) {
if (invincibleCounter == 0) {
hitPoints--;
invincibleCounter = 24;
}
if (hitPoints == 0) {
die(x, y);
}
}
function die(x, y) {
var _local2 = this;
_mc.gotoAndPlay("die");
dead = true;
dontRespawn = true;
velX = 0;
velY = 0;
}
function update() {
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function collideTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function getAdditonalAttributes() {
var _local1 = new Object();
return(_local1);
}
function shoot() {
trace("shooting()");
var _local2;
if ((subType == 17) || (subType == 18)) {
_local2 = "Bullet2";
} else {
_local2 = "Bullet20";
}
if ((subType == 17) || (subType == 40)) {
var _local7 = new Bullet(_local2, _mc._x, _mc._y - 15, -8, 0, false);
var _local6 = new Bullet(_local2, _mc._x, _mc._y - 15, 8, 0, false);
var _local5 = new Bullet(_local2, _mc._x, _mc._y - 15, 8, -8, false);
var _local4 = new Bullet(_local2, _mc._x, _mc._y - 15, -8, -8, false);
var _local3 = new Bullet(_local2, _mc._x, _mc._y - 15, 0, -8, false);
} else {
var _local7 = new Bullet(_local2, _mc._x, _mc._y + 15, -8, 0, false);
var _local6 = new Bullet(_local2, _mc._x, _mc._y + 15, 8, 0, false);
var _local5 = new Bullet(_local2, _mc._x, _mc._y + 15, 8, 8, false);
var _local4 = new Bullet(_local2, _mc._x, _mc._y + 15, -8, 8, false);
var _local3 = new Bullet(_local2, _mc._x, _mc._y + 15, 0, 8, false);
}
}
}
Symbol 1153 MovieClip [__Packages.EnemyPlugman] Frame 0
class EnemyPlugman extends Enemy
{
var classType, _mc, velX, velY, hitPoints, baseHitPoints, invincibleCounter, initHurtFlasher, facingDir, applyInitObjProperties, applyFacingDir, shootTimer, shootTop, dead, dontRespawn, updateHurtFlasher, clearHurtFlasher;
function EnemyPlugman (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyPlugman(): " + _mc._name) + ", EnemyPlugman parent = ") + _mc._parent);
velX = 0;
velY = 0;
hitPoints = 5;
baseHitPoints = 2;
_mc.mEnemy = this;
invincibleCounter = 0;
initHurtFlasher(_mc.animator_mc.base_mc);
facingDir = "left";
applyInitObjProperties(initObj);
applyFacingDir();
shootTimer = 20;
shootTop = false;
}
function takeDamage(x, y) {
if (invincibleCounter == 0) {
baseHitPoints--;
if (baseHitPoints == 0) {
destroyBase();
}
hitPoints--;
invincibleCounter = 24;
}
if (hitPoints == 0) {
die(x, y);
}
}
function die(x, y) {
var _local2 = this;
delete _mc.onEnterFrame;
_mc.animator_mc.gotoAndPlay("die");
dead = true;
dontRespawn = true;
}
function update() {
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
if (baseHitPoints <= 0) {
shootTimer--;
if (shootTimer < 0) {
shoot();
}
}
if (StinkoGame.getPlayerGlobal().x > (_mc._x + 10)) {
facingDir = "right";
} else {
facingDir = "left";
}
applyFacingDir();
}
function collideTest(test_mc) {
if (baseHitPoints > 0) {
return(_mc.animator_mc.base_mc.hitTest(test_mc));
}
return(_mc.animator_mc.top_mc.hitTest(test_mc));
}
function hurtByPlayerTest(test_mc) {
if (baseHitPoints > 0) {
return(_mc.animator_mc.base_mc.hitTest(test_mc));
}
return(_mc.animator_mc.top_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
if (baseHitPoints > 0) {
return(_mc.animator_mc.base_mc.hitTest(test_mc));
}
return(_mc.animator_mc.top_mc.hitTest(test_mc));
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.facingDir = facingDir;
return(_local2);
}
function destroyBase() {
_mc.animator_mc.gotoAndPlay("destroyBase");
invincibleCounter = 24;
shootTimer = 40;
}
function shoot() {
var _local2 = new Object({x:_mc._x, y:_mc._y - 58});
_mc._parent.localToGlobal(_local2);
StinkoGame.bullet_mc.globalToLocal(_local2);
var _local3;
if (facingDir == "right") {
_local3 = 10;
_local2.x = _local2.x + 0;
} else {
_local3 = -10;
_local2.x = _local2.x - 25;
}
if (shootTop) {
shootTimer = 60;
_local2.y = _local2.y + 2;
} else {
shootTimer = 12;
_local2.y = _local2.y + 28;
}
shootTop = !shootTop;
var _local4 = new Bullet("Bullet10", _local2.x, _local2.y, _local3, 0, false, 0, false);
_mc.animator_mc.top_mc.gotoAndPlay("shoot");
}
function readyForSecondPhase() {
initHurtFlasher(_mc.animator_mc.base_mc);
}
}
Symbol 1154 MovieClip [__Packages.EnemyStothos] Frame 0
class EnemyStothos extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, hitPoints, invincibleCounter, initHurtFlasher, die, updateHurtFlasher, clearHurtFlasher, reverse;
function EnemyStothos (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyStothos(): " + _mc._name) + ", EnemyStothos parent = ") + _mc._parent);
_mc.animator_mc.stop();
maxVelY = 0;
maxVelX = -2;
velX = -2;
velY = 0;
hitPoints = 3;
invincibleCounter = 0;
initHurtFlasher(_mc);
_mc.mEnemy = this;
}
function takeDamage(x, y) {
if (invincibleCounter == 0) {
hitPoints--;
invincibleCounter = 24;
}
if (hitPoints == 0) {
die(x, y);
}
}
function updateDead() {
delete _mc.onEnterFrame;
}
function update() {
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
if (velX == 0) {
_mc.animator_mc.stop();
} else {
_mc.animator_mc.play();
}
_mc._x = _mc._x + velX;
if (Platform.hit(_mc.hitTest_mc) == undefined) {
reverse();
}
if (Obstacle.hit(_mc) != undefined) {
var _local2 = 0;
while (_local2 < 5) {
_mc._x = _mc._x - velX;
if (Obstacle.hit(_mc) == undefined) {
_local2 = 6;
}
_local2++;
}
reverse();
}
}
function shoot(dir) {
var _local2 = new Object({x:_mc._x, y:_mc._y - 41});
_mc._parent.localToGlobal(_local2);
StinkoGame.bullet_mc.globalToLocal(_local2);
var _local3;
if (dir == "right") {
_local3 = 10;
_local2.x = _local2.x + 25;
} else {
_local3 = -10;
_local2.x = _local2.x - 25;
}
var _local4 = new Bullet("Bullet12", _local2.x, _local2.y, _local3, 0, false, 0, false);
}
}
Symbol 1155 MovieClip [__Packages.EnemyFullbide] Frame 0
class EnemyFullbide extends Enemy
{
var classType, _mc, velX, velY, vulnerable, triggered, facingDir, originalY, remove, deadAnimateCounter;
function EnemyFullbide (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
trace((("EnemyFullbidee(): " + _mc._name) + ", EnemyFullbide parent = ") + _mc._parent);
velX = 0;
velY = 0;
if (LevelEditor.editorActive) {
_mc.stop();
}
_mc.myEnemyFullbide = this;
vulnerable = false;
triggered = false;
if (!LevelEditor.isActive()) {
_mc.triggerGuide_mc._visible = false;
}
if (initObj.facingDir == undefined) {
facingDir = "left";
} else {
facingDir = initObj.facingDir;
}
}
function update() {
if ((!triggered) && (StinkoGame.player1._mc.hitTest(_mc))) {
trace("EnemyFullbide was triggered hit!!!");
startFlyin();
} else {
_mc._x = _mc._x + velX;
_mc._y = _mc._y + velY;
if (_mc._y > originalY) {
velY = -6;
}
var _local2 = new Object({x:_mc._x, y:0});
_mc._parent.localToGlobal(_local2);
if ((_local2.x < (StinkoGame.viewBox.l - 30)) || (_local2.x > (StinkoGame.viewBox.r + 30))) {
remove();
delete _mc.onEnterFrame;
}
}
}
function startFlyin() {
trace("EnemyFullbide::startFlyin(): " + facingDir);
triggered = true;
vulnerable = true;
_mc.gotoAndPlay(facingDir);
if (facingDir == "right") {
velX = 12;
} else {
velX = -10;
}
var _local2 = new Object({y:0});
if (facingDir == "right") {
_local2.x = StinkoGame.viewBox.l;
} else {
_local2.x = StinkoGame.viewBox.r + 10;
}
StinkoGame._mc.gameStage_mc.globalToLocal(_local2);
_mc._x = _local2.x;
originalY = _mc._y;
_mc._y = _mc._y - 120;
velY = 6;
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function getAdditonalAttributes() {
return(new Object({facingDir:facingDir}));
}
function applyFacingDir() {
}
function updateDead() {
deadAnimateCounter--;
if (deadAnimateCounter < 0) {
remove();
}
}
}
Symbol 1156 MovieClip [__Packages.EnemyMybenj] Frame 0
class EnemyMybenj extends Enemy
{
var classType, _mc, maxVelY, maxVelX, velX, velY, reverse, reverseCounter;
function EnemyMybenj (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyMybenj(): " + _mc._name) + ", EnemyMybenj parent = ") + _mc._parent);
_mc.animator_mc.stop();
maxVelY = 0;
maxVelX = 6;
velX = -6;
velY = 0;
pickNewDirection();
}
function updateDead() {
delete _mc.onEnterFrame;
}
function update() {
var _local3 = StinkoGame.getGlobalCoord(_mc).x;
if ((_local3 > (StinkoGame.viewBox.r + 8)) || (_local3 < (StinkoGame.viewBox.l - 3))) {
return(undefined);
}
if (velX == 0) {
_mc.animator_mc.stop();
} else {
_mc.animator_mc.play();
}
_mc._x = _mc._x + velX;
if (Platform.hit(_mc.hitTest_mc) == undefined) {
reverse();
resetReverseCounter();
return(undefined);
}
if ((Obstacle.hit(_mc) != undefined) || (EnemyBiztar.hit(_mc) != undefined)) {
var _local2 = 0;
while (_local2 < 5) {
_mc._x = _mc._x - velX;
if ((Obstacle.hit(_mc) == undefined) && (EnemyBiztar.hit(_mc) == undefined)) {
_local2 = 6;
}
_local2++;
}
resetReverseCounter();
reverse();
}
reverseCounter--;
if (reverseCounter < 0) {
pickNewDirection();
}
}
function pickNewDirection() {
resetReverseCounter();
reverse();
}
function resetReverseCounter() {
reverseCounter = Math.floor(Math.random() * 12) + 9;
}
}
Symbol 1157 MovieClip [__Packages.EnemyShooter] Frame 0
class EnemyShooter extends Enemy
{
var classType, velX, velY, _mc, initHurtFlasher, invincibleCounter, subType, hitPoints, dontRespawn, updateHurtFlasher, clearHurtFlasher, dead;
function EnemyShooter (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local4 = this;
if ((initObj.velX == undefined) || (isNaN(initObj.velX))) {
velX = 0;
} else {
velX = Number(initObj.velX);
}
if ((initObj.velY == undefined) || (isNaN(initObj.velY))) {
velY = 0;
} else {
velY = Number(initObj.velY);
}
trace((((((("EnemyShooter(): " + _mc._name) + ", EnemyShooter parent = ") + _mc._parent) + ",velx = ") + velX) + ",vely =") + velY);
if (LevelEditor.editorActive) {
_mc.stop();
_mc.animator_mc.stop();
}
initHurtFlasher(_mc);
invincibleCounter = 0;
switch (subType) {
case 29 :
hitPoints = 3;
break;
case 30 :
hitPoints = 2;
break;
case 31 :
hitPoints = 3;
break;
case 32 :
hitPoints = 1;
break;
case 33 :
hitPoints = 2;
break;
default :
hitPoints = 1;
}
dontRespawn = true;
}
function update() {
_mc._x = _mc._x + velX;
_mc._y = _mc._y + velY;
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.velX = velX;
_local2.velY = velY;
return(_local2);
}
function updateDead() {
delete _mc.onEnterFrame;
}
function takeDamage(x, y) {
if (invincibleCounter < 1) {
hitPoints--;
invincibleCounter = 6;
}
if (hitPoints <= 0) {
die();
clearHurtFlasher();
}
}
function die(x, y) {
dontRespawn = true;
delete _mc.onEnterFrame;
_mc.stop();
switch (subType) {
case 34 :
_mc.gotoAndPlay("die");
break;
case 35 :
_mc.gotoAndPlay("die");
trace("EnemyShooter()::die telling Manta to die");
break;
default :
_mc.animator_mc.gotoAndPlay("die");
}
dead = true;
velX = 0;
velY = 0;
}
}
Symbol 1158 MovieClip [__Packages.EnemyShark] Frame 0
class EnemyShark extends EnemyShooter
{
var waitToLaunchCounter, launching, velX, _mc, velY, invincibleCounter, updateHurtFlasher, clearHurtFlasher;
function EnemyShark (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
waitToLaunchCounter = 0;
launching = false;
velX = -5;
}
function update() {
var _local2 = new Object({x:StinkoGame.viewBox.r - 90, y:StinkoGame.viewBox.t + ((StinkoGame.viewBox.b - StinkoGame.viewBox.t) / 2)});
_mc._parent.globalToLocal(_local2);
if (!launching) {
_mc._x = _mc._x + velX;
_mc._y = _mc._y + velY;
if (_mc._x < _local2.x) {
waitToLaunchCounter = 10;
launching = true;
}
} else if (waitToLaunchCounter > 0) {
waitToLaunchCounter--;
_mc._x = _mc._x + 1;
} else {
_mc._x = _mc._x + velX;
_mc._y = _mc._y + velY;
velX = velX - 2;
}
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function shoot() {
var _local2 = new Bullet("Bullet16", _mc._x - 5, _mc._y, -6, -5, false, 0.8);
}
}
Symbol 1159 MovieClip [__Packages.ShootingGame] Frame 0
class ShootingGame extends StinkoGame
{
static var scrollMoveCounter;
function ShootingGame (p_mc, pld, viewBox_mc) {
super(p_mc, pld, viewBox_mc);
scrollMoveCounter = 0;
setNewAutoscroll(20, 0);
}
static function nudge(x, y) {
StinkoGame.activeStageCounterX = StinkoGame.activeStageCounterX + x;
StinkoGame.activeStageCounterY = StinkoGame.activeStageCounterY + y;
if (x != 0) {
if ((StinkoGame._mc.gameStage_mc._x + x) > StinkoGame.originX) {
return(false);
}
}
if (y != 0) {
if ((StinkoGame._mc.gameStage_mc._y + y) < StinkoGame.originY) {
return(false);
}
}
StinkoGame._mc.gameStage_mc._x = StinkoGame._mc.gameStage_mc._x + x;
StinkoGame._mc.gameStage_mc._y = StinkoGame._mc.gameStage_mc._y + y;
StinkoGame.bossMan._mc._y = StinkoGame.bossMan._mc._y + y;
StinkoGame._mc.bullet_mc._x = StinkoGame._mc.gameStage_mc._x;
StinkoGame._mc.bullet_mc._y = StinkoGame._mc.gameStage_mc._y;
var _local3;
scrollMoveCounter++;
if (scrollMoveCounter == 4) {
scrollMoveCounter = 0;
}
if (x != 0) {
if (Math.abs(x / 2) < 1) {
if ((scrollMoveCounter % 2) == 0) {
StinkoGame.sScrollB.nudge(Math.abs(x) / x, 0);
}
} else {
StinkoGame.sScrollB.nudge(x / 2, 0);
}
if (Math.abs(x / 4) < 1) {
if ((scrollMoveCounter % 4) == 0) {
StinkoGame.sScrollA.nudge(Math.abs(x) / x, 0);
}
} else {
StinkoGame.sScrollA.nudge(x / 4, 0);
}
}
if ((Math.floor(Math.abs(StinkoGame.activeStageCounterX) / 10) > 1) || (Math.floor(Math.abs(StinkoGame.activeStageCounterY) / 10) > 1)) {
drawActiveStage();
StinkoGame.activeStageCounterX = 0;
StinkoGame.activeStageCounterY = 0;
}
return(true);
}
static function drawActiveStage(force) {
var _local2 = 0;
while (_local2 < StinkoGame.ld.stageObjSource.length) {
var _local1 = StinkoGame.ld.stageObjSource[_local2];
if (!_local1.__get__active()) {
if (StinkoGame.isWithinActiveStage(_local1.x, _local1.y, 200, 200)) {
if (_local1.canSpawn) {
_local1.assignedObject = StinkoGame.ld.addStageObject(_local1.classType, _local1.subType, _local1.x, _local1.y, _local1.depth, _local1.propObj);
_local1.__set__active(true);
_local1.canSpawn = false;
}
}
} else if (!StinkoGame.isWithinActiveStage(_local1.assignedObject._mc._x, _local1.assignedObject._mc._y, 200, 200)) {
_local1.assignedObject.kill();
_local1.assignedObject = undefined;
_local1.__set__active(false);
_local1.canSpawn = false;
}
_local2++;
}
}
static function setNewAutoscroll(x, y) {
StinkoGame.player1.autoScrollSpeed.x = x;
StinkoGame.player1.autoScrollSpeed.y = y;
}
}
Symbol 1160 MovieClip [__Packages.EnemyJellyfish] Frame 0
class EnemyJellyfish extends EnemyShooter
{
var sliding, _mc, velY, xtoyRatio, velX, invincibleCounter, updateHurtFlasher, clearHurtFlasher;
function EnemyJellyfish (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
sliding = false;
_mc.mJellyfish = this;
if (velY != 0) {
xtoyRatio = -3 / velY;
} else {
xtoyRatio = 0;
}
}
function setSliding(val) {
sliding = val;
if (sliding) {
velX = -3;
}
}
function update() {
if (!sliding) {
if ((velX > 0.1) || (velX < -0.1)) {
velX = velX * 0.4;
} else {
velX = 0;
}
}
_mc._x = _mc._x + velX;
if (velX != 0) {
_mc._y = _mc._y + (velX * xtoyRatio);
}
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
}
Symbol 1161 MovieClip [__Packages.EnemyClam] Frame 0
class EnemyClam extends EnemyShooter
{
var isOpen, _mc, hitPoints, vulnerable, velX, velY, invincibleCounter, updateHurtFlasher, clearHurtFlasher;
function EnemyClam (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
isOpen = false;
_mc.mClam = this;
hitPoints = 1;
}
function openClam() {
vulnerable = (isOpen = true);
}
function closeClam() {
vulnerable = (isOpen = false);
}
function update() {
if (!isOpen) {
_mc._x = _mc._x + velX;
_mc._y = _mc._y + velY;
}
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function shoot() {
var _local2 = new Bullet("Bullet16", _mc._x - 5, _mc._y, -6, -5, false, 0.8);
}
}
Symbol 1162 MovieClip [__Packages.EnemyManta] Frame 0
class EnemyManta extends EnemyShooter
{
var classType, _mc, velX, velY, hitPoints, invincibleCounter, initHurtFlasher, entranceFinished, applyInitObjProperties, applyFacingDir, shootTimer, giveUpCounter, swingUp, die, updateHurtFlasher, clearHurtFlasher;
function EnemyManta (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
classType = "Enemy";
var _local3 = this;
trace((("EnemyManta(): " + _mc._name) + ", EnemyManta parent = ") + _mc._parent);
velX = 0;
velY = 0;
hitPoints = 3;
_mc.mEnemy = this;
invincibleCounter = 0;
initHurtFlasher(_mc.animator_mc.base_mc);
entranceFinished = false;
applyInitObjProperties(initObj);
applyFacingDir();
shootTimer = 20;
giveUpCounter = 400;
swingUp = true;
}
function takeDamage(x, y) {
if (invincibleCounter == 0) {
hitPoints--;
invincibleCounter = 18;
}
if (hitPoints == 0) {
die(x, y);
}
}
function update() {
if (!entranceFinished) {
var _local2 = new Object({x:StinkoGame.viewBox.r - 60, y:StinkoGame.viewBox.t + ((StinkoGame.viewBox.b - StinkoGame.viewBox.t) / 2)});
_mc._x = _mc._x + (StinkoGame.player1.autoScrollSpeed.x / 10);
_mc._parent.globalToLocal(_local2);
_mc._x = _mc._x - ((_mc._x - _local2.x) / 4);
_mc._y = _mc._y - ((_mc._y - _local2.y) / 4);
if ((Math.abs(_mc._x - _local2.x) < 10) && (Math.abs(_mc._y - _local2.y) < 10)) {
entranceFinished = true;
trace("EnemyManta:update() entranceFinished = true");
}
} else if (giveUpCounter < 1) {
_mc._x = _mc._x - ((3 * StinkoGame.player1.autoScrollSpeed.x) / 10);
_mc._y = _mc._y - (StinkoGame.player1.autoScrollSpeed.y / 10);
} else {
_mc._x = _mc._x + (StinkoGame.player1.autoScrollSpeed.x / 10);
_mc._y = _mc._y - (StinkoGame.player1.autoScrollSpeed.y / 10);
giveUpCounter--;
shootTimer--;
if (shootTimer < 0) {
shoot();
}
if (swingUp) {
var _local2 = new Object({x:0, y:StinkoGame.viewBox.t + 80});
} else {
var _local2 = new Object({x:0, y:StinkoGame.viewBox.b - 80});
}
_mc._parent.globalToLocal(_local2);
_mc._y = _mc._y - ((_mc._y - _local2.y) / 10);
if (Math.abs(_mc._y - _local2.y) < 2) {
swingUp = !swingUp;
}
}
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function getAdditonalAttributes() {
var _local1 = new Object();
return(_local1);
}
function shoot() {
var _local3 = new Bullet("Bullet18", _mc._x - 38, _mc._y - 20, -20, 0, false, 0, false);
var _local2 = new Bullet("Bullet18", _mc._x - 38, _mc._y + 20, -20, 0, false, 0, false);
shootTimer = 16;
}
}
Symbol 1163 MovieClip [__Packages.EnemyVolcano] Frame 0
class EnemyVolcano extends EnemyShooter
{
var _mc, vulnerable;
function EnemyVolcano (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
_mc.mEnemy = this;
vulnerable = false;
}
function update() {
}
function hurtByPlayerTest(test_mc) {
return(undefined);
}
function playerDangerTest(test_mc) {
return((_mc.hurtTest_mc.hitTest(test_mc) || (_mc.animator_mc.rock1.hitTest(test_mc))) || (_mc.animator_mc.rock2.hitTest(test_mc)));
}
}
Symbol 1164 MovieClip [__Packages.EnemyThorn] Frame 0
class EnemyThorn extends EnemyShooter
{
var _mc;
function EnemyThorn (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
if (LevelEditor.editorActive) {
_mc.animator_mc.gotoAndStop(30);
}
}
function update() {
}
function hurtByPlayerTest(test_mc) {
return(undefined);
}
function playerDangerTest(test_mc) {
return(_mc.animator_mc.hurtTest_mc.hitTest(test_mc));
}
}
Symbol 1165 MovieClip [__Packages.EnemyCoral] Frame 0
class EnemyCoral extends EnemyShooter
{
var _mc;
function EnemyCoral (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, depth, initObj);
}
function takeDamage(x, y) {
_mc.gotoAndPlay("hit");
}
function hurtByPlayerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
function playerDangerTest(test_mc) {
return(_mc.hitTest_mc.hitTest(test_mc));
}
}
Symbol 1166 MovieClip [__Packages.Ladder] Frame 0
class Ladder extends StageObject
{
static var LadderArray;
var classType, _mc;
function Ladder (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Ladder" + typeNum, depth);
if (LadderArray == undefined) {
LadderArray = new Array();
}
classType = "Ladder";
var _local4 = this;
trace((("Ladder(): " + _mc._name) + ", Ladder parent = ") + _mc._parent);
LadderArray.push(this);
_mc.animator_mc.stop();
_mc.mType = "vert";
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < LadderArray.length) {
if (this == LadderArray[_local2]) {
LadderArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < LadderArray.length) {
if (test_mc.hitTest(LadderArray[_local1]._mc)) {
return(LadderArray[_local1]);
}
_local1++;
}
return(undefined);
}
}
Symbol 1167 MovieClip [__Packages.Wall] Frame 0
class Wall extends StageObject
{
static var WallArray;
var classType, _mc;
function Wall (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Wall" + typeNum, depth);
if (WallArray == undefined) {
WallArray = new Array();
}
classType = "Wall";
var _local3 = this;
trace((("Wall(): " + _mc._name) + ", Wall parent = ") + _mc._parent);
WallArray.push(this);
_mc.animator_mc.stop();
_mc.mType = "vert";
if (!LevelEditor.isActive()) {
_mc.editorGuide_mc._visible = false;
}
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < WallArray.length) {
if (this == WallArray[_local2]) {
WallArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < WallArray.length) {
if (test_mc.hitTest(WallArray[_local1]._mc)) {
return(WallArray[_local1]._mc);
}
_local1++;
}
return(undefined);
}
}
Symbol 1168 MovieClip [__Packages.Hazard] Frame 0
class Hazard extends StageObject
{
static var HazardArray;
var classType, _mc;
function Hazard (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Hazard" + typeNum, depth);
if (HazardArray == undefined) {
HazardArray = new Array();
}
classType = "Hazard";
var _local3 = this;
trace((("Hazard(): " + _mc._name) + ", Hazard parent = ") + _mc._parent);
HazardArray.push(this);
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < HazardArray.length) {
if (this == HazardArray[_local2]) {
HazardArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function anyPlayerDangerTest(test_mc) {
var _local1 = 0;
while (_local1 < HazardArray.length) {
if (test_mc.hitTest(HazardArray[_local1]._mc.hitTest_mc)) {
return(HazardArray[_local1]);
}
_local1++;
}
return(undefined);
}
}
Symbol 1169 MovieClip [__Packages.Trap] Frame 0
class Trap extends StageObject
{
static var TrapArray;
var classType, _mc;
function Trap (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Trap" + typeNum, depth);
if (TrapArray == undefined) {
TrapArray = new Array();
}
classType = "Trap";
var _local4 = this;
trace((("Trap(): " + _mc._name) + ", Trap parent = ") + _mc._parent);
TrapArray.push(this);
_mc.safe = false;
if (LevelEditor.isActive()) {
_mc.stop();
}
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < TrapArray.length) {
if (this == TrapArray[_local2]) {
TrapArray.splice(_local2, 1);
break;
}
_local2++;
}
}
function getHitClip() {
if (_mc.hitTest_mc._name != undefined) {
return(_mc.hitTest_mc);
}
return(_mc);
}
static function anyPlayerDangerTest(test_mc) {
var _local1 = 0;
while (_local1 < TrapArray.length) {
if ((!TrapArray[_local1]._mc.safe) && (test_mc.hitTest(TrapArray[_local1].getHitClip()))) {
return(TrapArray[_local1]);
}
_local1++;
}
return(undefined);
}
}
Symbol 1170 MovieClip [__Packages.Goal] Frame 0
class Goal extends StageObject
{
var classType, _mc;
function Goal (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Goal" + typeNum, depth);
classType = "Goal";
var thisGoal = this;
_mc.onEnterFrame = function () {
thisGoal.update();
};
if (!LevelEditor.editorActive) {
_mc._visible = false;
}
}
function clearFromObjectsArray() {
}
function update() {
if (((GlobalData.goalWarpsPlayer() && (StinkoGame.inProgress)) && (_mc.hitTest(StinkoGame.player1._mc))) && (GlobalData.sublevel != 4)) {
trace("Goal::update() -> telling StinkoGame to winLevel " + _mc._name);
StinkoGame.winLevel();
return(undefined);
}
if ((GlobalData.sublevel == 4) && (_mc.hitTest(StinkoGame.oneUp._mc))) {
StinkoGame.winLevel();
}
}
}
Symbol 1171 MovieClip [__Packages.GlobalData] Frame 0
class GlobalData
{
static var level, sublevel, subsublevel, mans, shields, items, maxHits, hits, testMode, levelLengths, lastSceneStorage;
function GlobalData () {
}
static function init() {
level = 1;
sublevel = 1;
subsublevel = 1;
mans = 3;
shields = 3;
items = 0;
maxHits = 4;
hits = maxHits;
testMode = false;
levelLengths = new Array();
levelLengths[0] = new Array();
var _local1 = 0;
while (_local1 < maxSublevel) {
levelLengths[0].push(3);
_local1++;
}
levelLengths.push(2);
}
static function cutSceneEnded() {
_root.cutScene_mc.removeMovieClip();
if ((sublevel == maxSublevel) && (subsublevel == 4)) {
init();
StinkoGame.killAll();
_root.gotoAndStop("youDead");
_root.gotoAndStop("tuneInNextWeek");
return(undefined);
}
if ((subsublevel == 4) && (((((((sublevel == 3) || (sublevel == 4)) || (sublevel == 5)) || (sublevel == 6)) || (sublevel == 7)) || (sublevel == 8)) || (sublevel == 9))) {
levelUp();
_root.gotoAndStop("youDead");
_root.gotoAndStop("cutScene");
trace((("cutSceneEnded: " + sublevel) + ",") + subsublevel);
showCutScene();
return(undefined);
}
if ((!bossLevel()) && (sublevel != 3)) {
_root.gotoAndPlay("loadFile");
} else {
_root.gotoAndPlay("gamePlayGo");
}
}
static function showCutScene() {
_root.cutSceneParent_mc.loadMovie(((((("externalSwf/cutscene" + level) + ".") + sublevel) + ".") + subsublevel) + ".swf");
if (bossLevel()) {
StinkoGame.gameSound.stop();
StinkoGame.gameSound = new SoundTrack(StinkoGame._mc);
}
}
static function levelUp() {
StinkoSaveData.finishedSaveLevel(sublevel, subsublevel);
subsublevel++;
if (subsublevel > levelLengths[level - 1][sublevel - 1]) {
sublevel++;
subsublevel = 1;
lastSceneStorage = new Object();
if (sublevel > levelLengths[level - 1].length) {
level++;
sublevel = 1;
}
}
trace((((("levelUp(): new level = " + level) + ", sublevel = ") + sublevel) + ", subsub = ") + subsublevel);
StinkoSaveData.setIt(sublevel, subsublevel);
}
static function shouldLevelWarp() {
trace((((("GlobalData::shouldLevelWarp(): " + levelLengths.length) + ",") + levelLengths[0].length) + ",") + levelLengths[0][0]);
trace((((("GlobalData::shouldLevelWarp(): " + subsublevel) + ",") + levelLengths[level - 1][0]) + ",") + levelLengths[level - 1][sublevel - 1]);
if ((subsublevel == 1) && (sublevel != 3)) {
return(true);
}
if ((subsublevel != 1) || (subsublevel < levelLengths[level - 1][sublevel - 1])) {
return(false);
}
return(true);
}
static function goalWarpsPlayer() {
if ((subsublevel == 1) && (sublevel != 3)) {
return(true);
}
if (subsublevel >= levelLengths[level - 1][sublevel - 1]) {
return(false);
}
return(true);
}
static function bossLevel() {
if (subsublevel == levelLengths[level - 1][sublevel - 1]) {
return(true);
}
return(false);
}
static function fillHits(numToAdd) {
if (numToAdd == undefined) {
hits = maxHits;
} else {
hits = hits + numToAdd;
if (hits > maxHits) {
hits = maxHits;
}
}
Interface.update();
}
static function extraMan() {
mans++;
Interface.update();
}
static function getShield() {
shields++;
Interface.update();
}
static function useShield() {
if (shields > 0) {
shields--;
Interface.update();
return(true);
}
return(false);
}
static function getMaxBulletsOnScreen() {
if (sublevel == 9) {
return(10);
}
return(3);
}
static var maxSublevel = 9;
}
Symbol 1172 MovieClip [__Packages.SoundTrack] Frame 0
class SoundTrack extends Sound
{
var attachSound, onSoundComplete, start;
function SoundTrack (p_mc) {
super(p_mc);
var thisSoundTrack = this;
if (GlobalData.bossLevel()) {
attachSound("Boss_Fight.mp3");
} else if (GlobalData.sublevel == 3) {
attachSound(((((("Level" + GlobalData.level) + ".") + GlobalData.sublevel) + ".") + GlobalData.subsublevel) + ".mp3");
} else {
attachSound(((("Level" + GlobalData.level) + ".") + GlobalData.sublevel) + ".mp3");
}
thisSoundTrack.start();
onSoundComplete = function () {
thisSoundTrack.loopSound();
};
}
function startFromBeginning() {
stop();
start();
}
function loopSound() {
trace("looping sound!");
stop();
if (((GlobalData.level == 1) && (GlobalData.sublevel == 1)) && (!GlobalData.bossLevel())) {
start(2.52);
} else if (((GlobalData.level == 1) && (GlobalData.sublevel == 8)) && (!GlobalData.bossLevel())) {
start(2.58);
} else if (((GlobalData.level == 1) && (GlobalData.sublevel == 9)) && (!GlobalData.bossLevel())) {
start(4.54);
} else {
start();
}
}
}
Symbol 1173 MovieClip [__Packages.StinkoSaveData] Frame 0
class StinkoSaveData
{
function StinkoSaveData () {
}
static function getIt() {
var _local1 = new Object();
if (GlobalData.testMode) {
_local1.sublevel = GlobalData.maxSublevel;
_local1.subsublevel = 2;
return(_local1);
}
var _local3 = LocalData.load("stinkoman", "toplevel_n");
if ((_local3 != undefined) && (!isNaN(_local3))) {
_local1.sublevel = Number(_local3);
if (_local1.sublevel < GlobalData.maxSublevel) {
_local1.sublevel = GlobalData.maxSublevel;
_local1.subsublevel = 1;
LocalData.save("stinkoman", "toplevel_n", GlobalData.maxSublevel);
LocalData.save("stinkoman", "topsublevel_n", 1);
return(_local1);
}
} else {
trace("a = undefined, sorry");
_local1.sublevel = GlobalData.maxSublevel;
_local1.subsublevel = 1;
return(_local1);
}
var _local2 = LocalData.load("stinkoman", "topsublevel_n");
if ((_local2 != undefined) || (isNaN(_local2))) {
_local1.subsublevel = Number(_local2);
} else {
_local1.subsublevel = 1;
}
trace((("StinkoSaveData()::get " + _local1.sublevel) + ",") + _local1.subsublevel);
return(_local1);
}
static function setIt(sublevel, subsublevel) {
var _local2 = getIt().sublevel;
var _local1 = getIt().subsublevel;
if (sublevel > _local2) {
LocalData.save("stinkoman", "toplevel_n", sublevel);
LocalData.save("stinkoman", "topsublevel_n", subsublevel);
} else if (subsublevel > _local1) {
LocalData.save("stinkoman", "toplevel_n", sublevel);
LocalData.save("stinkoman", "topsublevel_n", subsublevel);
} else {
LocalData.save("stinkoman", "toplevel_n", _local2);
LocalData.save("stinkoman", "topsublevel_n", _local1);
}
}
static function finishedSaveLevel(sublevel, subsublevel) {
var _local1 = 0;
while (_local1 < levelsFinished.length) {
if (levelsFinished[_local1] == ((sublevel + ".") + subsublevel)) {
return(undefined);
}
_local1++;
}
levelsFinished.push((sublevel + ".") + subsublevel);
levelsFinished.sort();
traceLevelsFinished();
}
static function convertOldData() {
trace("StinkoSaveData::convertOldData: called");
var _local3 = LocalData.load("stinkoman", "toplevel");
if (_local3 == undefined) {
return(undefined);
}
var _local4 = LocalData.load("stinkoman", "topsublevel");
if (_local4 == undefined) {
return(undefined);
}
trace((("StinkoSaveData::convertOldData: levelsFinished contents things are happening " + _local3) + ",") + _local4);
var _local2 = 1;
while (_local2 < _local3) {
var _local1 = 1;
while (_local1 <= 3) {
levelsFinished.push((_local2 + ".") + _local1);
_local1++;
}
_local2++;
}
_local2 = 1;
while (_local2 < _local4) {
levelsFinished.push((_local3 + ".") + _local2);
_local2++;
}
setIt(Number(_local3), Number(_local4));
traceLevelsFinished();
LocalData.save("stinkoman", "toplevel", undefined);
LocalData.save("stinkoman", "topsublevel", undefined);
}
static function traceLevelsFinished() {
var _local1 = 0;
while (_local1 < levelsFinished.length) {
trace((("levelsFinished[" + _local1) + "] ") + levelsFinished[_local1]);
_local1++;
}
}
static var levelsFinished = new Array();
}
Symbol 1174 MovieClip [__Packages.LocalData] Frame 0
class LocalData
{
function LocalData () {
}
static function save(record, field, value, path) {
var _local1;
if (path == undefined) {
_local1 = Object(SharedObject.getLocal(record));
} else {
_local1 = Object(SharedObject.getLocal(record, path));
}
_local1.data[field] = value;
_local1.flush();
}
static function load(record, field, path) {
if (path == undefined) {
return(Object(SharedObject.getLocal(record)).data[field]);
}
return(Object(SharedObject.getLocal(record, path)).data[field]);
}
}
Symbol 1175 MovieClip [__Packages.Interface] Frame 0
class Interface
{
static var _mc;
function Interface (p_mc) {
_mc = p_mc;
update();
}
static function update(p_mc) {
if (p_mc != undefined) {
_mc = p_mc;
}
_mc.mans_txt.text = GlobalData.mans;
_mc.items_mc.items_txt.text = GlobalData.items;
if (GlobalData.sublevel == 9) {
_mc.items_mc.items_txt.text = GlobalData.shields;
}
_mc.sublevel_txt.text = (GlobalData.sublevel + ".") + GlobalData.subsublevel;
if (GlobalData.sublevel == 8) {
_mc.sublevel_txt.text = "-0." + GlobalData.subsublevel;
}
_mc.energy_meter_mc.gotoAndStop(5 - GlobalData.hits);
_mc.keepTry_mc._visible = false;
if ((GlobalData.sublevel == 3) && (GlobalData.subsublevel == 1)) {
_mc.items_mc._visible = true;
_mc.items_mc.itemType_mc.gotoAndStop(1);
} else if ((GlobalData.sublevel == 3) && (GlobalData.subsublevel == 2)) {
_mc.items_mc._visible = true;
_mc.items_mc.itemType_mc.gotoAndStop(2);
} else if (GlobalData.sublevel == 9) {
_mc.items_mc._visible = true;
_mc.items_mc.itemType_mc.gotoAndStop(3);
} else {
_mc.items_mc._visible = false;
}
if (GlobalData.sublevel == 5) {
_mc.head_type.gotoAndStop("oneUp");
} else if (GlobalData.sublevel == 9) {
_mc.head_type.gotoAndStop("ship");
} else {
_mc.head_type.gotoAndStop("stinko");
}
}
static function showKeepTry() {
if (GlobalData.mans > 0) {
_mc.keepTry_mc._visible = true;
}
}
static function showStartUpMessage() {
if (GlobalData.bossLevel()) {
_mc.previewMessage_mc.textVar = "";
return(undefined);
}
_mc.previewMessage_mc.textVar = "START PLAY!";
if ((GlobalData.sublevel == 5) || (GlobalData.sublevel == 9)) {
_mc.previewMessage_mc._txt.textColor = 16777215 /* 0xFFFFFF */;
}
if ((GlobalData.sublevel == 3) && (GlobalData.subsublevel == 1)) {
_mc.previewMessage_mc.textVar = "DESTROY RAIN TO GET 20 NUGGETS!";
} else if ((GlobalData.sublevel == 1) && (GlobalData.subsublevel == 1)) {
_mc.previewMessage_mc.textVar = "START PLAY!\nA - JUMP,\nS - FIRE,\nARROW KEYS - MOVE";
} else if ((GlobalData.sublevel == 3) && (GlobalData.subsublevel == 2)) {
_mc.previewMessage_mc.textVar = "GET TENBREAD BUT NOT OTHER THINGS!";
_mc.previewMessage_mc._y = _mc.previewMessage_mc._y + 120;
} else if ((GlobalData.sublevel == 4) && (GlobalData.subsublevel == 1)) {
_mc.previewMessage_mc.textVar = "PROTECT 1-UP!\nA - JUMP,\nS - POUND,\nARROW KEYS - MOVE";
} else if ((GlobalData.sublevel == 9) && (GlobalData.subsublevel == 1)) {
_mc.previewMessage_mc.textVar = "S - SHOOT\nA - SHIELD";
}
}
}
Symbol 1176 MovieClip [__Packages.Powerup] Frame 0
class Powerup extends StageObject
{
var classType, _mc, dontRespawn, subType;
function Powerup (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Powerup" + typeNum, depth);
classType = "Powerup";
var thisPowerup = this;
collected = false;
trace((("Powerup(): " + _mc._name) + ", Powerup parent = ") + _mc._parent);
_mc.onEnterFrame = function () {
thisPowerup.update();
};
}
function clearFromObjectsArray() {
}
function update() {
if ((!collected) && (_mc.hitTest(StinkoGame.player1._mc.hitTestHurt_mc))) {
_mc.gotoAndPlay("collect");
dontRespawn = true;
collected = true;
if (subType == 0) {
GlobalData.fillHits();
} else if (subType == 1) {
GlobalData.extraMan();
} else if (subType == 2) {
GlobalData.getShield();
}
delete _mc.onEnterFrame;
}
}
var collected = false;
}
Symbol 1177 MovieClip [__Packages.SwitchedWall] Frame 0
class SwitchedWall extends StageObject
{
static var SwitchedWallArray;
var classType, _mc, switchCode, startPosition;
function SwitchedWall (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "SwitchedWall" + typeNum, depth);
if (SwitchedWallArray == undefined) {
SwitchedWallArray = new Array();
}
classType = "SwitchedWall";
var _local3 = this;
trace((("SwitchedWall(): " + _mc._name) + ", SwitchedWall parent = ") + _mc._parent);
SwitchedWallArray.push(this);
_mc.animator_mc.stop();
_mc.mType = "vert";
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < SwitchedWallArray.length) {
if (this == SwitchedWallArray[_local2]) {
SwitchedWallArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < SwitchedWallArray.length) {
if (test_mc.hitTest(SwitchedWallArray[_local1]._mc)) {
return(SwitchedWallArray[_local1]._mc);
}
_local1++;
}
return(undefined);
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.switchCode = switchCode;
_local2.startPosition = startPosition;
return(_local2);
}
}
Symbol 1178 MovieClip [__Packages.Switch] Frame 0
class Switch extends StageObject
{
static var SwitchArray;
var classType, _mc, switchCode;
function Switch (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Switch" + typeNum, depth);
var _local4 = this;
if (SwitchArray == undefined) {
SwitchArray = new Array();
}
classType = "Switch";
trace((("Switch(): " + _mc._name) + ", Switch parent = ") + _mc._parent);
switchCode = Number(initObj.switchCode);
if ((switchCode == undefined) || (isNaN(switchCode))) {
switchCode = 0;
}
SwitchArray.push(this);
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < SwitchArray.length) {
if (this == SwitchArray[_local2]) {
SwitchArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < SwitchArray.length) {
if (test_mc.hitTest(SwitchArray[_local1]._mc)) {
return(SwitchArray[_local1]);
}
_local1++;
}
return(undefined);
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.switchCode = switchCode;
return(_local2);
}
function activate() {
trace("Switch::switchActive() called");
_mc.gotoAndPlay("on");
MoveablePlatform.affectAll(switchCode);
}
function update() {
trace(("Switch::update()" + _mc._name) + switchCode);
}
var DIR_CHANGE_TIMING = 72;
}
Symbol 1179 MovieClip [__Packages.LavaFall] Frame 0
class LavaFall extends StageObject
{
static var LavaFallArray;
var classType, blocked, _mc, originalSplashHeight, originalMaskHeight;
function LavaFall (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "LavaFall" + typeNum, depth);
if (LavaFallArray == undefined) {
LavaFallArray = new Array();
}
classType = "LavaFall";
blocked = false;
var _local4 = this;
trace((("LavaFall(): " + _mc._name) + ", LavaFall parent = ") + _mc._parent);
LavaFallArray.push(this);
originalSplashHeight = _mc.lavaFallBlocker_mc._y;
originalMaskHeight = _mc.fallMask_mc._height;
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < LavaFallArray.length) {
if (this == LavaFallArray[_local2]) {
LavaFallArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < LavaFallArray.length) {
if (test_mc.hitTest(LavaFallArray[_local1]._mc.hitTest_mc)) {
return(LavaFallArray[_local1]);
}
_local1++;
}
return(undefined);
}
static function noneAreBlocked() {
var _local1 = 0;
while (_local1 < LavaFallArray.length) {
LavaFallArray[_local1].unblock();
LavaFallArray[_local1].testForPlatformBlock();
_local1++;
}
}
function testForPlatformBlock() {
var _local2 = MoveablePlatform.hit(_mc.hitTest_mc);
if (_local2 != undefined) {
block(_local2._y + 75);
}
}
static function hitToHurt(test_mc) {
var _local2 = new Array();
var _local1 = 0;
while (_local1 < LavaFallArray.length) {
if (test_mc.hitTest(LavaFallArray[_local1]._mc.fallMask_mc)) {
_local2.push(LavaFallArray[_local1]);
}
_local1++;
}
return(_local2);
}
function getAdditonalAttributes() {
var _local1 = new Object();
return(_local1);
}
function block(heightToBlock) {
trace("LavaFall::block():heightToBlock = " + heightToBlock);
blocked = true;
_mc.lavaFallBlocker_mc._y = heightToBlock - 75;
_mc.fallMask_mc._height = heightToBlock - 36;
}
function unblock(heightToBlock) {
blocked = false;
_mc.lavaFallBlocker_mc._y = originalSplashHeight;
_mc.fallMask_mc._height = originalMaskHeight;
}
}
Symbol 1180 MovieClip [__Packages.WarpPad] Frame 0
class WarpPad extends StageObject
{
var classType, off_x, off_y, _mc;
function WarpPad (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "WarpPad" + typeNum, depth);
classType = "WarpPad";
var thisWarpPad = this;
if (initObj.off_x == undefined) {
off_x = 100;
} else {
off_x = Number(initObj.off_x);
}
if (initObj.off_y == undefined) {
off_y = 0;
} else {
off_y = Number(initObj.off_y);
}
if (!LevelEditor.editorActive) {
_mc.onEnterFrame = function () {
thisWarpPad.update();
};
_mc.targetGuide_mc._visible = false;
}
moveYRangeGuideTo(off_y);
moveRangeGuideTo(off_x);
trace(("WarpPad::instantiated " + off_x) + off_y);
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.off_x = off_x;
_local2.off_y = off_y;
return(_local2);
}
function activate() {
}
function update() {
if (_mc.warpTrigger_mc.hitTest(StinkoGame.player1._mc.hitTestWalk_mc)) {
var _local4 = StinkoGame.getGlobalCoord(_mc);
_local4.x = _local4.x + (_mc.warpTrigger_mc._width / 2);
var _local5 = new Object({x:StinkoGame.player1._mc._x, y:StinkoGame.player1._mc._y});
var _local3 = new Object();
_local3.x = (_local4.x - _local5.x) + off_x;
_local3.y = (_local4.y - _local5.y) + off_y;
if ((GlobalData.subsublevel == 3) && (GlobalData.sublevel == 8)) {
StinkoGame.player1._mc._x = StinkoGame.player1._mc._x + off_x;
StinkoGame.player1._mc._y = StinkoGame.player1._mc._y + off_y;
} else {
StinkoGame.player1.move(_local3.x, _local3.y);
}
StinkoGame.player1.stopMovement();
var _local7 = new CameraEffectFlash(_root, 1, 3);
}
}
function moveYRangeGuideTo(newVal) {
trace("moveYRangeGuideTo()" + newVal);
off_y = newVal;
_mc.targetGuide_mc._y = off_y;
}
function moveRangeGuideTo(newVal) {
trace("moveRangeGuideTo()" + newVal);
off_x = newVal;
_mc.targetGuide_mc._x = off_x;
}
function get rRange() {
return(off_x);
}
function get tRange() {
return(off_y);
}
}
Symbol 1181 MovieClip [__Packages.CameraEffect] Frame 0
class CameraEffect
{
var _mc;
function CameraEffect (p_mc) {
var thisCameraEffect = this;
_mc = p_mc;
_mc.onEnterFrame = function () {
thisCameraEffect.update();
};
}
function update() {
}
}
Symbol 1182 MovieClip [__Packages.CameraEffectFlash] Frame 0
class CameraEffectFlash extends CameraEffect
{
var originalClipX, originalClipY, _mc, ticker, flashLength, flashesLeft;
function CameraEffectFlash (p_mc, pTotalFlashes, pFlashLength) {
super(p_mc);
originalClipX = 0;
originalClipY = 0;
_mc.attachMovie("cameraFlash_mc", "flash_mc", 1);
ticker = pFlashLength;
flashLength = pFlashLength;
flashesLeft = pTotalFlashes;
flash();
}
function update() {
ticker--;
if (ticker <= 0) {
flash();
} else {
_mc.flash_mc._alpha = 100 - (100 * (ticker / flashLength));
}
}
function flash() {
flashesLeft--;
if (flashesLeft < 0) {
_mc.flash_mc.removeMovieClip();
delete _mc.onEnterFrame;
} else {
_mc.flash_mc._alpha = 100;
ticker = flashLength;
}
}
}
Symbol 1183 MovieClip [__Packages.ShooterSpeedTrigger] Frame 0
class ShooterSpeedTrigger extends StageObject
{
var classType, _mc, newXSpeed, newYSpeed;
function ShooterSpeedTrigger (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "Goal" + typeNum, depth);
classType = "ShooterSpeedTrigger";
var thisShooterSpeedTrigger = this;
trace((("ShooterSpeedTrigger(): " + _mc._name) + ", Goal parent = ") + _mc._parent);
_mc.onEnterFrame = function () {
thisShooterSpeedTrigger.update();
};
if (initObj.newXSpeed == undefined) {
newXSpeed = 1;
} else {
newXSpeed = initObj.newXSpeed;
}
if (initObj.newYSpeed == undefined) {
newYSpeed = 0;
} else {
newYSpeed = initObj.newYSpeed;
}
if (!LevelEditor.editorActive) {
_mc._visible = false;
}
}
function clearFromObjectsArray() {
}
function update() {
if (StinkoGame.inProgress && (_mc.hitTest(StinkoGame.player1._mc))) {
trace((((("ShooterSpeedTrigger::update() -> telling ShootingGame to change speed " + _mc._name) + ",") + newXSpeed) + ",") + newYSpeed);
ShootingGame.setNewAutoscroll(newXSpeed, newYSpeed);
return(undefined);
}
}
function getAdditonalAttributes() {
var _local2 = new Object();
_local2.newXSpeed = newXSpeed;
_local2.newYSpeed = newYSpeed;
return(_local2);
}
}
Symbol 1184 MovieClip [__Packages.ShooterObstacle] Frame 0
class ShooterObstacle extends StageObject
{
static var ShooterObstacleArray;
var classType, _mc;
function ShooterObstacle (parent_mc, x, y, typeNum, depth, initObj) {
super(parent_mc, x, y, typeNum, "ShooterObstacle" + typeNum, depth);
if (ShooterObstacleArray == undefined) {
ShooterObstacleArray = new Array();
}
classType = "ShooterObstacle";
var _local3 = this;
trace((("ShooterObstacle(): " + _mc._name) + ", ShooterObstacle parent = ") + _mc._parent);
ShooterObstacleArray.push(this);
_mc.animator_mc.stop();
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < ShooterObstacleArray.length) {
if (this == ShooterObstacleArray[_local2]) {
ShooterObstacleArray.splice(_local2, 1);
break;
}
_local2++;
}
}
static function hit(test_mc) {
var _local1 = 0;
while (_local1 < ShooterObstacleArray.length) {
if (test_mc.hitTest(ShooterObstacleArray[_local1]._mc.hitTest1_mc) || (test_mc.hitTest(ShooterObstacleArray[_local1]._mc.hitTest2_mc))) {
return(ShooterObstacleArray[_local1]._mc);
}
_local1++;
}
return(undefined);
}
static function unpause() {
var _local1 = 0;
while (_local1 < ShooterObstacleArray.length) {
ShooterObstacleArray[_local1]._mc.animator_mc.play();
_local1++;
}
}
static function anyHitPoint(test_mc) {
var _local1 = 0;
while (_local1 < ShooterObstacleArray.length) {
if (ShooterObstacleArray[_local1]._mc.hitTest1_mc.hitTest(test_mc) || (ShooterObstacleArray[_local1]._mc.hitTest2_mc.hitTest(test_mc))) {
trace("ShooterObstacle::anyHitPoint(): returned true");
return(true);
}
_local1++;
}
return(false);
}
}
Symbol 1185 MovieClip [__Packages.PropertyInspector] Frame 0
class PropertyInspector
{
static var _mc, currentObj;
function PropertyInspector (p_mc) {
var _local2 = this;
_mc = p_mc;
}
static function activate(obj) {
_mc.gotoAndPlay("off");
if (obj.classType != "Enemy") {
_mc.gotoAndPlay(obj.classType);
} else {
_mc.gotoAndPlay(obj.classType + obj.subType);
}
trace(((("PropertyInspector.activate(): obj.classType = " + obj.classType) + obj.subType) + ", obj.velX = ") + obj.velX);
currentObj = obj;
}
static function disable() {
_mc.gotoAndStop("off");
}
static function initialize(classname) {
switch (currentObj.classType) {
case "MoveablePlatform" :
initSwitchCodeStepper();
initMoveablePlatformInputs();
break;
case "SwitchedWall" :
initSwitchCodeStepper();
break;
case "Switch" :
initSwitchCodeStepper();
break;
case "XMovingPlatform" :
initRightRangeGuideStepper();
break;
case "YMovingPlatform" :
initUpperRangeGuideStepper();
break;
case "WarpPad" :
initRightRangeGuideStepper();
initUpperRangeGuideStepper();
break;
case "ShooterSpeedTrigger" :
initShooterSteppers();
break;
case "Enemy" :
if (currentObj.subType == 5) {
trace("initializing EnemyBouncechick property inspector");
var _local1 = 0;
while (_local1 < _mc.jumpingDir.length) {
trace(((((("i = " + _local1) + ",") + _mc.jumpingDir.getItemAt(_local1).value) + ",") + _mc.jumpingDir.getItemAt(_local1)) + _mc.jumpingDir.getItemAt(_local1).data);
if (_mc.jumpingDir.getItemAt(_local1).data == currentObj.jumpingDir) {
_mc.jumpingDir.selectedIndex = _local1;
break;
}
_local1++;
}
var _local2 = new Object();
_local2.change = function (eventObj) {
trace((("EnemyBouncechick dirListener event: before" + eventObj.target.value) + ",") + PropertyInspector.currentObj.jumpingDir);
PropertyInspector.currentObj.jumpingDir = eventObj.target.value;
trace((("EnemyBouncechick dirListener event: after" + eventObj.target.value) + ",") + PropertyInspector.currentObj.jumpingDir);
};
_mc.jumpingDir.addEventListener("change", _local2);
} else if (((((((((currentObj.subType == 2) || (currentObj.subType == 8)) || (currentObj.subType == 6)) || (currentObj.subType == 12)) || (currentObj.subType == 13)) || (currentObj.subType == 15)) || (currentObj.subType == 16)) || (currentObj.subType == 21)) || (currentObj.subType == 24)) {
initFacingDirDropdown();
} else if (((currentObj.subType == 7) || (currentObj.subType == 11)) || (currentObj.subType == 22)) {
initRightRangeGuideStepper();
} else if ((((currentObj.subType == 29) || (currentObj.subType == 30)) || (currentObj.subType == 31)) || (currentObj.subType == 32)) {
initShooterEnemySteppers();
} else if ((currentObj.subType == 33) || (currentObj.subType == 34)) {
initShooterEnemySteppers();
}
if (currentObj.subType != 12) {
break;
}
initStepper(_mc.shotsStepper, "shotsToFire");
}
}
static function initRightRangeGuideStepper() {
_mc.rangeGuideStepper.value = currentObj.rRange;
var _local1 = new Object();
_local1.change = function (eventObj) {
trace("rangeGuideStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.moveRangeGuideTo(eventObj.target.value);
};
_mc.rangeGuideStepper.addEventListener("change", _local1);
}
static function initUpperRangeGuideStepper() {
_mc.rangeGuideStepperY.value = currentObj.tRange;
var _local1 = new Object();
_local1.change = function (eventObj) {
trace("rangeGuideStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.moveYRangeGuideTo(eventObj.target.value);
};
_mc.rangeGuideStepperY.addEventListener("change", _local1);
}
static function initSwitchCodeStepper() {
_mc.switchCodeStepper.value = currentObj.switchCode;
var _local1 = new Object();
_local1.change = function (eventObj) {
trace("rangeGuideStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.switchCode = eventObj.target.value;
};
_mc.switchCodeStepper.addEventListener("change", _local1);
}
static function initMoveablePlatformInputs() {
_mc.startStepper.value = currentObj.start;
var _local3 = new Object();
_local3.change = function (eventObj) {
trace("startStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.updateStartPos(eventObj.target.value);
};
_mc.startStepper.addEventListener("change", _local3);
_mc.startStepper.maximum = currentObj.range;
if (_mc.startStepper.value > currentObj.range) {
_mc.startStepper.value = currentObj.range;
}
_mc.rangeStepper.value = currentObj.range;
var _local2 = new Object();
_local2.change = function (eventObj) {
trace("rangeStepperListener event: " + eventObj.target.value);
PropertyInspector.currentObj.updateRangeLife(eventObj.target.value);
eventObj.target._parent.startStepper.maximum = eventObj.target.value;
if (eventObj.target._parent.startStepper.value > eventObj.target.value) {
eventObj.target._parent.startStepper.value = eventObj.target.value;
PropertyInspector.currentObj.updateStartPos(eventObj.target.value);
}
};
_mc.rangeStepper.addEventListener("change", _local2);
_mc.forwardCheckbox.selected = currentObj.dir == 1;
var _local5 = new Object();
_local5.click = function (eventObj) {
trace((("PropertyInspector::direction value changed " + eventObj.target.selected) + ",") + PropertyInspector.currentObj.dir);
if (eventObj.target.selected) {
PropertyInspector.currentObj.dir = 1;
} else {
PropertyInspector.currentObj.dir = -1;
}
PropertyInspector.currentObj.updateArrowDir();
};
_mc.forwardCheckbox.addEventListener("click", _local5);
var _local1 = 0;
while (_local1 < _mc.axis.length) {
if (_mc.axis.getItemAt(_local1).data == currentObj.axis) {
_mc.axis.selectedIndex = _local1;
break;
}
_local1++;
}
var _local4 = new Object();
_local4.change = function (eventObj) {
trace((("axisListener event: before" + eventObj.target.value) + ",") + PropertyInspector.currentObj.axis);
PropertyInspector.currentObj.resetAxis(eventObj.target.value);
trace((("axisListener event: after" + eventObj.target.value) + ",") + PropertyInspector.currentObj.axis);
};
_mc.axis.addEventListener("change", _local4);
}
static function initFacingDirDropdown() {
trace("initializing facingDir dropdown property inspector");
var _local1 = 0;
while (_local1 < _mc.facingDir.length) {
if (_mc.facingDir.getItemAt(_local1).data == currentObj.facingDir) {
_mc.facingDir.selectedIndex = _local1;
break;
}
_local1++;
}
var _local2 = new Object();
_local2.change = function (eventObj) {
trace((("dirListener event: before" + eventObj.target.value) + ",") + PropertyInspector.currentObj.facingDir);
PropertyInspector.currentObj.facingDir = eventObj.target.value;
PropertyInspector.currentObj.applyFacingDir();
trace((("dirListener event: after" + eventObj.target.value) + ",") + PropertyInspector.currentObj.facingDir);
};
_mc.facingDir.addEventListener("change", _local2);
}
static function initShooterSteppers() {
_mc.xStepper.value = currentObj.newXSpeed;
var _local2 = new Object();
_local2.change = function (eventObj) {
trace("shotsStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.newXSpeed = eventObj.target.value;
};
_mc.xStepper.addEventListener("change", _local2);
_mc.yStepper.value = currentObj.newYSpeed;
var _local1 = new Object();
_local1.change = function (eventObj) {
trace("shotsStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.newYSpeed = eventObj.target.value;
};
_mc.yStepper.addEventListener("change", _local1);
}
static function initShooterEnemySteppers() {
_mc.xStepper.value = currentObj.velX;
var _local2 = new Object();
_local2.change = function (eventObj) {
trace("shotsStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.velX = eventObj.target.value;
};
_mc.xStepper.addEventListener("change", _local2);
_mc.yStepper.value = currentObj.velY;
var _local1 = new Object();
_local1.change = function (eventObj) {
trace("shotsStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.velY = eventObj.target.value;
};
_mc.yStepper.addEventListener("change", _local1);
}
static function initShotsStepper() {
_mc.switchCodeStepper.value = currentObj.switchCode;
var _local1 = new Object();
_local1.change = function (eventObj) {
trace("shotsStepper event: " + eventObj.target.value);
PropertyInspector.currentObj.switchCode = eventObj.target.value;
};
_mc.switchCodeStepper.addEventListener("change", _local1);
}
static function initStepper(stepperComponent, paramName) {
trace((((("initStepper(" + stepperComponent._name) + ",paramName= ") + paramName) + ", currentObj[paramName] = ") + currentObj[paramName]);
stepperComponent.value = currentObj[paramName];
var _local1 = new Object();
_local1.change = function (eventObj) {
PropertyInspector.currentObj.paramName = Number(eventObj.target.value);
trace((((("stepper event: " + eventObj.target.value) + ",paramName= ") + paramName) + ", new value = ") + PropertyInspector.currentObj.paramName);
};
stepperComponent.addEventListener("change", _local1);
}
}
Symbol 1186 MovieClip [__Packages.CameraEffectPan] Frame 0
class CameraEffectPan extends CameraEffect
{
var targetX, targetY, updateSpeed, callback, _mc;
function CameraEffectPan (p_mc, pTargetX, pTargetY, pUpdateSpeed, pCallback) {
super(p_mc);
targetX = pTargetX;
targetY = pTargetY;
updateSpeed = pUpdateSpeed;
callback = pCallback;
}
function update() {
var _local3 = (StinkoGame.viewBox.r - StinkoGame.viewBox.l) / 2;
var _local4 = _mc._x + StinkoGame._mc.gameStage_mc._x;
var _local2 = false;
if (_local4 < (_local3 - updateSpeed)) {
_local2 = StinkoGame.nudge(updateSpeed, 0);
if (_local2) {
StinkoGame.player1._mc._x = StinkoGame.player1._mc._x + updateSpeed;
}
} else if (_local4 > (_local3 + updateSpeed)) {
_local2 = StinkoGame.nudge(-updateSpeed, 0);
if (_local2) {
StinkoGame.player1._mc._x = StinkoGame.player1._mc._x - updateSpeed;
}
}
if (!_local2) {
kill();
}
}
function kill() {
callback();
delete _mc.onEnterFrame;
}
}
Symbol 1187 MovieClip [__Packages.SeamlessScroll] Frame 0
class SeamlessScroll
{
var libraryName, vert, horiz, overlap, vel, updateCounterX, updateCounterY, defaultVel, parentClip, viewBox, depthCounter, panelClips, clipWidth, NumberClipsHigh, NumberClipsWide;
function SeamlessScroll (libraryName, targetClip, vert, horiz, overlap, defaultVel, viewBox) {
var _local17 = this;
this.libraryName = libraryName;
this.vert = vert;
this.horiz = horiz;
this.overlap = overlap;
vel = new Object();
applyDefaultVelocity();
updateCounterX = 0;
updateCounterY = 0;
this.defaultVel = defaultVel;
parentClip = targetClip;
if (viewBox == undefined) {
viewBox = new Object({l:0, r:_root._width, t:0, b:_root._height});
}
this.viewBox = viewBox;
depthCounter = 0;
panelClips = new Array();
var _local9 = parentClip.attachMovie(libraryName, "clp" + depthCounter, depthCounter++);
clipWidth = Math.floor(_local9._width);
var _local11 = (vert ? 1 : 0);
NumberClipsHigh = Math.ceil((viewBox.b - viewBox.t) / (_local9._height - overlap)) + _local11;
var _local10 = (horiz ? 1 : 0);
trace("SeamlessScroll::NumberClipsHigh = " + NumberClipsHigh);
NumberClipsWide = Math.ceil((viewBox.r - viewBox.l) / (clipWidth - overlap)) + _local10;
if (_local9._name == undefined) {
trace((("Warning: Seamless scroll was unable to attach a movie clip called " + libraryName) + " to ") + targetClip._name);
return;
}
_local9.removeMovieClip();
trace((("SeamlessScroll: NumberClipsHigh = " + NumberClipsHigh) + ", NumberClipsWide = ") + NumberClipsWide);
var _local5 = 0;
while (_local5 < NumberClipsHigh) {
var _local4 = 0;
while (_local4 < NumberClipsWide) {
var _local3 = parentClip.attachMovie(libraryName, "clp" + depthCounter, depthCounter++);
_local3._y = Math.ceil(viewBox.t + (_local5 * (_local3._height - overlap)));
_local3._x = Math.ceil(viewBox.l + (_local4 * (clipWidth - overlap)));
panelClips.push(_local3);
_local4++;
}
_local5++;
}
}
function update() {
var _local2 = 0;
while (_local2 < panelClips.length) {
if (panelClips[_local2]._x > viewBox.r) {
panelClips[_local2]._x = Math.ceil(findLeftmost()._x - (clipWidth - overlap));
}
if ((panelClips[_local2]._x + clipWidth) < viewBox.l) {
panelClips[_local2]._x = Math.ceil(findRightmost()._x + (clipWidth - overlap));
}
_local2++;
}
}
function remove() {
for (var _local2 in panelClips) {
panelClips[_local2].removeMovieClip();
}
delete parentClip.onEnterFrame;
}
function setVelocity(x, y) {
vel.x = x;
vel.y = y;
}
function applyDefaultVelocity() {
for (var _local2 in defaultVel) {
vel[_local2] = defaultVel[_local2];
}
}
function getVelocity() {
return(vel);
}
function findLeftmost() {
var _local4 = 0;
var _local3 = panelClips[0]._x;
var _local2 = 1;
while (_local2 < panelClips.length) {
if (panelClips[_local2]._x < _local3) {
_local3 = panelClips[_local2]._x;
_local4 = _local2;
}
_local2++;
}
return(panelClips[_local4]);
}
function findRightmost() {
var _local4 = 0;
var _local3 = panelClips[0]._x;
var _local2 = 1;
while (_local2 < panelClips.length) {
if (panelClips[_local2]._x > _local3) {
_local3 = panelClips[_local2]._x;
_local4 = _local2;
}
_local2++;
}
return(panelClips[_local4]);
}
function nudge(x, y) {
if (horiz && (x != 0)) {
var _local2 = 0;
while (_local2 < panelClips.length) {
panelClips[_local2]._x = Math.ceil(panelClips[_local2]._x + x);
panelClips[_local2].nextFrame();
_local2++;
}
}
update();
}
}
Symbol 1188 MovieClip [__Packages.StinkomanXMLData] Frame 0
class StinkomanXMLData
{
static var dataFilesLeft, XMLArray;
function StinkomanXMLData () {
}
static function load() {
trace("StinkomanXMLData : Load called");
dataFilesLeft = 14;
XMLArray = new Array();
var _local1 = 0;
while (_local1 <= GlobalData.maxSublevel) {
XMLArray[_local1] = new Array();
_local1++;
}
makeNewXML(1, 1);
makeNewXML(1, 2);
makeNewXML(2, 1);
makeNewXML(2, 2);
makeNewXML(3, 3);
makeNewXML(4, 1);
makeNewXML(4, 2);
makeNewXML(4, 3);
makeNewXML(5, 1);
makeNewXML(5, 2);
makeNewXML(5, 3);
makeNewXML(6, 1);
makeNewXML(6, 2);
makeNewXML(6, 3);
makeNewXML(7, 1);
makeNewXML(7, 2);
makeNewXML(7, 3);
makeNewXML(8, 1);
makeNewXML(8, 2);
makeNewXML(8, 3);
makeNewXML(9, 1);
makeNewXML(9, 2);
makeNewXML(9, 3);
}
static function makeNewXML(sub, subsub) {
XMLArray[sub][subsub] = new XML();
XMLArray[sub][subsub].ignoreWhite = true;
XMLArray[sub][subsub].load(((("levelData/level1." + sub) + ".") + subsub) + ".xml");
XMLArray[sub][subsub].onLoad = function () {
StinkomanXMLData.dataFilesLeft--;
};
}
static function allLoaded() {
if (dataFilesLeft <= 0) {
return(true);
}
return(false);
}
static function getXML(sub, subsub) {
if (GlobalData.testMode) {
return(new XML(LocalData.load("stinkomanLevel", "lDataXML", "/").toString()));
}
return(XMLArray[sub][subsub]);
}
}
Symbol 1189 MovieClip [__Packages.BulletFriendly] Frame 0
class BulletFriendly extends Bullet
{
static var shootSound;
var startingY, _mc, xVel, deflect, clearFromObjectsArray;
function BulletFriendly (symbolName, start_x, start_y, pxVel, pyVel, pGrav) {
super(symbolName, start_x, start_y, pxVel, pyVel, true, pGrav);
onScreenCounter++;
if (onScreenCounter > GlobalData.getMaxBulletsOnScreen()) {
kill();
}
startingY = start_y;
if (shootSound == undefined) {
shootSound = new Sound(_root);
shootSound.attachSound("stinko_maybeshoot.wav");
}
shootSound.start();
}
function subClassUpdate() {
if (_mc._y > (startingY + 20)) {
kill();
}
}
static function anyDeflect(test_mc) {
var _local1 = 0;
while (_local1 < Bullet.bulletArray.length) {
if ((Bullet.bulletArray[_local1].friendly && (Bullet.bulletArray[_local1].active)) && (Bullet.bulletArray[_local1]._mc.hitTest(test_mc))) {
return(Bullet.bulletArray[_local1]);
}
_local1++;
}
return(undefined);
}
function testForHits() {
var _local3 = Enemy.anyHurtByPlayerTest(_mc);
var _local4;
var _local2 = 0;
while (_local2 < _local3.length) {
if (xVel > 0) {
_local4 = 1;
} else {
_local4 = -1;
}
_local2++;
}
if (_local3.length > 0) {
_local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].vulnerable) {
_local3[_local2].takeDamage(_local4, -1);
avalancheMakeHomestarHappy();
kill();
} else {
deflect();
}
_local2++;
}
}
if (GlobalData.bossLevel()) {
if (StinkoGame.bossMan.hurtByPlayerTest(_mc)) {
StinkoGame.bossMan.takeDamage(0, 0);
kill();
}
}
}
function avalancheMakeHomestarHappy() {
}
function kill() {
clearFromObjectsArray();
onScreenCounter--;
_mc.removeMovieClip();
}
static var onScreenCounter = 0;
}
Symbol 1190 MovieClip [__Packages.Player] Frame 0
class Player
{
var _mc, startingPos, incrSpeed, climbVelocity, maxSpeed, gravity, facingDir, enabled, jumpDeceleration, deceleration, defaultDeceleration, jumpHeight, defaultJumpHeight, xVel, yVel, jumping, punching, jumpButtonDown, climbing, bulletDelayCounter, soundMaker, isFrozen, boredCounter, bored, invincibleCounter, hitRecoverCounter;
function Player (p_mc) {
var thisPlayer = this;
_mc = p_mc;
startingPos = new Object();
incrSpeed = 5;
climbVelocity = 3;
maxSpeed = new Object();
maxSpeed.x = 5;
maxSpeed.y = 10;
gravity = 3;
facingDir = "right";
enabled = true;
jumpDeceleration = 0.8;
deceleration = (defaultDeceleration = 0.4);
jumpHeight = (defaultJumpHeight = 20);
xVel = (yVel = 0);
jumping = false;
punching = false;
jumpButtonDown = false;
climbing = false;
bulletDelayCounter = 0;
soundMaker = new Sound(_mc);
isFrozen = false;
trace("Player(): attempting to set _mc._x to StinkoGame.ld.levelProperties.playerStartX = " + StinkoGame.ld.levelProperties.playerStartX);
_mc._x = StinkoGame.ld.levelProperties.playerStartX;
_mc._y = StinkoGame.ld.levelProperties.playerStartY;
trace("Player(): attempted to set _mc._x to StinkoGame.ld.levelProperties.playerStartX = " + _mc._x);
boredCounter = 0;
bored = false;
_mc.onEnterFrame = function () {
thisPlayer.update();
};
}
function newMan() {
}
function newGame() {
}
function reset() {
var thisPlayer = this;
_mc.onEnterFrame = function () {
thisPlayer.update();
};
facingDir = "right";
enabled = true;
invincibleCounter = 0;
hitRecoverCounter = 0;
GlobalData.hits = 4;
StinkoGame.jumpToOrigin();
_mc._x = StinkoGame.ld.levelProperties.playerStartX;
_mc._y = StinkoGame.ld.levelProperties.playerStartY;
StinkoGame.inProgress = true;
deceleration = defaultDeceleration;
jumpHeight = defaultJumpHeight;
xVel = (yVel = 0);
jumping = false;
climbing = false;
jumpButtonDown = false;
_mc.animator_mc.stop();
Interface.update();
bored = false;
boredCounter = 0;
}
function moveRight() {
facingDir = "right";
if (climbing) {
return(undefined);
}
_mc.animator_mc.play();
xVel = xVel + incrSpeed;
if (xVel > maxSpeed.x) {
xVel = maxSpeed.x;
}
}
function moveLeft() {
facingDir = "left";
if (climbing) {
return(undefined);
}
_mc.animator_mc.play();
xVel = xVel - incrSpeed;
if (xVel < (-maxSpeed.x)) {
xVel = -maxSpeed.x;
}
}
function climbUp() {
if (punching) {
return(undefined);
}
var _local3 = Ladder.hit(_mc.hitTestHurt_mc);
var _local2 = Ladder.hit(_mc.hitTestLadderTop_mc);
if (_local2 == undefined) {
if ((_local3 != undefined) && (climbing)) {
jumping = true;
yVel = (-climbVelocity) - 12;
xVel = 0;
}
climbing = false;
return(undefined);
}
if (_local3 != undefined) {
climbing = true;
jumping = false;
moveTo(StinkoGame.getGlobalCoord(_local2._mc).x + (_local2._mc._width / 2), null);
xVel = 0;
yVel = -climbVelocity;
} else {
climbing = false;
}
}
function climbDown() {
if (punching) {
return(undefined);
}
var _local3 = Ladder.hit(_mc.hitTestHurt_mc);
var _local2 = Ladder.hit(_mc.hitTestLadderBottom_mc);
trace((("climbDown()" + _local3._mc._name) + ",") + _local2._mc._name);
if (_local2 != undefined) {
if (_local3 != undefined) {
yVel = climbVelocity;
} else {
trace("Trying to lower stinkoman onto the ladder");
moveTo(null, StinkoGame.getGlobalCoord(_local2._mc).y + 25);
}
climbing = true;
moveTo(StinkoGame.getGlobalCoord(_local2._mc).x + (_local2._mc._width / 2), null);
xVel = 0;
} else {
climbing = false;
}
}
function jump() {
soundMaker.attachSound("stinko_maybejump2.wav");
soundMaker.start();
jumpButtonDown = true;
jumping = true;
if (!climbing) {
yVel = yVel - jumpHeight;
}
climbing = false;
}
function punch() {
if (climbing) {
_mc.gotoAndStop("climbpunch_" + facingDir);
} else if (jumping) {
_mc.gotoAndStop("jumppunch_" + facingDir);
} else if (Math.abs(xVel) > 1) {
_mc.gotoAndStop("runpunch_" + facingDir);
} else {
_mc.gotoAndStop("punch_" + facingDir);
}
_mc.animator_mc.play();
punching = true;
testForPunchHit();
bulletDelayCounter--;
if (bulletDelayCounter < 0) {
bulletDelayCounter = BULLET_DELAY;
var _local3 = 10;
var _local4 = StinkoGame.getPlayerGlobal();
var _local2 = _local4.x + _mc.wave_mc._x;
var _local5 = (_local4.y + _mc.wave_mc._y) - 6;
if (facingDir == "right") {
_local2 = _local2 + 30;
_local3 = 10;
} else {
_local2 = _local2 - 15;
_local3 = -10;
}
var _local6 = new BulletFriendly("Bullet1", _local2, _local5, _local3, 0.2);
}
}
function update() {
if (enabled) {
updateCounters();
if (jumping) {
xVel = xVel * jumpDeceleration;
} else {
xVel = xVel * deceleration;
}
if (((xVel < 0.1) && (xVel > 0)) || ((xVel > -0.1) && (xVel < 0))) {
xVel = 0;
}
if ((((hitRecoverCounter <= 0) && (!punching)) && (!climbing)) && (!bored)) {
if (!jumping) {
_mc.gotoAndStop("run_" + facingDir);
} else if (Math.abs(xVel) > 1) {
_mc.gotoAndStop("spin_" + facingDir);
} else {
_mc.gotoAndStop("jump_" + facingDir);
}
}
acceptPlayerInput();
testForPlayerHurt();
if (!climbing) {
if (yVel < maxSpeed.y) {
yVel = yVel + gravity;
}
}
move(xVel, 0);
var _local4 = Obstacle.hit(_mc.hitTestHurt_mc);
if (_local4 == undefined) {
_local4 = EnemyBiztar.hit(_mc.hitTestHurt_mc);
}
if (_local4 != undefined) {
move(-xVel, 0);
}
var _local8 = Wall.hit(_mc.hitTestHurt_mc);
if (_local8 != undefined) {
move(-xVel, 0);
}
move(0, yVel);
if ((!climbing) || (yVel > 0)) {
var _local3 = Platform.hit(_mc.hitTestWalk_mc);
var _local2 = YMovingPlatform.hit(_mc.hitTestWalk_mc);
if (_local2 == undefined) {
_local2 = XMovingPlatform.hit(_mc.hitTestWalk_mc);
}
var _local7;
if (_local3 != undefined) {
_local7 = new Object({x:_local3._x, y:_local3._y});
_local3._parent.localToGlobal(_local7);
}
var _local5 = new Object({x:_local2._mc._x, y:_local2._mc._y});
_local2._mc._parent.localToGlobal(_local5);
if (yVel > 0) {
if (_local3 != undefined) {
yVel = 0;
var _local6 = 0;
if (_local3.subtype == 42) {
_local6 = -3;
} else if ((_local3.subtype == 43) || (_local3.subtype == 54)) {
_local6 = 3;
}
move(_local6, _local7.y - _mc._y);
if (jumping) {
soundMaker.attachSound("stinko_land.wav");
soundMaker.start();
}
jumping = false;
climbing = false;
} else if (_local2 != undefined) {
if (_local2.classType == "YMovingPlatform") {
yVel = _local2.vel;
} else {
yVel = 0;
move(_local2.vel, 0);
}
move(0, _local5.y - _mc._y);
if (jumping) {
soundMaker.attachSound("stinko_land.wav");
soundMaker.start();
}
jumping = false;
} else {
if (!climbing) {
jumping = true;
}
if (_mc._y > 500) {
endLife();
}
}
} else {
_local4 = Obstacle.hit(_mc.hitTestHurt_mc);
if (_local4 == undefined) {
_local4 = EnemyBiztar.hit(_mc.hitTestHurt_mc);
}
if (_local4 != undefined) {
move(0, -yVel);
yVel = (-yVel) / 2;
}
if (_local2) {
if (_local2.classType == "YMovingPlatform") {
move(0, _local5.y - _mc._y);
yVel = _local2.vel;
jumping = false;
} else {
move(_local2.vel, 0);
}
}
}
if (Wall.hit(_mc.hitTestHurt_mc)) {
move(0, -yVel);
}
}
if (climbing) {
if (!punching) {
if (Ladder.hit(_mc.hitTestLadderTop_mc) == undefined) {
trace("Player::update(): ladder not found and climbing = true");
_mc.gotoAndStop("butt");
if (!Key.isDown(38)) {
climbing = false;
yVel = 2;
jumping = true;
_mc.gotoAndStop("jump_" + facingDir);
}
} else {
_mc.gotoAndStop("climb");
}
if (Math.abs(yVel) > 0) {
_mc.animator_mc.play();
} else {
_mc.animator_mc.stop();
}
}
if (!Ladder.hit(_mc)) {
climbing = false;
if (yVel > 0) {
}
}
yVel = 0;
} else if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (!jumping)) && (!punching)) && (hitRecoverCounter <= 0)) {
if (!bored) {
_mc.gotoAndStop("wait_" + facingDir);
}
}
if (_mc.hitTestLadderTop_mc == undefined) {
yVel = 0;
}
}
}
function endLife() {
StinkoGame.loseLife(false);
}
function testForPlayerHurt() {
if (invincibleCounter > 0) {
return(undefined);
}
if (isFrozen) {
return(undefined);
}
var _local2 = Enemy.anyPlayerDangerTest(_mc.hitTestHurt_mc);
if (_local2 == undefined) {
_local2 = Hazard.anyPlayerDangerTest(_mc.hitTestHurt_mc);
}
if (_local2 == undefined) {
_local2 = Trap.anyPlayerDangerTest(_mc.hitTestHurt_mc);
if ((_local2 != undefined) && (_local2.subType == 12)) {
getHitFrozen();
return(undefined);
}
}
if (_local2 == undefined) {
_local2 = Bullet.anyPlayerDangerTest(_mc.hitTestHurt_mc);
}
if (_local2 == undefined) {
_local2 = StinkoGame.bossMan.playerDangerTest(_mc.hitTestHurt_mc);
}
if (_local2 == undefined) {
return(undefined);
}
var _local3 = 1;
trace((((((((("testForPlayerHurt(): " + _local2.classType) + "->") + _local2._mc._x) + ",") + _local2._mc._width) + ",") + getStageCoords().x) + ",") + _mc._width);
trace((("testForPlayerHurt(): " + (_local2._mc._x + (_local2._mc._width / 2))) + ",") + (getStageCoords().x + (_mc._width / 2)));
if ((_local2.classType == "Enemy") && (_local2.subType == 21)) {
_local3 = 2;
}
if ((_local2.classType == "Hazard") && (_local2.subType < 4)) {
GlobalData.hits = 0;
}
if (_local2.classType == "Bullet") {
trace((("Player::testforPlayerHurt() hit by a bullet " + _local2._mc._x) + ",") + _mc._x);
takeDamage(_local2._mc._x < (_mc._x + (_mc._width / 2)));
} else if ((_local2._mc._x + (_local2._mc._width / 2)) > (getStageCoords().x + (_mc._width / 2))) {
takeDamage(true, _local3);
} else {
takeDamage(false, _local3);
}
}
function getHitFrozen() {
}
function testForPunchHit() {
var _local3 = Enemy.anyHurtByPlayerTest(_mc.wave_mc);
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4;
if (facingDir == "right") {
_local4 = 1;
} else {
_local4 = -1;
}
if (_local3[_local2].vulnerable || (_local3[_local2].vulnerable == undefined)) {
_local3[_local2].takeDamage(_local4, -1);
}
_local2++;
}
}
function takeDamage(fromRight, hitVal) {
trace(("takeDamage(" + fromRight) + ")");
if (isFrozen) {
_mc.animator_mc.gotoAndPlay("unFreeze");
invincibleCounter = 48;
return(undefined);
}
if (hitVal == undefined) {
hitVal = 1;
}
hitRecoverCounter = 24;
invincibleCounter = 48;
if (!climbing) {
if (fromRight) {
xVel = -20;
} else {
xVel = 20;
}
}
yVel = -8;
jumping = false;
climbing = false;
_mc.gotoAndStop("hit_" + facingDir);
_mc.animator_mc.play();
GlobalData.hits = GlobalData.hits - hitVal;
Interface.update();
if (GlobalData.hits <= 0) {
endLife();
}
}
function updateCounters() {
if (hitRecoverCounter > 0) {
hitRecoverCounter--;
if (hitRecoverCounter == 0) {
_mc.gotoAndStop("wait_" + facingDir);
}
}
if (invincibleCounter > 0) {
invincibleCounter--;
if (((invincibleCounter % 6) == 0) && (hitRecoverCounter <= 0)) {
_mc.animator_mc._visible = false;
} else {
_mc.animator_mc._visible = true;
}
if (invincibleCounter == 0) {
_mc.animator_mc._visible = true;
}
}
updateBored();
}
function updateBored() {
boredCounter++;
if ((boredCounter > 120) && (!bored)) {
bored = true;
_mc.gotoAndStop("bored_" + facingDir);
}
}
function acceptPlayerInput() {
if ((hitRecoverCounter > 0) || (isFrozen)) {
return(undefined);
}
if (Key.isDown(39)) {
moveRight();
resetBoredCounter();
} else if (Key.isDown(37)) {
moveLeft();
resetBoredCounter();
}
if ((Key.isDown(65) && (!jumping)) && (!jumpButtonDown)) {
jump();
resetBoredCounter();
} else if (Key.isDown(38)) {
climbUp();
resetBoredCounter();
} else if (Key.isDown(40)) {
climbDown();
resetBoredCounter();
}
if (!Key.isDown(65)) {
jumpButtonDown = false;
}
if (Key.isDown(83)) {
resetBoredCounter();
punch();
} else {
bulletDelayCounter = 0;
punching = false;
}
}
function resetBoredCounter() {
boredCounter = 0;
bored = false;
}
function getStageCoords() {
var _local2 = new Object();
_local2.x = _mc._x - StinkoGame._mc.gameStage_mc._x;
_local2.y = _mc._y - StinkoGame._mc.gameStage_mc._y;
return(_local2);
}
function move(x, y) {
var _local2 = _mc._x + x;
var _local3 = _mc._y + y;
if ((!StinkoGame.scrollLockX) && (((_local2 > StinkoGame.scrollLimitR) && (x > 0)) || ((_local2 < StinkoGame.scrollLimitL) && (x < 0)))) {
if (((!StinkoGame.nudge(-x, 0)) && (_local2 > StinkoGame.viewBox.l)) && (_local2 < StinkoGame.viewBox.r)) {
_mc._x = _local2;
}
} else if (((_local2 > (StinkoGame.viewBox.l + 20)) && (x < 0)) || ((_local2 < (StinkoGame.viewBox.r - 20)) && (x > 0))) {
_mc._x = _local2;
}
if ((!StinkoGame.scrollLockY) && (((_local3 > StinkoGame.scrollLimitB) && (y > 0)) || ((_local3 < StinkoGame.scrollLimitT) && (y < 0)))) {
if (!StinkoGame.nudge(0, -y)) {
_mc._y = _local3;
}
} else {
_mc._y = _local3;
}
}
function moveTo(x, y) {
var _local3;
var _local2;
if (x != null) {
_local3 = x - _mc._x;
} else {
_local3 = 0;
}
if (y != null) {
_local2 = y - _mc._y;
} else {
_local2 = 0;
}
move(_local3, _local2);
}
function getBlown(offset) {
move(offset, 0);
}
function stopMovement() {
xVel = 0;
yVel = 0;
}
function gotoYouDead() {
_mc.gotoAndStop("youDead_" + facingDir);
}
var BULLET_DELAY = 7;
}
Symbol 1191 MovieClip [__Packages.PlayerWithFist] Frame 0
class PlayerWithFist extends Player
{
var jumpHeight, defaultJumpHeight, blockingLava, overhead, _mc, facingDir, climbing, xVel, incrSpeed, maxSpeed, soundMaker, jumpButtonDown, jumping, yVel, punching, enabled, updateCounters, resetBoredCounter, jumpDeceleration, deceleration, hitRecoverCounter, bored, acceptPlayerInput, gravity, move, invincibleCounter, getStageCoords;
function PlayerWithFist (p_mc) {
super(p_mc);
jumpHeight = (defaultJumpHeight = 8);
blockingLava = false;
overhead = false;
_mc.mPlayerWithFist = this;
}
function moveRight() {
facingDir = "right";
if (climbing) {
return(undefined);
}
_mc.animator_mc.play();
xVel = xVel + incrSpeed;
if (xVel > maxSpeed.x) {
xVel = maxSpeed.x;
}
}
function moveLeft() {
facingDir = "left";
if (climbing) {
return(undefined);
}
_mc.animator_mc.play();
xVel = xVel - incrSpeed;
if (xVel < (-maxSpeed.x)) {
xVel = -maxSpeed.x;
}
}
function climbUp() {
}
function climbDown() {
}
function jump() {
soundMaker.attachSound("stinko_maybejump2.wav");
soundMaker.start();
jumpButtonDown = true;
jumping = true;
if (!climbing) {
yVel = yVel - jumpHeight;
}
climbing = false;
}
function punchGround(punchGroundTest_mc) {
if (!Platform.hit(punchGroundTest_mc)) {
return(undefined);
}
var _local7 = new CameraEffectShake(_root, 5, 4);
var _local4 = StinkoGame.getPlayerGlobal();
var _local3 = _local4.x;
if (facingDir == "left") {
_local3 = _local3 - 60;
} else {
_local3 = _local3 + 40;
}
var _local5 = _local4.y + 10;
var _local6 = new BulletAvalanche(_local3, _local5);
}
function punch() {
if (jumping) {
} else if (Math.abs(xVel) > 1) {
_mc.gotoAndStop("runpunch_" + facingDir);
} else {
_mc.gotoAndStop("punch_" + facingDir);
}
_mc.animator_mc.play();
punching = true;
testForPunchHit();
}
function update() {
if (enabled) {
updateCounters();
testForLavaBlock();
testForBulletBlock();
var _local7 = "";
if (overhead) {
resetBoredCounter();
_local7 = "lava_";
}
if (jumping) {
xVel = xVel * jumpDeceleration;
} else {
xVel = xVel * deceleration;
}
if (((xVel < 0.1) && (xVel > 0)) || ((xVel > -0.1) && (xVel < 0))) {
xVel = 0;
}
if ((((hitRecoverCounter <= 0) && (!punching)) && (!climbing)) && (!bored)) {
if (!jumping) {
_mc.gotoAndStop((_local7 + "run_") + facingDir);
} else if (Math.abs(xVel) > 1) {
_mc.gotoAndStop("spin_" + facingDir);
} else {
_mc.gotoAndStop("jump_" + facingDir);
}
}
acceptPlayerInput();
testForPlayerHurt();
if (!climbing) {
if (yVel < maxSpeed.y) {
yVel = yVel + gravity;
}
}
move(xVel, 0);
var _local5 = Obstacle.hit(_mc.hitTestHurt_mc);
if (_local5 != undefined) {
move(-xVel, 0);
}
var _local9 = Wall.hit(_mc.hitTestHurt_mc);
if (_local9 != undefined) {
move(-xVel, 0);
}
move(0, yVel);
if ((!climbing) || (yVel > 0)) {
var _local3 = Platform.hit(_mc.hitTestWalk_mc);
if (_local3 == undefined) {
_local3 = MoveablePlatform.hitWalkies(_mc.hitTestWalk_mc);
}
var _local2 = YMovingPlatform.hit(_mc.hitTestWalk_mc);
if (_local2 == undefined) {
_local2 = XMovingPlatform.hit(_mc.hitTestWalk_mc);
}
var _local6;
if (_local3 != undefined) {
_local6 = new Object({x:_local3._x, y:_local3._y});
_local3._parent.localToGlobal(_local6);
_mc._parent.globalToLocal(_local6);
}
var _local4 = new Object({x:_local2._mc._x, y:_local2._mc._y});
_local2._mc._parent.localToGlobal(_local4);
_mc._parent.globalToLocal(_local4);
if (yVel > 0) {
if (_local2 != undefined) {
if (_local2.classType == "YMovingPlatform") {
yVel = _local2.vel;
} else {
yVel = 0;
move(_local2.vel, 0);
}
move(0, _local4.y - _mc._y);
if (jumping) {
soundMaker.attachSound("stinko_land.wav");
soundMaker.start();
var _local8 = Switch.hit(_mc.hitTestWalk_mc);
if (_local8 != undefined) {
trace("PlayerWithFist::update() switchy exists");
_local8.activate();
}
}
jumping = false;
} else if (_local3 != undefined) {
yVel = 0;
move(0, _local6.y - _mc._y);
if (jumping) {
soundMaker.attachSound("stinko_land.wav");
soundMaker.start();
var _local8 = Switch.hit(_mc.hitTestLadderBottom_mc);
if (_local8 != undefined) {
trace("PlayerWithFist::update() switchy exists");
_local8.activate();
}
}
jumping = false;
climbing = false;
} else {
if (!climbing) {
jumping = true;
}
if (_mc._y > 500) {
endLife();
}
}
} else {
_local5 = Obstacle.hit(_mc.hitTestHurt_mc);
if (_local5 != undefined) {
move(0, -yVel);
yVel = (-yVel) / 2;
}
if (_local2) {
if (_local2.classType == "YMovingPlatform") {
move(0, _local4.y - _mc._y);
yVel = _local2.vel;
jumping = false;
} else {
move(_local2.vel, 0);
}
}
}
if (Wall.hit(_mc.hitTestHurt_mc)) {
move(0, -yVel);
}
}
if (climbing) {
if (!punching) {
if (Ladder.hit(_mc.hitTestLadderTop_mc) == undefined) {
_mc.gotoAndStop("butt");
} else {
_mc.gotoAndStop("climb");
}
if (Math.abs(yVel) > 0) {
_mc.animator_mc.play();
} else {
_mc.animator_mc.stop();
}
}
if (!Ladder.hit(_mc)) {
climbing = false;
if (yVel > 0) {
}
}
yVel = 0;
} else if (((((!Key.isDown(39)) && (!Key.isDown(37))) && (!jumping)) && (!punching)) && (hitRecoverCounter <= 0)) {
if (!bored) {
_mc.gotoAndStop((_local7 + "wait_") + facingDir);
}
}
if (_mc.hitTestLadderTop_mc == undefined) {
yVel = 0;
}
}
}
function endLife() {
StinkoGame.loseLife(false);
}
function testForPlayerHurt() {
if (invincibleCounter > 0) {
return(undefined);
}
var _local2 = Enemy.anyPlayerDangerTest(_mc.hitTestHurt_mc);
if (_local2 == undefined) {
_local2 = Hazard.anyPlayerDangerTest(_mc.hitTestHurt_mc);
}
if (_local2 == undefined) {
_local2 = Trap.anyPlayerDangerTest(_mc.hitTestHurt_mc);
}
if (_local2 == undefined) {
_local2 = Bullet.anyPlayerDangerTest(_mc.hitTestHurt_mc);
}
if (_local2 == undefined) {
_local2 = StinkoGame.bossMan.playerDangerTest(_mc.hitTestHurt_mc);
}
if (_local2 == undefined) {
return(undefined);
}
trace((((((((("testForPlayerHurt(): " + _local2.classType) + "->") + _local2._mc._x) + ",") + _local2._mc._width) + ",") + getStageCoords().x) + ",") + _mc._width);
trace((("testForPlayerHurt(): " + (_local2._mc._x + (_local2._mc._width / 2))) + ",") + (getStageCoords().x + (_mc._width / 2)));
if ((_local2.classType == "Hazard") && (_local2.subType < 4)) {
GlobalData.hits = 0;
}
if (_local2.classType == "Bullet") {
trace((("Player::testforPlayerHurt() hit by a bullet " + _local2._mc._x) + ",") + _mc._x);
takeDamage(_local2._mc._x < (_mc._x + (_mc._width / 2)));
} else if ((_local2._mc._x + (_local2._mc._width / 2)) > (getStageCoords().x + (_mc._width / 2))) {
takeDamage(true);
} else {
takeDamage(false);
}
}
function testForLavaBlock() {
var _local2;
_local2 = LavaFall.hit(_mc.hitTestHurt_mc);
if (_local2 != undefined) {
overhead = true;
blockLava(_local2);
} else {
overhead = false;
_local2 = LavaFall.hit(_mc.animator_mc.fist_mc);
if (_local2 != undefined) {
blockLava(_local2);
} else {
LavaFall.noneAreBlocked();
}
}
}
function blockLava(lavaHit) {
blockingLava = true;
var _local2 = new Object();
_local2.x = 0;
_local2.y = _mc.animator_mc.fist_mc._y;
_mc.animator_mc.localToGlobal(_local2);
lavaHit._mc.globalToLocal(_local2);
if (overhead) {
_local2.y = _local2.y + 5;
}
lavaHit.block(_local2.y);
}
function testForPunchHit() {
var _local4 = Enemy.anyHurtByPlayerTest(_mc.animator_mc.fist_mc);
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3;
if (facingDir == "right") {
_local3 = 1;
} else {
_local3 = -1;
}
_local4[_local2].takeDamage(_local3, -1);
_local2++;
}
}
function testForBulletBlock() {
var _local2 = Bullet.anyPlayerDangerTest(_mc.animator_mc.fist_mc);
if (_local2 != undefined) {
_local2.deflect();
}
}
function takeDamage(fromRight) {
trace(("takeDamage(" + fromRight) + ")");
hitRecoverCounter = 24;
invincibleCounter = 48;
if (!climbing) {
if (fromRight) {
xVel = -20;
} else {
xVel = 20;
}
}
jumping = false;
climbing = false;
_mc.gotoAndStop("hit_" + facingDir);
_mc.animator_mc.play();
GlobalData.hits--;
Interface.update();
if (GlobalData.hits <= 0) {
endLife();
}
}
}
Symbol 1192 MovieClip [__Packages.CameraEffectShake] Frame 0
class CameraEffectShake extends CameraEffect
{
var originalClipX, originalClipY, ticksLeft, shakeRange, _mc;
function CameraEffectShake (p_mc, pTotalTicks, pShakeRange) {
super(p_mc);
originalClipX = 0;
originalClipY = 0;
ticksLeft = pTotalTicks;
shakeRange = pShakeRange;
}
function update() {
ticksLeft--;
if (ticksLeft <= 0) {
_mc._x = originalClipX;
_mc._y = originalClipY;
delete _mc.onEnterFrame;
} else {
var _local3 = Math.floor(((Math.random() * 2) * shakeRange) - shakeRange);
var _local2 = Math.floor(((Math.random() * 2) * shakeRange) - shakeRange);
_mc._x = originalClipX + _local3;
_mc._y = originalClipY + _local2;
}
}
}
Symbol 1193 MovieClip [__Packages.BulletAvalanche] Frame 0
class BulletAvalanche extends BulletFriendly
{
function BulletAvalanche (start_x, start_y) {
super("Bullet3", start_x, start_y, 0, 10, 0);
}
function subClassUpdate() {
}
function avalancheMakeHomestarHappy() {
StinkoGame.oneUp.makeHappy();
}
var gravity = 0;
static var depthCount = 0;
}
Symbol 1194 MovieClip [__Packages.PlayerOneUp] Frame 0
class PlayerOneUp extends Player
{
var maxSpeed, jumpHeight, defaultJumpHeight, climbVelocity, climbing, _mc, facingDir, jumping, xVel, punching;
function PlayerOneUp (p_mc) {
super(p_mc);
maxSpeed.x = 4.2;
jumpHeight = (defaultJumpHeight = 24);
climbVelocity = 2.2;
}
function punch() {
if (climbing) {
_mc.gotoAndStop("climbpunch_" + facingDir);
} else if (jumping) {
_mc.gotoAndStop("jumppunch_" + facingDir);
} else if (Math.abs(xVel) > 1) {
_mc.gotoAndStop("runpunch_" + facingDir);
} else {
_mc.gotoAndStop("punch_" + facingDir);
}
_mc.animator_mc.play();
punching = true;
if (!jumping) {
xVel = 0;
}
testForPunchHit();
}
function testForPunchHit() {
var _local4 = Enemy.anyHurtByPlayerTest(_mc.animator_mc.kick_mc);
var _local3 = 0;
while (_local3 < _local4.length) {
var _local2;
if (jumping || (Math.abs(xVel) > 1)) {
if (_mc.animator_mc._currentframe < 5) {
_local2 = 1;
} else {
_local2 = -1;
}
} else if (facingDir == "right") {
_local2 = 1;
} else {
_local2 = -1;
}
_local4[_local3].takeDamage(_local2, -1);
_local3++;
}
var _local5 = StinkoGame.bossMan.hurtByPlayerTest(_mc.animator_mc.kick_mc);
if (_local5 != undefined) {
_local5.takeDamage();
}
}
}
Symbol 1195 MovieClip [__Packages.PlayerIce] Frame 0
class PlayerIce extends Player
{
var deceleration, defaultDeceleration, incrSpeedIce, _mc, facingDir, climbing, jumping, xVel, incrSpeed, maxSpeed, hitRecoverCounter, invincibleCounter, yVel, endLife, boredCounter, bored, isFrozen;
function PlayerIce (p_mc) {
super(p_mc);
deceleration = (defaultDeceleration = 0.96);
incrSpeedIce = 0.2;
_mc.mPlayer = this;
}
function moveRight() {
facingDir = "right";
if (climbing) {
return(undefined);
}
_mc.animator_mc.play();
if (jumping) {
xVel = xVel + incrSpeed;
} else {
xVel = xVel + incrSpeedIce;
}
if (xVel > maxSpeed.x) {
xVel = maxSpeed.x;
}
}
function moveLeft() {
facingDir = "left";
if (climbing) {
return(undefined);
}
_mc.animator_mc.play();
if (jumping) {
xVel = xVel - incrSpeed;
} else {
xVel = xVel - incrSpeedIce;
}
if (xVel < (-maxSpeed.x)) {
xVel = -maxSpeed.x;
}
}
function takeDamage(fromRight, hitVal) {
trace(("takeDamage(" + fromRight) + ")");
if (hitVal == undefined) {
hitVal = 1;
}
if (GlobalData.bossLevel()) {
fromRight = true;
}
hitRecoverCounter = 24;
invincibleCounter = 48;
if (!climbing) {
if (fromRight) {
xVel = -5;
} else {
xVel = 5;
}
}
yVel = -8;
jumping = false;
climbing = false;
_mc.gotoAndStop("hit_" + facingDir);
_mc.animator_mc.play();
GlobalData.hits = GlobalData.hits - hitVal;
Interface.update();
if (GlobalData.hits <= 0) {
endLife();
}
}
function updateBored() {
boredCounter++;
if ((boredCounter > 20) && (!bored)) {
bored = true;
_mc.gotoAndStop("bored_ice_" + facingDir);
}
}
function getHitFrozen() {
if (isFrozen) {
return(undefined);
}
_mc.gotoAndStop("bored_ice_" + facingDir);
_mc.animator_mc.gotoAndPlay("freeze");
getFrozen();
bored = true;
}
function getFrozen() {
isFrozen = true;
}
function getUnfrozen() {
isFrozen = false;
takeDamage(!facingDir);
}
}
Symbol 1196 MovieClip [__Packages.PlayerShip] Frame 0
class PlayerShip extends Player
{
var incrSpeed, maxSpeed, enabled, deceleration, defaultDeceleration, punching, xVel, yVel, shieldCounter, jumpButtonDown, autoScrollSpeed, shipTiltState, bulletDelayCounter, soundMaker, _mc, BULLET_DELAY, facingDir, invincibleCounter, hitRecoverCounter, bored, boredCounter, updateCounters;
function PlayerShip (p_mc) {
super(p_mc);
var thisPlayer = this;
incrSpeed = 2;
maxSpeed = new Object();
maxSpeed.x = 6;
maxSpeed.y = 6;
enabled = true;
deceleration = (defaultDeceleration = 0.8);
punching = false;
xVel = (yVel = 0);
shieldCounter = 0;
jumpButtonDown = false;
autoScrollSpeed = new Object();
shipTiltState = "flat";
bulletDelayCounter = 0;
soundMaker = new Sound(_mc);
_mc._x = StinkoGame.ld.levelProperties.playerStartX;
_mc._y = StinkoGame.ld.levelProperties.playerStartY;
_mc.onEnterFrame = function () {
thisPlayer.update();
};
_mc.shield_mc._visible = false;
BULLET_DELAY = 10;
}
function newMan() {
}
function newGame() {
}
function reset() {
var thisPlayer = this;
_mc.onEnterFrame = function () {
thisPlayer.update();
};
facingDir = "right";
enabled = true;
invincibleCounter = 0;
hitRecoverCounter = 0;
GlobalData.hits = 4;
GlobalData.shields = 3;
StinkoGame.jumpToOrigin();
_mc._x = StinkoGame.ld.levelProperties.playerStartX;
_mc._y = StinkoGame.ld.levelProperties.playerStartY;
StinkoGame.inProgress = true;
deceleration = defaultDeceleration;
xVel = (yVel = 0);
_mc.animator_mc.stop();
Interface.update();
bored = false;
boredCounter = 0;
}
function punch() {
bulletDelayCounter--;
if (bulletDelayCounter < 0) {
bulletDelayCounter = BULLET_DELAY;
var _local6 = 10;
var _local3 = StinkoGame.getPlayerGlobal();
var _local2 = _local3.x;
var _local4 = _local3.y;
_local2 = _local2 + 10;
var _local5 = new BulletFriendly("Bullet15", _local2, _local4, 14 + (autoScrollSpeed.x / 10), (-autoScrollSpeed.y) / 10);
}
}
function fireAlternateShot() {
if (shieldCounter < 1) {
if (GlobalData.useShield()) {
shieldCounter = 75;
_mc.shield_mc._visible = true;
_mc.shield_mc.gotoAndPlay(2);
} else {
soundMaker.attachSound("deflect.wav");
soundMaker.start();
}
}
}
function update() {
if (enabled) {
if (shieldCounter > 0) {
shieldCounter--;
_mc.shield_mc._visible = true;
} else {
_mc.shield_mc._visible = false;
_mc.shield_mc.stop();
}
ShootingGame.nudge((-autoScrollSpeed.x) / 10, autoScrollSpeed.y / 10);
updateCounters();
acceptPlayerInput();
testForPlayerHurt();
move(xVel, 0);
move(0, yVel);
if (ShooterObstacle.anyHitPoint(_mc.shooterCollide_mc)) {
takeDamage();
trace("PlayerShip::update() touched by ShooterObstacle");
}
}
}
function endLife() {
StinkoGame.loseLife(false);
}
function testForPlayerHurt() {
var _local2 = Enemy.anyPlayerDangerTest(_mc.hitTestHurt_mc);
if (_local2 != undefined) {
takeDamage();
} else if (Bullet.anyPlayerDangerTest(_mc.hitTestHurt_mc)) {
takeDamage();
}
if (_local2 == undefined) {
_local2 = StinkoGame.bossMan.playerDangerTest(_mc.hitTestHurt_mc);
if (_local2 != undefined) {
takeDamage();
}
}
}
function testForPunchHit() {
var _local3 = Enemy.anyHurtByPlayerTest(_mc.wave_mc);
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4;
if (facingDir == "right") {
_local4 = 1;
} else {
_local4 = -1;
}
if (_local3[_local2].vulnerable || (_local3[_local2].vulnerable == undefined)) {
_local3[_local2].takeDamage(_local4, -1);
}
_local2++;
}
}
function takeDamage(fromRight, hitVal) {
trace(("PlayerShip::takeDamage(" + fromRight) + ")");
if (invincibleCounter > 0) {
return(undefined);
}
if (shieldCounter > 0) {
return(undefined);
}
xVel = 0;
yVel = 0;
if (hitVal == undefined) {
hitVal = 1;
}
hitRecoverCounter = 24;
invincibleCounter = 48;
_mc.gotoAndStop("hit");
_mc.explode_mc.gotoAndPlay("go");
_mc.animator_mc.gotoAndPlay(1);
GlobalData.hits = GlobalData.hits - hitVal;
Interface.update();
if (GlobalData.hits <= 0) {
endLife();
}
}
function acceptPlayerInput() {
if (Key.isDown(39)) {
xVel = xVel + incrSpeed;
} else if (Key.isDown(37)) {
xVel = xVel - incrSpeed;
}
if (Key.isDown(40)) {
yVel = yVel + incrSpeed;
_mc.gotoAndPlay("up");
shipTiltState = "up";
} else if (Key.isDown(38)) {
yVel = yVel - incrSpeed;
_mc.gotoAndPlay("down");
shipTiltState = "down";
} else {
if (shipTiltState == "down") {
_mc.gotoAndPlay("downReturn");
} else if (shipTiltState == "up") {
_mc.gotoAndPlay("upReturn");
}
shipTiltState = "straight";
}
if (xVel < 0) {
if (xVel > (-deceleration)) {
xVel = 0;
} else {
xVel = xVel + deceleration;
}
}
if (xVel > 0) {
if (xVel < deceleration) {
xVel = 0;
} else {
xVel = xVel - deceleration;
}
}
if (yVel < 0) {
if (yVel > (-deceleration)) {
yVel = 0;
} else {
yVel = yVel + deceleration;
}
}
if (yVel > 0) {
if (yVel < deceleration) {
yVel = 0;
} else {
yVel = yVel - deceleration;
}
}
if (xVel > maxSpeed.x) {
xVel = maxSpeed.x;
}
if (xVel < (-maxSpeed.x)) {
xVel = -maxSpeed.x;
}
if (yVel > maxSpeed.y) {
yVel = maxSpeed.y;
}
if (yVel < (-maxSpeed.y)) {
yVel = -maxSpeed.y;
}
if (Key.isDown(65)) {
fireAlternateShot();
}
if (Key.isDown(83)) {
punch();
} else {
bulletDelayCounter = 0;
punching = false;
}
}
function getStageCoords() {
var _local2 = new Object();
_local2.x = _mc._x - StinkoGame._mc.gameStage_mc._x;
_local2.y = _mc._y - StinkoGame._mc.gameStage_mc._y;
return(_local2);
}
function move(x, y) {
var _local3 = _mc._x + x;
var _local2 = _mc._y + y;
var _local5 = true;
var _local4 = true;
if (_local5 && (((_local3 > (StinkoGame.viewBox.l + 5)) && (x < 0)) || ((_local3 < (StinkoGame.viewBox.r - 5)) && (x > 0)))) {
_mc._x = _local3;
}
if (_local4 && (((_local2 > (StinkoGame.viewBox.t + 5)) && (y < 0)) || ((_local2 < (StinkoGame.viewBox.b - 5)) && (y > 0)))) {
_mc._y = _local2;
}
}
function gotoYouDead() {
_mc.gotoAndStop("youDead");
}
}
Symbol 1197 MovieClip [__Packages.Boss] Frame 0
class Boss
{
var _mc, maxVelY, maxVelX, velX, velY, hitPoints, invincibleCounter, dead, deadAnimateCounter, hurtFlashCounter, hurtFlashColor, hurtFlashTrans;
function Boss (parent_mc, symbolName) {
trace("Boss(): created " + symbolName);
_mc = parent_mc.attachMovie(symbolName, "boss", 1);
maxVelY = 0;
maxVelX = -1.5;
velX = 0;
velY = 0;
hitPoints = 5;
invincibleCounter = 0;
invincibleCounterReset = 24;
initHurtFlasher(_mc);
var thisBoss = this;
_mc.onEnterFrame = function () {
thisBoss.updateCounters();
thisBoss.update();
};
dead = false;
}
function takeDamage(x, y) {
if (invincibleCounter == 0) {
hitPoints--;
invincibleCounter = invincibleCounterReset;
}
if (hitPoints <= 0) {
die(x, y);
}
takeDamageSubclass();
}
function takeDamageSubclass() {
}
function die(x, y) {
trace("Boss:die()");
var thisBoss = this;
dead = true;
_mc.onEnterFrame = function () {
thisBoss.updateDead();
};
clearHurtFlasher();
_mc.animator_mc.gotoAndPlay("die");
animateDeath();
velX = 0;
velY = 0;
deadAnimateCounter = 30;
StinkoGame.gameSound.stop();
trace("Killing the boss!");
}
function animateDeath() {
}
function doneDying() {
StinkoGame.player1._mc.gotoAndStop("happy");
StinkoGame.inProgress = false;
StinkoGame.player1.enabled = false;
StinkoGame.gameSound.stop();
}
function update() {
}
function updateCounters() {
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
}
function updateDead() {
}
function hurtByPlayerTest(test_mc) {
trace((((("hurtByPlayerTest(test_mc) " + test_mc._name) + ",") + invincibleCounter) + ",") + _mc.hurtByPlayer_mc.hitTest(test_mc));
return(_mc.hurtByPlayer_mc.hitTest(test_mc) && (invincibleCounter <= 0));
}
function playerDangerTest(test_mc) {
return(undefined);
}
function updateHurtFlasher() {
hurtFlashCounter--;
if (hurtFlashCounter == 0) {
trace("hurtFlashColor.getTransform().ra = " + hurtFlashColor.getTransform().ra);
if (hurtFlashColor.getTransform().ra == 100) {
hurtFlashColor.setTransform(hurtFlashTrans);
} else {
hurtFlashColor.setTransform({ra:100, ga:100, ba:100, rb:0});
}
hurtFlashCounter = 3;
}
}
function clearHurtFlasher() {
hurtFlashColor.setTransform({ra:100, rb:0, ga:100, ba:100});
hurtFlashCounter = 3;
}
function initHurtFlasher(clip_mc) {
if (clip_mc == undefined) {
clip_mc = _mc;
}
hurtFlashTrans = new Object();
hurtFlashColor = new Color(clip_mc);
hurtFlashTrans.ra = 39;
hurtFlashTrans.ga = 39;
hurtFlashTrans.ba = 39;
hurtFlashTrans.rb = 156;
hurtFlashCounter = 3;
}
function stop() {
delete _mc.onEnterFrame;
}
var invincibleCounterReset = 24;
}
Symbol 1198 MovieClip [__Packages.BossBrain] Frame 0
class BossBrain extends Boss
{
var _mc, movePattArr, pattIndex, velX, velY, hitPoints, movementPhase, flashLength, dead, facingDir, nextPhaseTimer, waitingToShoot;
function BossBrain (parent_mc) {
super(parent_mc, "bossBrain_mc");
trace("BossBrain(): created " + _mc._name);
_mc.myBoss = this;
movePattArr = new Array(1, 2, 3, 4, 3, 5, 1, 2, 3, 4, 3, 6);
pattIndex = -1;
_mc._x = -200;
_mc._y = 10;
velX = 10;
velY = 0;
hitPoints = 7;
movementPhase = 0;
flashLength = 30;
}
function update() {
_mc._x = _mc._x + velX;
_mc._y = _mc._y + velY;
if (dead || (hitPoints <= 0)) {
return(undefined);
}
switch (movementPhase) {
case 0 :
if (_mc._x > 350) {
facingDir = "left";
_mc.gotoAndStop("left");
startNewPhase();
}
break;
case 1 :
updateHover();
break;
case 2 :
if (_mc._y >= 150) {
startNewPhase();
}
break;
case 3 :
updateShoot();
break;
case 4 :
if (_mc._y <= 10) {
startNewPhase();
}
break;
case 5 :
if (_mc._x < 20) {
facingDir = "right";
_mc.gotoAndStop("right");
startNewPhase();
}
break;
case 6 :
if (_mc._x > 350) {
facingDir = "left";
_mc.gotoAndStop("left");
startNewPhase();
}
break;
}
}
function startNewPhase() {
velY = 0;
velX = 0;
pattIndex++;
if (pattIndex >= movePattArr.length) {
pattIndex = 0;
}
movementPhase = movePattArr[pattIndex];
switch (movePattArr[pattIndex]) {
case 1 :
startHover();
break;
case 2 :
startDescend();
break;
case 3 :
startShoot();
break;
case 4 :
startAscend();
break;
case 5 :
velX = -25 + hitPoints;
break;
case 6 :
velX = 25 - hitPoints;
}
}
function updateHover() {
if (_mc._y > 30) {
velY = velY - 2;
} else {
velY = velY + 2;
}
nextPhaseTimer--;
if (nextPhaseTimer == 0) {
startNewPhase();
}
}
function startHover() {
velY = 2;
nextPhaseTimer = 48;
}
function startDescend() {
velY = 14 - hitPoints;
}
function startShoot() {
if (dead) {
return(undefined);
}
nextPhaseTimer = flashLength;
waitingToShoot = false;
_mc.animator_mc.gotoAndPlay("flash");
}
function updateShoot() {
if (dead) {
return(undefined);
}
nextPhaseTimer--;
if (nextPhaseTimer == 0) {
if (!waitingToShoot) {
waitingToShoot = true;
nextPhaseTimer = flashLength;
_mc.animator_mc.gotoAndPlay("shoot");
} else {
startNewPhase();
}
}
}
function startAscend() {
velY = -14 + hitPoints;
}
function shootBullets() {
trace("shootingBullets!");
var _local3 = new Object({x:_mc.hurtByPlayer_mc._x, y:_mc.hurtByPlayer_mc._y});
_mc.localToGlobal(_local3);
_root.bullet_mc.globalToLocal(_local3);
if (facingDir == "left") {
var _local7 = new Bullet("brainBossFire_mc", _local3.x - 10, _local3.y - 10, -10, 6, false, 0);
var _local6 = new Bullet("brainBossFire_mc", _local3.x, _local3.y, -10, 8, false, 0);
var _local5 = new Bullet("brainBossFire_mc", _local3.x, _local3.y, -10, 0, false, 0);
var _local4 = new Bullet("brainBossFire_mc", _local3.x + 10, _local3.y + 10, -10, 10, false, 0);
} else {
var _local7 = new Bullet("brainBossFire_mc", _local3.x + 10, _local3.y - 10, 10, 6, false, 0);
var _local6 = new Bullet("brainBossFire_mc", _local3.x, _local3.y, 10, 8, false, 0);
var _local5 = new Bullet("brainBossFire_mc", _local3.x, _local3.y, 10, 0, false, 0);
var _local4 = new Bullet("brainBossFire_mc", _local3.x - 10, _local3.y + 10, 10, 10, false, 0);
}
}
function playerDangerTest(test_mc) {
if (_mc.hitTestA.hitTest(test_mc) || (_mc.hitTestB.hitTest(test_mc))) {
return(this);
}
return(undefined);
}
function takeDamageSubclass() {
flashLength = flashLength - 5;
if (flashLength < 5) {
flashLength = 5;
}
}
function updateDead() {
if (dead) {
_mc.animator_mc.gotoAndPlay("die");
delete _mc.onEnterFrame;
}
}
}
Symbol 1199 MovieClip [__Packages.BossChicken] Frame 0
class BossChicken extends Boss
{
var hitPoints, _mc, bodyParts, legMode, head, headMode, stompingLeftCounter, stompingLeftMax, headViewableCounter, headViewableMax, dead, invincibleCounter;
function BossChicken (parent_mc) {
super(parent_mc, "bossChicken_mc");
hitPoints = 5;
trace("bossChicken_mc(): created " + _mc._name);
bodyParts = new Array();
legMode = new Array();
_mc.myBoss = this;
bodyParts[0] = _mc.legA_mc;
bodyParts[1] = _mc.legB_mc;
bodyParts[2] = _mc.legC_mc;
head = _mc.head_mc;
var _local3 = 0;
while (_local3 < 3) {
bodyParts[_local3].mID = _local3;
bodyParts[_local3].startY = bodyParts[_local3]._y;
bodyParts[_local3]._x = getRandomX();
legMode[_local3] = 5;
_local3++;
}
head._x = getRandomX();
legMode[0] = 0;
headMode = 5;
stompingLeftCounter = (stompingLeftMax = 240);
headViewableCounter = (headViewableMax = 60);
}
function update() {
var _local2 = 0;
while (_local2 < bodyParts.length) {
switch (legMode[_local2]) {
case 0 :
legEnter(_local2);
break;
case 1 :
legMoveAround(_local2);
break;
case 2 :
startStomp(_local2);
break;
case 3 :
break;
case 4 :
legLeave(_local2);
break;
}
_local2++;
}
stompingLeftCounter--;
if (headMode == 1) {
headViewableCounter--;
if (headViewableCounter < 0) {
headMode = 2;
head.gotoAndPlay("leave");
}
}
if (((legMode[0] == 5) && (legMode[1] == 5)) && (headMode == 5)) {
head._x = getRandomX();
startHeadEnter();
headMode = 0;
}
}
function legEnter(legNum) {
bodyParts[legNum]._y = bodyParts[legNum]._y + 5;
if (bodyParts[legNum]._y > (bodyParts[legNum].startY + 85)) {
legMode[legNum]++;
bodyParts[legNum].target = getRandomX();
bodyParts[legNum].moveTilStompCounter = 3;
}
}
function legMoveAround(legNum) {
if (bodyParts[legNum]._x > (bodyParts[legNum].target + 16)) {
bodyParts[legNum]._x = bodyParts[legNum]._x - 15;
} else if (bodyParts[legNum]._x < (bodyParts[legNum].target - 16)) {
bodyParts[legNum]._x = bodyParts[legNum]._x + 15;
} else {
bodyParts[legNum].target = getRandomX();
bodyParts[legNum].moveTilStompCounter--;
if (bodyParts[legNum].moveTilStompCounter < 0) {
legMode[legNum]++;
}
}
}
function startStomp(legNum) {
bodyParts[legNum].gotoAndPlay("stomp");
legMode[legNum]++;
}
function doneStomping(legNum) {
legMode[legNum]++;
}
function legLeave(legNum) {
bodyParts[legNum]._y = bodyParts[legNum]._y - 5;
if (bodyParts[legNum]._y < bodyParts[legNum].startY) {
if (stompingLeftCounter < 0) {
legMode[legNum] = 5;
} else {
legMode[legNum] = 0;
bodyParts[legNum]._x = getRandomX();
}
}
}
function getRandomX() {
var _local1 = Math.floor(StinkoGame.viewBox.l + (Math.random() * ((StinkoGame.viewBox.r - StinkoGame.viewBox.l) - 50)));
trace("BossChicken::getRandomX() = " + _local1);
return(_local1);
}
function startHeadEnter() {
head.gotoAndPlay("stomp");
headMode++;
}
function doneHeadEnter() {
headMode = 1;
}
function doneHeadLeave() {
stompingLeftCounter = stompingLeftMax;
headViewableCounter = headViewableMax;
if (!dead) {
headMode = 5;
bodyParts[0]._x = getRandomX();
legMode[0] = 0;
bodyParts[1]._x = getRandomX();
legMode[1] = 0;
} else {
_mc.gotoAndPlay("boneShower");
}
}
function legModesAreFive() {
var _local2 = 0;
while (_local2 < bodyParts.length) {
if (legMode[_local2] != 5) {
return(false);
}
_local2++;
}
return(true);
}
function playerDangerTest(test_mc) {
var _local2 = 0;
while (_local2 < bodyParts.length) {
if (bodyParts[_local2].footHT_mc.hitTest(test_mc) || (bodyParts[_local2].leg.hitTest(test_mc))) {
return(this);
}
_local2++;
}
if (head.headObj_mc.hitTest_mc.hitTest(test_mc)) {
return(this);
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
trace((((("hurtByPlayerTest(test_mc) " + test_mc._name) + ",") + invincibleCounter) + ",") + head.headObj_mc.hurtTest_mc.hitTest(test_mc));
var _local2 = head.headObj_mc.hurtTest_mc.hitTest(test_mc) && (invincibleCounter <= 0);
if (_local2) {
head.headObj_mc.gotoAndPlay("hit");
head.gotoAndPlay("leave");
headMode = 2;
headViewableMax = headViewableMax - 8;
}
return(_local2);
}
function stop() {
var _local2 = 0;
while (_local2 < bodyParts.length) {
bodyParts[_local2].stop();
_local2++;
}
delete _mc.onEnterFrame;
}
}
Symbol 1200 MovieClip [__Packages.BossWall] Frame 0
class BossWall extends Boss
{
var hitPoints, reverseTimer, facingDir, killCounter, _mc, invincibleCounter;
function BossWall (parent_mc) {
super(parent_mc, "BossWall_mc");
hitPoints = 16;
reverseTimer = REVERSE_TIMER_LENGTH;
facingDir = "right";
killCounter = 0;
}
function update() {
reverseTimer--;
if (reverseTimer <= 0) {
reverseBelt();
}
if (_mc.conveyor_mc.hitTest(StinkoGame.player1._mc)) {
if (facingDir == "left") {
StinkoGame.player1._mc._x = StinkoGame.player1._mc._x - 3;
} else {
StinkoGame.player1._mc._x = StinkoGame.player1._mc._x + 3;
}
}
}
function playerDangerTest(test_mc) {
trace("_mc.bossWallFists_mc.fist1._name = " + _mc.bossWallFists_mc.fist1._name);
if (_mc.bossWallFists_mc.fist1.hitTest(test_mc) || (_mc.bossWallFists_mc.fist2.hitTest(test_mc))) {
return(this);
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
if (_mc.wallSegments_mc.hitTest(test_mc) && (invincibleCounter <= 0)) {
return(true);
}
}
function takeDamageSubclass() {
if ((hitPoints % 4) == 0) {
killCounter++;
_mc.wallSegments_mc.gotoAndPlay("kill" + killCounter);
}
}
function reverseBelt() {
if (facingDir == "right") {
facingDir = "left";
} else {
facingDir = "right";
}
_mc.belt_graphic_mc.gotoAndStop(facingDir);
reverseTimer = REVERSE_TIMER_LENGTH;
}
function updateDead() {
deadCounter++;
if (deadCounter > 10) {
GlobalData.subsublevel = 4;
_root.gotoAndStop("cutScene");
}
}
var REVERSE_TIMER_LENGTH = 128;
var deadCounter = 0;
}
Symbol 1201 MovieClip [__Packages.BossSnake] Frame 0
class BossSnake extends Boss
{
var hitPoints, viewBox, jumping, waiting, waitCounter, maxWaitCounter, segmentSpeed, shotCounter, gravity, _mc, segments, frooshTimer, segmentsLeft, initHurtFlasher, facingDir, invincibleCounter, updateHurtFlasher, clearHurtFlasher, frooshBusy, velX, velY;
function BossSnake (parent_mc) {
super(parent_mc, "bossSnake_mc");
hitPoints = 15;
var thisSnake = this;
viewBox = StinkoGame.viewBox;
applyFacingDir();
jumping = false;
waiting = true;
waitCounter = (maxWaitCounter = 24);
segmentSpeed = 7;
shotCounter = 10;
gravity = 0.1;
_mc.mBoss = this;
segments = new Array();
var _local3 = 0;
while (_local3 < 6) {
segments.push(_mc["bodyPart" + _local3]);
segments[_local3].id = _local3;
segments[_local3].lastX = segments[_local3]._x;
segments[_local3].lastY = segments[_local3]._y;
if (_local3 == 0) {
segments[_local3].onEnterFrame = function () {
this._x = this._x + (((thisSnake._mc.head_mc._x + (thisSnake._mc.head_mc._width / 2)) - this.lastX) / thisSnake.segmentSpeed);
this._y = this._y + (((thisSnake._mc.head_mc._y + (thisSnake._mc.head_mc._height / 2)) - this.lastY) / thisSnake.segmentSpeed);
this.lastX = this._x;
this.lastY = this._y;
};
} else {
segments[_local3].onEnterFrame = function () {
this._x = this._x + ((thisSnake.segments[this.id - 1]._x - this.lastX) / thisSnake.segmentSpeed);
this._y = this._y + ((thisSnake.segments[this.id - 1]._y - this.lastY) / thisSnake.segmentSpeed);
this.lastX = this._x;
this.lastY = this._y;
};
}
_local3++;
}
_mc.froosh_mc._y = viewBox.t;
_mc.froosh_mc._x = viewBox.l - 100;
frooshTimer = 48;
_mc.froosh_mc.mBoss = this;
segmentsLeft = segments.length;
setPropertyOfAll("_x", -500);
setPropertyOfAll("_y", -500);
initHurtFlasher(segments[segmentsLeft - 1]);
}
function applyFacingDir() {
_mc.head_mc.gotoAndStop(facingDir);
}
function updateCounters() {
if (waiting) {
waitCounter--;
}
if (waitCounter < 0) {
startJump();
waitCounter = maxWaitCounter + hitPoints;
}
if (invincibleCounter > 0) {
invincibleCounter--;
updateHurtFlasher();
if (invincibleCounter == 0) {
clearHurtFlasher();
}
}
if (jumping) {
shotCounter--;
if (shotCounter == 0) {
shoot();
shotCounter = Math.floor((Math.random() * 10) + hitPoints) + 10;
}
}
if (!frooshBusy) {
frooshTimer--;
if (frooshTimer < 0) {
popFroosh();
frooshTimer = 30 - (15 - hitPoints);
}
}
}
function update() {
if (jumping) {
_mc.head_mc._x = _mc.head_mc._x + velX;
_mc.head_mc._y = _mc.head_mc._y + velY;
velY = velY + gravity;
if ((velY > 0) && (segments[segments.length - 1]._y > (viewBox.b + 20))) {
jumping = false;
waiting = true;
}
}
}
function startJump() {
jumping = true;
waiting = false;
var _local2;
var _local3;
_local2 = ((Math.random() * ((viewBox.r - viewBox.l) - 50)) + viewBox.l) + 25;
if (_local2 < (((viewBox.r - viewBox.l) / 2) + viewBox.l)) {
facingDir = "right";
velX = 2 - ((15 - hitPoints) * 0.1);
} else {
facingDir = "left";
velX = -2 - ((15 - hitPoints) * 0.1);
}
_local3 = viewBox.b + 20;
setPropertyOfAll("_x", _local2);
setPropertyOfAll("_y", _local3);
trace((("BossSnake::startJump()" + _local2) + ",") + _local3);
applyFacingDir();
velY = -6 - ((15 - hitPoints) * 0.6);
gravity = 0.1 + ((15 - hitPoints) * 0.015);
}
function playerDangerTest(test_mc) {
if (_mc.head_mc.hitTest(test_mc)) {
return(this);
}
if (_mc.froosh_mc.hitTest_mc.hitTest(test_mc)) {
return(this);
}
var _local2 = 0;
while (_local2 < segmentsLeft) {
if (segments[_local2].hitTest(test_mc)) {
return(this);
}
_local2++;
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
if (waiting) {
return(false);
}
trace((((((("BossSnake::hurtByPlayerTest(test_mc) " + hitPoints) + ",") + invincibleCounter) + ",") + segmentsLeft) + ",") + segments[segmentsLeft - 1].hitTest(test_mc));
if (segmentsLeft <= 0) {
return((invincibleCounter <= 0) && (_mc.head_mc.hitTest(test_mc)));
}
return((invincibleCounter <= 0) && (segments[segmentsLeft - 1].hitTest(test_mc)));
}
function takeDamageSubclass() {
if ((hitPoints % 2) == 1) {
segments[segmentsLeft - 1].gotoAndPlay("explode");
segmentsLeft--;
if (segmentsLeft > 0) {
initHurtFlasher(segments[segmentsLeft - 1]);
} else {
initHurtFlasher(_mc.head_mc);
}
}
_mc.head_mc.animator_mc.gotoAndPlay("hurt");
}
function setPropertyOfAll(propertyName, val) {
_mc.head_mc[propertyName] = val;
var _local2 = 0;
while (_local2 < segments.length) {
segments[_local2][propertyName] = val;
if (propertyName == "_x") {
segments[_local2].lastX = val;
}
if (propertyName == "_y") {
segments[_local2].lastY = val;
}
_local2++;
}
}
function shoot() {
if (_mc.head_mc._y > StinkoGame.player1._mc._y) {
_mc.head_mc.animator_mc.gotoAndPlay("shoot");
}
}
function fireBullet() {
var _local2 = 21;
if (facingDir == "right") {
_local2 = 20;
}
var _local3 = new Bullet("Bullet6", _mc.head_mc._x + _local2, _mc.head_mc._y, 0, -9, false, 0, false);
}
function updateDead() {
GlobalData.subsublevel = 4;
_root.gotoAndStop("cutScene");
}
function popFroosh() {
var _local2 = StinkoGame.player1._mc._x + 5;
trace("BossSnake::popFroosh(): " + _local2);
_mc.froosh_mc._x = _local2;
_mc.froosh_mc.gotoAndPlay("go");
frooshBusy = true;
}
function doneFrooshing() {
frooshBusy = false;
}
}
Symbol 1202 MovieClip [__Packages.BossNebulon] Frame 0
class BossNebulon extends Boss
{
var _mc, lLimit, rLimit, hitPoints, sideHP, walkDir, velX, invincibleCounterReset, pauseCounter, pauseCounterReset, blowing, shotsPerRound, shootCounter, shootCounterReset, invincibleCounter, shotsLeft, initHurtFlasher, lastDamaged;
function BossNebulon (parent_mc) {
super(parent_mc, "BossNebulon_mc");
_mc.mBoss = this;
trace("BossNebulon::instantiated " + _mc._name);
_mc._y = 75;
_mc._x = 200;
lLimit = 100;
rLimit = 350;
hitPoints = 8;
sideHP = new Object();
sideHP.lEye_mc = 4;
sideHP.rEye_mc = 4;
walkDir = 1;
velX = 5;
invincibleCounterReset = 48;
pauseCounter = (pauseCounterReset = 36);
_mc.mouth_mc.stop();
blowing = false;
shotsPerRound = 1;
shootCounter = (shootCounterReset = 64);
}
function update() {
if (pauseCounter > 0) {
pauseCounter--;
_mc.lFoot_mc.stop();
_mc.rFoot_mc.stop();
} else {
step();
}
shootCounter--;
if (shootCounter < 0) {
if (invincibleCounter <= 0) {
_mc.mouth_mc.gotoAndPlay("attackStart");
shootCounter = shootCounterReset;
shotsLeft = shotsPerRound;
}
}
if (blowing) {
StinkoGame.player1.getBlown(-6);
}
}
function playerDangerTest(test_mc) {
if (_mc.body_mc.hitTest(test_mc)) {
return(this);
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
trace((("BossNebulon::hurtByPlayerTest(): " + test_mc._name) + ",") + _mc.lEye_mc.eye_mc._name);
if (invincibleCounter > 0) {
return(undefined);
}
if (_mc.lEye_mc.eye_mc.hitTest(test_mc) && (sideHP.lEye_mc > 0)) {
initHurtFlasher(_mc.lEye_mc);
lastDamaged = "lEye_mc";
return(this);
}
if (_mc.rEye_mc.eye_mc.hitTest(test_mc) && (sideHP.rEye_mc > 0)) {
initHurtFlasher(_mc.rEye_mc);
lastDamaged = "rEye_mc";
return(this);
}
}
function takeDamageSubclass() {
shootCounter = shootCounterReset;
sideHP[lastDamaged]--;
if (sideHP[lastDamaged] <= 0) {
_mc[lastDamaged].eye_mc.gotoAndStop("dead");
_mc[lastDamaged].stop();
} else {
_mc[lastDamaged].eye_mc.gotoAndPlay("hurt");
}
_mc.mouth_mc.gotoAndPlay("hurt");
shotsPerRound++;
}
function updateDead() {
GlobalData.subsublevel = 4;
_root.gotoAndStop("cutScene");
}
function shoot() {
blowing = false;
trace("BossNebulon::shoot()");
var _local2 = new Object();
_local2.x = _mc.mouth_mc._x;
_local2.y = _mc.mouth_mc._y;
_mc.localToGlobal(_local2);
StinkoGame.bullet_mc.globalToLocal(_local2);
var _local3 = new Bullet("Bullet8", _local2.x, _local2.y, -12, Math.floor((Math.random() * 24) - 12), false);
shootCounter = shootCounterReset;
shotsLeft--;
if (shotsLeft > 0) {
_mc.mouth_mc.gotoAndPlay("attack");
} else {
_mc.mouth_mc.gotoAndStop("closed");
}
}
function step() {
_mc.lFoot_mc.play();
_mc.rFoot_mc.play();
_mc._x = _mc._x + (velX * walkDir);
if ((_mc._x < lLimit) || (_mc._x > rLimit)) {
walkDir = -walkDir;
_mc._x = _mc._x + (velX * walkDir);
pauseCounter = 24;
}
}
function blow() {
blowing = true;
shootCounter = shootCounterReset;
}
}
Symbol 1203 MovieClip [__Packages.BossTornado] Frame 0
class BossTornado extends Boss
{
var hitPoints, facingDir, _mc, currentMode, modeCounter, shotsLeft, shotsPerRound, initHurtFlasher, blowTimer, blowDir, passCounter, lightningStormCounter, invincibleCounterReset, invincibleCounter;
function BossTornado (parent_mc) {
super(parent_mc, "BossTornado_mc");
hitPoints = 14;
facingDir = "left";
_mc._x = 275;
_mc._y = 200;
currentMode = "waiting";
modeCounter = 30;
shotsLeft = (shotsPerRound = 3);
initHurtFlasher(_mc.animator_mc.eyeClip_mc);
blowTimer = 60;
blowDir = 0;
passCounter = 3;
lightningStormCounter = 0;
invincibleCounterReset = 48;
_mc.mBoss = this;
}
function update() {
StinkoGame.player1.getBlown(4 * blowDir);
StinkoGame.sScrollC.nudge(10 * blowDir, 0);
StinkoGame.sScrollB.nudge(5 * blowDir, 0);
if (lightningStormCounter > 0) {
lightningStormCounter--;
if (lightningStormCounter == 0) {
_mc.animator_mc.play();
StinkoGame._mc.gameStage_mc.colorTo(undefined, 0.3, "linear");
StinkoGame.sScrollA.parentClip.colorTo(undefined, 0.3, "linear");
}
}
if (lightningStormCounter == 40) {
var _local5 = StinkoGame.viewBox.r - StinkoGame.viewBox.l;
var _local2 = 0;
while (_local2 < 5) {
var _local3 = StinkoGame.viewBox.l + ((_local5 / 6) * (_local2 + 1));
var _local4 = new Bullet("Bullet11", _local3, -5, 0, 20, false, 0, false);
_local2++;
}
}
if (lightningStormCounter == 0) {
modeCounter--;
if (modeCounter < 0) {
nextMode();
}
}
}
function playerDangerTest(test_mc) {
if (_mc.animator_mc.tornado_mc.hitTestB_mc.hitTest(test_mc) || (_mc.animator_mc.tornado_mc.hitTestA_mc.hitTest(test_mc))) {
return(this);
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
if (_mc.animator_mc.tornado_mc.eyes_mc.hitTest(test_mc) && (invincibleCounter <= 0)) {
return(true);
}
}
function halfwayPointReached() {
passCounter--;
if (passCounter == 0) {
passCounter = 3;
_mc.animator_mc.stop();
StinkoGame.sScrollA.parentClip.colorTo(6710886, 0.3, "linear");
StinkoGame._mc.gameStage_mc.colorTo(3355443, 0.3, "linear");
lightningStormCounter = 64;
}
}
function takeDamageSubclass() {
if (hitPoints == 4) {
shotsPerRound = 5;
}
}
function updateDead() {
GlobalData.subsublevel = 4;
_root.gotoAndStop("cutScene");
}
function updateFacingDir() {
_mc.gotoAndStop(facingDir);
}
function switchFacingDir() {
if (facingDir == "right") {
facingDir = "left";
} else {
facingDir = "right";
}
updateFacingDir();
}
function nextMode() {
trace("BossTornado::nextMode(): " + currentMode);
switch (currentMode) {
case "waiting" :
currentMode = "shooting";
shotsLeft = shotsPerRound;
shoot();
break;
case "shooting" :
shoot();
break;
case "moving" :
switchFacingDir();
currentMode = "waiting";
modeCounter = 30;
if (facingDir == "right") {
blowDir = -1;
} else {
blowDir = 1;
}
break;
default :
trace("BossTornado::nextMode(): ERROR - bad currentMode " + currentMode);
}
}
function shoot() {
if (shotsLeft > 0) {
var _local3;
var _local2 = new Object({x:_mc.animator_mc.tornado_mc._x, y:_mc.animator_mc.tornado_mc._y});
_mc.animator_mc.localToGlobal(_local2);
_mc.bullet_mc.globalToLocal(_local2);
if (facingDir == "right") {
_local3 = (shotsLeft / 2) * 5;
} else {
_local3 = (shotsLeft / 2) * -5;
}
var _local4 = new Bullet("Bullet9", _local2.x, _local2.y, _local3, -20, false, 2, false);
shotsLeft--;
modeCounter = 10;
} else {
currentMode = "moving";
modeCounter = 99;
blowDir = 0;
_mc.animator_mc.play();
}
}
}
Symbol 1204 MovieClip [__Packages.BossIceMachine] Frame 0
class BossIceMachine extends Boss
{
var hitPoints, _mc, modesArray, currentMode, modeCounter, shotsLeft, shotsPerRound, nextShotCounter, initHurtFlasher, velY, eyesClosed, waitingForIcicles, invincibleCounter;
function BossIceMachine (parent_mc) {
super(parent_mc, "BossIceMachine_mc");
hitPoints = 7;
trace("BossIceMachine::instantiated: " + _mc._name);
modesArray = new Array("waitingA", "cubing", "waitingB", "churning");
currentMode = -1;
modeCounter = 20;
shotsLeft = (shotsPerRound = 3);
nextShotCounter = 10;
initHurtFlasher(_mc.body_mc);
_mc._y = _mc._y - 500;
velY = 10;
trace("BossIceMachine::finalRestingPlace is " + _mc._y);
_mc.mBoss = this;
_mc.motor_mc.stop();
_mc.mouth_mc.stop();
_mc.iceShot0.stop();
_mc.iceShot1.stop();
_mc.iceShot2.stop();
_mc.iceShot3.stop();
_mc.iceShot4.stop();
_mc.eyes_mc.stop();
eyesClosed = false;
waitingForIcicles = false;
}
function update() {
if (_mc._y > -72) {
_mc._y = -72;
var _local3 = new CameraEffectShake(_root, 12, 4);
} else if (_mc._y < -72) {
_mc._y = _mc._y + velY;
velY = velY + 1;
}
modeCounter--;
if (modeCounter < 0) {
nextMode();
}
if (modesArray[currentMode] == "cubing") {
nextShotCounter--;
if (nextShotCounter < 0) {
shootCube();
}
}
}
function playerDangerTest(test_mc) {
if ((_mc.blastA_mc.hitTest(test_mc) || (_mc.blastA_mc.hitTest(test_mc))) || (_mc.bodyShot_mc.hitTest(test_mc))) {
return(this);
}
var _local2 = 0;
while (_local2 < 5) {
if (_mc["iceShot" + _local2].hitTest(test_mc)) {
return(this);
}
_local2++;
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
if (((!eyesClosed) && (_mc.eyes_mc.hitTest(test_mc))) && (invincibleCounter <= 0)) {
return(true);
}
}
function takeDamageSubclass() {
_mc.eyes_mc.gotoAndPlay("hurt");
eyesClosed = true;
if ((hitPoints == 5) || (hitPoints == 3)) {
shotsPerRound = 4;
}
if (hitPoints == 4) {
shotsPerRound = 3;
}
if (hitPoints == 2) {
shotsPerRound = 2;
}
if (hitPoints == 1) {
shotsPerRound = 4;
}
}
function updateDead() {
GlobalData.subsublevel = 4;
_root.gotoAndStop("cutScene");
}
function nextMode() {
trace("BossIceMachine::nextMode(): " + currentMode);
currentMode++;
if (currentMode >= modesArray.length) {
currentMode = 0;
}
switch (modesArray[currentMode]) {
case "waitingA" :
modeCounter = 30;
startWait();
break;
case "cubing" :
startShootCubeMode();
break;
case "waitingB" :
startWaitB();
modeCounter = 34 + (hitPoints * 2);
break;
case "churning" :
startChurnMode();
}
}
function shootCube() {
nextShotCounter = 30 + (hitPoints * 2);
shotsLeft--;
_mc["iceShot" + shotsLeft].gotoAndPlay("go");
if (shotsLeft < 0) {
nextMode();
}
}
function startWait() {
if (!eyesClosed) {
_mc.eyes_mc.gotoAndPlay("close");
}
_mc.motor_mc.stop();
}
function startWaitB() {
_mc.motor_mc.stop();
_mc.blastA_mc.gotoAndStop("off");
_mc.blastB_mc.gotoAndStop("off");
_mc.eyes_mc.gotoAndPlay("open");
eyesClosed = false;
}
function startShootCubeMode() {
modeCounter = 2000;
shotsLeft = shotsPerRound;
shootCube();
_mc.motor_mc.play();
_mc.blastA_mc.gotoAndStop("on");
_mc.blastB_mc.gotoAndStop("on");
}
function startChurnMode() {
modeCounter = 2000;
_mc.motor_mc.play();
_mc.door_mc.gotoAndPlay("open");
}
function fireChurn() {
var _local6 = (StinkoGame.viewBox.r - StinkoGame.viewBox.l) - 100;
var _local5 = Math.floor(Math.random() * 40);
var _local2 = 0;
while (_local2 < 5) {
var _local3 = (_local5 + StinkoGame.viewBox.l) + ((_local6 / 5) * _local2);
var _local4 = new BulletIcicle("Bullet14", _local3, -5, 0, 12, false, 0, false);
_local2++;
}
waitingForIcicles = true;
}
function getIciclesDoneMessage() {
if (!waitingForIcicles) {
return(undefined);
}
waitingForIcicles = false;
nextMode();
}
}
Symbol 1205 MovieClip [__Packages.BulletIcicle] Frame 0
class BulletIcicle extends Bullet
{
var _mc, xVel, yVel, active;
function BulletIcicle (symbolName, start_x, start_y, pxVel, pyVel, pFriendly, pGrav, pDeflectable) {
super(symbolName, start_x, start_y, pxVel, pyVel, pFriendly, pGrav, pDeflectable);
_mc.animator_mc.stop();
_mc.mBullet = this;
}
function subClassUpdate() {
if (_mc._y > (StinkoGame.viewBox.b - 55)) {
xVel = 0;
yVel = 0;
trace("BulletIcicle::subclassUpdate" + _mc.animator_mc._name);
_mc.animator_mc.gotoAndPlay("smash");
StinkoGame.bossMan.getIciclesDoneMessage();
active = false;
delete _mc.onEnterFrame;
}
}
}
Symbol 1206 MovieClip [__Packages.BossNegative] Frame 0
class BossNegative extends Boss
{
var hitPoints, initHurtFlasher, _mc, animState, waitCounterMax, currentStepDirection, stagePos, nextPhaseIsRoar, fridgeCounter, fridgeCounterMax, nextHeartDirection, invincibleCounterReset, damageClips, waitCounter, fridgeOpen, invincibleCounter, fridgeDirection;
function BossNegative (parent_mc) {
super(parent_mc, "BossNegative_mc");
hitPoints = 6;
initHurtFlasher(_mc.body_mc.bossHeart_mc.ham_mc);
_mc.mBoss = this;
_mc.gotoAndPlay("entrance");
animState = "enter";
waitCounterMax = 25;
currentStepDirection = -1;
stagePos = 0;
nextPhaseIsRoar = false;
fridgeCounter = (fridgeCounterMax = 84);
nextHeartDirection = "Right";
_mc._x = 300;
_mc._y = 190;
invincibleCounterReset = 36;
damageClips = new Array();
damageClips.push("forkA");
damageClips.push("forkB");
damageClips.push("spikeA");
damageClips.push("spikeB");
damageClips.push("blockA");
damageClips.push("blockB");
}
function update() {
switch (animState) {
case "enter" :
break;
case "roar" :
break;
case "wait" :
waitCounter--;
if (waitCounter < 0) {
nextPhase();
}
break;
case "stepping" :
}
if (animState != "enter") {
fridgeCounter--;
if (fridgeCounter < 0) {
if (fridgeOpen) {
closeFridge();
} else if (animState != "roar") {
openFridge();
}
}
}
var _local2 = BulletFriendly.anyDeflect(_mc.body_mc.bossHeart_mc.door_mc);
if (_local2 != undefined) {
_local2.deflect();
}
}
function shootA() {
trace("BossNegative::shootA() called");
}
function shootB() {
trace("BossNegative::shootB() called");
}
function shoot(IDNum) {
var _local3 = _mc["dometant" + IDNum];
var _local2 = new Object({x:_local3._x, y:_local3._y});
_mc.localToGlobal(_local2);
StinkoGame._mc.bullet_mc.globalToLocal(_local2);
if (IDNum < 2) {
var _local8 = new Bullet("Bullet2", _local2.x, _local2.y + 15, -8, 0, false, 0, false);
var _local7 = new Bullet("Bullet2", _local2.x, _local2.y + 15, 8, 0, false, 0, false);
var _local6 = new Bullet("Bullet2", _local2.x, _local2.y + 15, 8, 8, false, 0, false);
var _local5 = new Bullet("Bullet2", _local2.x, _local2.y + 15, -8, 8, false, 0, false);
var _local4 = new Bullet("Bullet2", _local2.x, _local2.y + 15, 0, 8, false, 0, false);
} else {
var _local8 = new Bullet("Bullet2", _local2.x, _local2.y - 15, -8, 0, false, 0, false);
var _local7 = new Bullet("Bullet2", _local2.x, _local2.y - 15, 8, 0, false, 0, false);
var _local6 = new Bullet("Bullet2", _local2.x, _local2.y - 15, 8, -8, false, 0, false);
var _local5 = new Bullet("Bullet2", _local2.x, _local2.y - 15, -8, -8, false, 0, false);
var _local4 = new Bullet("Bullet2", _local2.x, _local2.y - 15, 0, -8, false, 0, false);
}
}
function playerDangerTest(test_mc) {
var _local2 = 0;
while (_local2 < damageClips.length) {
if (_mc[damageClips[_local2]].hitTest(test_mc)) {
return(this);
}
_local2++;
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
if ((_mc.body_mc.bossHeart_mc.ham_mc.hitTest(test_mc) && (invincibleCounter <= 0)) && (fridgeOpen)) {
return(true);
}
}
function nextPhase() {
if (nextPhaseIsRoar) {
roar();
} else {
startStep();
}
}
function takeDamageSubclass() {
waitCounterMax = waitCounterMax - 4;
if (waitCounterMax < 5) {
waitCounterMax = 5;
}
if (fridgeOpen) {
fridgeCounter = 8;
}
if (hitPoints > 2) {
nextPhaseIsRoar = true;
}
if (nextHeartDirection == "Left") {
nextHeartDirection = "Right";
} else {
nextHeartDirection = "Left";
}
}
function startStep() {
if (stagePos < -6) {
currentStepDirection = 1;
}
if (stagePos >= 0) {
currentStepDirection = -1;
}
if (currentStepDirection < 0) {
_mc.gotoAndPlay("stepLeft");
} else {
_mc.gotoAndPlay("stepRight");
}
animState = "stepping";
}
function updateDead() {
GlobalData.subsublevel = 4;
_root.gotoAndStop("cutScene");
}
function entranceFinished() {
_mc.body_mc.bossHeart_mc.stop();
_mc.dometant0.mDometantID = 0;
_mc.dometant1.mDometantID = 1;
_mc.dometant2.mDometantID = 2;
_mc.dometant3.mDometantID = 3;
_mc.dometant2.gotoAndPlay(45);
_mc.dometant3.gotoAndPlay(45);
roar();
}
function roarFinished() {
wait();
}
function stepFinished() {
_mc._x = _mc._x + (32 * currentStepDirection);
stagePos = stagePos + currentStepDirection;
wait();
}
function roar() {
nextPhaseIsRoar = false;
animState = "roar";
_mc.gotoAndPlay("roar");
}
function wait() {
_mc.gotoAndStop("wait");
animState = "wait";
waitCounter = waitCounterMax;
}
function setFridgeOpen(newVal, pFridgeDir) {
trace((("BossNegative::setFridgeOpen " + newVal) + ",") + pFridgeDir);
fridgeOpen = newVal;
fridgeDirection = pFridgeDir;
}
function openFridge() {
fridgeCounter = fridgeCounterMax / 2;
_mc.body_mc.bossHeart_mc.gotoAndPlay("open" + nextHeartDirection);
}
function closeFridge() {
fridgeCounter = fridgeCounterMax;
_mc.body_mc.bossHeart_mc.play();
}
}
Symbol 1207 MovieClip [__Packages.BossGangster] Frame 0
class BossGangster extends Boss
{
var _mc, initHurtFlasher, swingUp, shootTimer, hitPoints, mouthOpen, mouthTimer, mouthTimerReset, invincibleCounterReset, lunging, lungingLeft, lungeTimer, lungeTimerReset, entranceFinished, invincibleCounter;
function BossGangster (parent_mc) {
super(parent_mc, "BossGangster_mc");
_mc.mBoss = this;
trace("BossGangster::instantiated " + _mc._name);
_mc._y = 500;
_mc._x = 200;
initHurtFlasher(_mc.head_mc);
swingUp = true;
shootTimer = 20;
hitPoints = 15;
mouthOpen = false;
mouthTimer = (mouthTimerReset = 40);
invincibleCounterReset = 16;
lunging = false;
lungingLeft = true;
lungeTimer = (lungeTimerReset = 200);
}
function update() {
if (!entranceFinished) {
var _local2 = new Object({x:StinkoGame.viewBox.r - 100, y:StinkoGame.viewBox.t + ((StinkoGame.viewBox.b - StinkoGame.viewBox.t) / 2)});
_mc._parent.globalToLocal(_local2);
_mc._x = _mc._x - ((_mc._x - _local2.x) / 2);
_mc._y = _mc._y - ((_mc._y - _local2.y) / 2);
if ((Math.abs(_mc._x - _local2.x) < 10) && (Math.abs(_mc._y - _local2.y) < 10)) {
entranceFinished = true;
trace("EnemyManta:update() entranceFinished = true");
swingInNewDirection();
}
} else {
mouthTimer--;
if (mouthTimer < 0) {
mouthTriggered();
}
if (!lunging) {
lungeTimer--;
if (lungeTimer < 0) {
lunging = true;
lungeTriggered();
}
shootTimer--;
if (shootTimer < 0) {
startShootSequence();
}
}
}
}
function swingInNewDirection() {
swingUp = !swingUp;
var _local2 = getTargetSwingPoint();
_mc.tween("_y", _local2.y, 2, "easeInQuad", 0, {scope:this, func:"swingInNewDirection"}, 1);
}
function getTargetSwingPoint() {
var _local2;
if (swingUp) {
_local2 = new Object({x:0, y:StinkoGame.viewBox.t + 80});
} else {
_local2 = new Object({x:0, y:StinkoGame.viewBox.b - 80});
}
_mc._parent.globalToLocal(_local2);
return(_local2);
}
function playerDangerTest(test_mc) {
if (_mc.hitTest_mc.hitTest(test_mc) || (_mc.head_mc.hitTest(test_mc))) {
return(this);
}
return(undefined);
}
function hurtByPlayerTest(test_mc) {
if (invincibleCounter > 0) {
return(undefined);
}
if (_mc.head_mc.hurtTest_mc.hitTest(test_mc)) {
return(this);
}
}
function takeDamageSubclass() {
mouthTimerReset--;
lungeTimerReset = lungeTimerReset - 5;
mouthTriggered();
}
function updateDead() {
GlobalData.subsublevel = 4;
_root.gotoAndStop("cutScene");
}
function shoot() {
var _local2 = new Object();
_local2.x = _mc.torso_mc.gunshot_mc._x;
_local2.y = _mc.torso_mc.gunshot_mc._y;
_mc.torso_mc.localToGlobal(_local2);
StinkoGame.bullet_mc.globalToLocal(_local2);
var _local3 = new Bullet("Bullet19", _local2.x, _local2.y, -12, Math.floor((Math.random() * 24) - 12), false);
}
function startShootSequence() {
shootTimer = 55;
_mc.torso_mc.gotoAndPlay("shoot");
}
function mouthTriggered() {
mouthOpen = !mouthOpen;
if (mouthOpen) {
_mc.head_mc.gotoAndStop("open");
mouthTimer = mouthTimerReset;
} else {
_mc.head_mc.gotoAndStop("closed");
mouthTimer = Math.floor(Math.random() * 30) + 10;
}
}
function lungeTriggered() {
_mc.stopTween();
var _local2 = new Object();
var _local5;
var _local3;
var _local4;
if (lungingLeft) {
_local2 = new Object({x:StinkoGame.viewBox.l + 20, y:0});
_local5 = "easeInSine";
_local4 = "lungeTriggered";
_local3 = 0.5;
} else {
_local2 = new Object({x:StinkoGame.viewBox.r - 100, y:0});
_local5 = "linear";
_local4 = "lungeEnded";
_local3 = 0;
}
_mc._parent.globalToLocal(_local2);
_mc.tween("_x", _local2.x, 1, "easeInSine", _local3, {scope:this, func:_local4});
lungingLeft = !lungingLeft;
}
function lungeEnded() {
lunging = false;
lungeTimer = lungeTimerReset;
lungingLeft = true;
swingInNewDirection();
}
}
Symbol 1208 MovieClip [__Packages.JumpingGame] Frame 0
class JumpingGame
{
static var _mc, direction, viewBox, player1, gameSound, inProgress;
function JumpingGame (p_mc, viewBox_mc) {
var thisJumpingGame = this;
_mc = p_mc;
GlobalData.items = 0;
Interface.update();
if (GlobalData.subsublevel == 1) {
direction = "up";
} else {
direction = "down";
}
viewBox = new Object();
viewBox.l = viewBox_mc._x;
viewBox.t = viewBox_mc._y;
viewBox.r = viewBox_mc._x + viewBox_mc._width;
viewBox.b = viewBox_mc._y + viewBox_mc._height;
_root.skyA_mc.attachMovie("jumpingSky", "jumpingSky", 0);
var _local4;
_local4 = _mc.playerClip_mc.attachMovie("playerRegular", "playerClip", 1);
player1 = new JumpingPlayer(_local4, viewBox.l, viewBox.r, direction);
gameSound = new SoundTrack(_mc);
gameSound.startFromBeginning();
inProgress = true;
_mc.onEnterFrame = function () {
thisJumpingGame.update();
};
}
function update() {
if (!inProgress) {
return(undefined);
}
if (direction == "up") {
updateUp();
} else {
updateDown();
}
cloudPopCounter--;
var _local3 = this;
if (cloudPopCounter < 0) {
cloudPopCounter = Math.floor(Math.random() * 25);
var _local2 = _mc.gameStage_mc.attachMovie("cloud_mc", "cloud_mc" + cloudDepthCounter, cloudDepthCounter++);
if (cloudDepthCounter > 300) {
cloudDepthCounter = 101;
}
_local2.gotoAndStop(Math.floor(Math.random() * _local2._totalframes) + 1);
_local2._x = Math.floor(Math.random() * (viewBox.r - viewBox.l));
if (direction == "up") {
_local2._y = viewBox.t - 40;
} else {
_local2._y = viewBox.b + 40;
}
_local2.onEnterFrame = function () {
if (JumpingGame.direction == "up") {
this._y = this._y + 10;
if (this._y > (JumpingGame.viewBox.b + 20)) {
this.removeMovieClip();
}
} else {
this._y = this._y - 10;
if (this._y < (JumpingGame.viewBox.t - 20)) {
this.removeMovieClip();
}
}
};
}
}
static function updateUp() {
dropPopCounter--;
if (dropPopCounter < 0) {
dropPopCounter = Math.floor(Math.random() * 25) + 5;
new Drop(_mc.gameStage_mc);
}
buzzPopCounter--;
if (buzzPopCounter < 0) {
buzzPopCounter = Math.floor(Math.random() * 25) + 25;
new CloudBuzzer(_mc.gameStage_mc);
}
}
static function updateDown() {
foodCounter--;
if (foodCounter < 0) {
trace("JumpingGame::updateDown(): popping a food");
foodCounter = Math.floor(Math.random() * 3) + 2;
var _local1 = Math.floor(Math.random() * 6);
if (_local1 == 5) {
_local1 = 0;
}
new JumpingFood(_mc.gameStage_mc, _local1);
}
}
static function loseLife() {
trace("Totally died. Please play end level animation!");
inProgress = false;
delete player1._mc.onEnterFrame;
player1._mc.stop();
player1._mc.gotoAndStop("youDead_" + player1.facingDir);
gameSound.stop();
}
static function doneDying() {
if (GlobalData.mans > 0) {
player1.reset();
gameSound.startFromBeginning();
JumpingEnemy.resetEnemies();
inProgress = true;
Interface.update();
} else {
_root.gotoAndPlay("gameOver");
}
}
static function doneAscending() {
GlobalData.levelUp();
gameSound.stop();
_root.gotoAndPlay("cutScene");
}
static function doneDescending() {
GlobalData.levelUp();
gameSound.stop();
_root.gotoAndPlay("cutScene");
delete _mc.onEnterFrame;
}
static var depthCounter = 301;
static var cloudPopCounter = 0;
static var cloudDepthCounter = 101;
static var dropPopCounter = 0;
static var buzzPopCounter = 0;
static var foodCounter = 0;
}
Symbol 1209 MovieClip [__Packages.JumpingPlayer] Frame 0
class JumpingPlayer
{
var lLimit, rLimit, incrSpeed, maxSpeed, shadowArray, direction, _mc, xVel, facingDir, punching, invincibleCounter, hitRecoverCounter;
function JumpingPlayer (p_mc, plLimit, prLimit, pDirection) {
lLimit = plLimit;
rLimit = prLimit;
incrSpeed = 3;
maxSpeed = 12;
shadowArray = new Array();
direction = pDirection;
_mc = p_mc;
_mc.gameMode = "jumping";
reset();
}
function reset() {
var thisJumpingPlayer = this;
xVel = 0;
facingDir = "right";
_mc._x = lLimit + ((rLimit - lLimit) / 2);
if (direction == "up") {
_mc._y = 233;
} else {
_mc._y = 150;
}
_mc.gotoAndStop("jump_" + facingDir);
punching = false;
GlobalData.hits = 4;
GlobalData.items = 0;
Interface.update();
invincibleCounter = 0;
hitRecoverCounter = 0;
_mc.onEnterFrame = function () {
thisJumpingPlayer.update();
};
}
function update() {
updateShadow();
updateCounters();
if (hitRecoverCounter <= 0) {
if (Key.isDown(39)) {
moveRight();
} else if (Key.isDown(37)) {
moveLeft();
}
if (Key.isDown(83)) {
punching = true;
} else {
punching = false;
}
if (punching) {
_mc.gotoAndStop("jumppunch_" + facingDir);
} else {
_mc.gotoAndStop("jump_" + facingDir);
}
}
_mc._x = _mc._x + xVel;
if (_mc._x < lLimit) {
_mc._x = _mc._x - xVel;
xVel = xVel - xVel;
}
if (_mc._x > rLimit) {
_mc._x = _mc._x - xVel;
xVel = xVel - xVel;
}
xVel = xVel * deceleration;
testForDamage();
if (punching) {
testForPopDrop();
}
}
function moveRight() {
facingDir = "right";
_mc.animator_mc.play();
xVel = xVel + incrSpeed;
if (xVel > maxSpeed) {
xVel = maxSpeed;
}
}
function moveLeft() {
facingDir = "left";
_mc.animator_mc.play();
xVel = xVel - incrSpeed;
if (xVel < (-maxSpeed)) {
xVel = -maxSpeed;
}
}
function updateShadow() {
var _local4 = this;
shadowTimeCounter--;
if (shadowTimeCounter <= 0) {
shadowTimeCounter = 5;
var _local3 = _root.gameStage_mc.attachMovie("jumpShadow", "jumpShadow" + shadowDepthCounter, shadowDepthCounter++);
_local3._x = _mc._x;
_local3._y = _mc._y;
_local3._alpha = 50;
_local3.gotoAndStop(facingDir);
if (shadowDepthCounter >= 100) {
shadowDepthCounter = 0;
}
if (direction == "up") {
_local3.onEnterFrame = function () {
this._y = this._y + 20;
if (this._y > 500) {
this.removeMovieClip();
}
};
} else {
_local3.onEnterFrame = function () {
this._y = this._y - 20;
if (this._y < -50) {
this.removeMovieClip();
}
};
}
}
}
function testForDamage() {
if (invincibleCounter > 0) {
return(undefined);
}
if (direction == "up") {
var _local2 = 0;
while (_local2 < JumpingEnemy.enemyArray.length) {
if (JumpingEnemy.enemyArray[_local2].hurtPlayer(_mc.hitTestHurt_mc)) {
if (JumpingEnemy.enemyArray[_local2].mType == 1) {
takeDamage();
} else {
testForCollect(JumpingEnemy.enemyArray[_local2]);
}
}
_local2++;
}
}
}
function takeDamage(fromRight) {
trace(("takeDamage(" + fromRight) + ")");
hitRecoverCounter = 24;
invincibleCounter = 48;
punching = false;
if (facingDir == "right") {
xVel = -20;
} else {
xVel = 20;
}
_mc.gotoAndStop("hit_" + facingDir);
_mc.animator_mc.play();
GlobalData.hits--;
Interface.update();
if (GlobalData.hits == 0) {
endLife();
}
}
function updateCounters() {
if (hitRecoverCounter > 0) {
hitRecoverCounter--;
if (hitRecoverCounter == 0) {
_mc.gotoAndStop("wait_" + facingDir);
}
}
if (invincibleCounter > 0) {
invincibleCounter--;
if (((invincibleCounter % 6) == 0) && (hitRecoverCounter <= 0)) {
_mc._visible = false;
} else {
_mc._visible = true;
}
if (invincibleCounter == 0) {
_mc._visible = true;
}
}
}
function endLife() {
GlobalData.mans--;
GlobalData.hits = 0;
Interface.update();
JumpingGame.loseLife();
}
function testForPopDrop() {
var _local2 = 0;
while (_local2 < JumpingEnemy.enemyArray.length) {
if ((JumpingEnemy.enemyArray[_local2].mType == 0) && (JumpingEnemy.enemyArray[_local2].hurtPlayer(_mc.wave_mc))) {
JumpingEnemy.enemyArray[_local2].pop();
}
_local2++;
}
}
function testForCollect(dropObj) {
trace((("JumpingPlayer::testForCollect: " + dropObj._mc._name) + " is collectible = ") + dropObj.popped);
if (dropObj.popped) {
GlobalData.items++;
Interface.update();
dropObj._mc.gotoAndPlay("shineGet");
if (GlobalData.items >= 20) {
JumpingGame.doneAscending();
}
}
}
var deceleration = 0.8;
var shadowDepthCounter = 0;
var shadowTimeCounter = 5;
}
Symbol 1210 MovieClip [__Packages.JumpingEnemy] Frame 0
class JumpingEnemy
{
static var enemyArray;
var stage_mc, _mc;
function JumpingEnemy (pStage_mc, clipname) {
if ((enemyArray == undefined) || (enemyArray.length == 0)) {
enemyArray = new Array();
}
var thisJumpingEnemy = this;
stage_mc = pStage_mc;
_mc = stage_mc.attachMovie(clipname, "JumpingEnemy" + JumpingGame.depthCounter, JumpingGame.depthCounter++);
if (JumpingGame.depthCounter > 600) {
JumpingGame.depthCounter = 301;
}
_mc.onEnterFrame = function () {
thisJumpingEnemy.update();
};
enemyArray.push(this);
}
function update() {
}
function clearFromObjectsArray() {
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2] == this) {
enemyArray.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function kill() {
clearFromObjectsArray();
_mc.removeMovieClip();
}
function hurtPlayer(test_mc) {
return(_mc.hitArea_mc.hitTest(test_mc));
}
static function resetEnemies() {
var _local1 = 0;
while (_local1 < enemyArray.length) {
enemyArray[_local1]._mc.removeMovieClip();
delete enemyArray[_local1];
_local1++;
}
enemyArray = new Array();
}
}
Symbol 1211 MovieClip [__Packages.Drop] Frame 0
class Drop extends JumpingEnemy
{
var _mc, mType;
function Drop (pStage_mc) {
super(pStage_mc, "dropCloudBaddie");
_mc._x = Math.floor(Math.random() * (JumpingGame.viewBox.r - JumpingGame.viewBox.l));
_mc._y = JumpingGame.viewBox.t - 40;
popped = false;
collectable = false;
mType = 0;
_mc.myDrop = this;
}
function update() {
_mc._y = _mc._y + 15;
if (_mc._y > (JumpingGame.viewBox.b + 20)) {
trace(("Drop " + _mc._name) + " out of range ");
_mc.removeMovieClip();
}
}
function pop() {
if (!popped) {
_mc.gotoAndPlay("splish");
popped = true;
delete _mc.onEnterFrame;
}
}
function collect() {
}
var popped = false;
var collectable = false;
}
Symbol 1212 MovieClip [__Packages.CloudBuzzer] Frame 0
class CloudBuzzer extends JumpingEnemy
{
var _mc, mType, kill;
function CloudBuzzer (pStage_mc) {
super(pStage_mc, "cloudBuzzer_mc");
_mc._x = Math.floor(Math.random() * (JumpingGame.viewBox.r - JumpingGame.viewBox.l));
_mc._y = JumpingGame.viewBox.b + 40;
mType = 1;
}
function update() {
_mc._y = _mc._y - 6;
var _local2 = _mc._parent._parent.player_mc;
if ((_local2._x - 10) > _mc._x) {
_mc._x = _mc._x + 3;
} else {
_mc._x = _mc._x - 3;
}
if (_mc._y < (JumpingGame.viewBox.t - 20)) {
kill();
}
}
}
Symbol 1213 MovieClip [__Packages.JumpingFood] Frame 0
class JumpingFood extends JumpingEnemy
{
var _mc, foodType, eaten, mType;
function JumpingFood (pStage_mc, whichNum) {
super(pStage_mc, "descent" + whichNum);
_mc._x = Math.floor(Math.random() * (JumpingGame.viewBox.r - JumpingGame.viewBox.l));
_mc._y = JumpingGame.viewBox.b + 40;
foodType = whichNum;
eaten = false;
mType = 2;
_mc.mFood = this;
}
function update() {
_mc._y = _mc._y - 15;
if (_mc._y < (JumpingGame.viewBox.t - 50)) {
trace(("JumpingFood " + _mc._name) + " out of range ");
_mc.removeMovieClip();
}
if ((!eaten) && (JumpingGame.player1._mc.hitTestHurt_mc.hitTest(_mc))) {
if (foodType == 0) {
GlobalData.items++;
if (GlobalData.items >= 10) {
JumpingGame.doneDescending();
}
} else {
GlobalData.items--;
if (GlobalData.items <= 0) {
GlobalData.items = 0;
}
}
eatMe();
Interface.update();
}
}
function eatMe() {
if (!eaten) {
_mc.gotoAndPlay("chomp");
eaten = true;
delete _mc.onEnterFrame;
}
}
function collect() {
}
}
Symbol 1214 MovieClip [__Packages.com.robertpenner.easing.Quad] Frame 0
class com.robertpenner.easing.Quad
{
function Quad () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static function easeOutIn(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
t--;
return((((-c) / 2) * ((t * t) - 1)) + b);
}
t--;
return(((c / 2) * ((t * t) + 1)) + b);
}
}
Symbol 1215 MovieClip [__Packages.com.robertpenner.easing.Circ] Frame 0
class com.robertpenner.easing.Circ
{
function Circ () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((-c) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * Math.sqrt(1 - (t * t))) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
t = t - 2;
return(((c / 2) * (Math.sqrt(1 - (t * t)) + 1)) + b);
}
static function easeOutIn(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
t--;
return(((c / 2) * Math.sqrt(1 - (t * t))) + b);
}
t--;
return(((c / 2) * (2 - Math.sqrt(1 - (t * t)))) + b);
}
}
Symbol 1216 MovieClip [__Packages.com.robertpenner.easing.Quart] Frame 0
class com.robertpenner.easing.Quart
{
function Quart () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((((c * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return(((-c) * ((((t * t) * t) * t) - 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
t = t - 2;
return((((-c) / 2) * ((((t * t) * t) * t) - 2)) + b);
}
static function easeOutIn(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
t--;
return((((-c) / 2) * ((((t * t) * t) * t) - 1)) + b);
}
t--;
return(((c / 2) * ((((t * t) * t) * t) + 1)) + b);
}
}
Symbol 1217 MovieClip [__Packages.com.robertpenner.easing.Sine] Frame 0
class com.robertpenner.easing.Sine
{
function Sine () {
}
static function easeIn(t, b, c, d) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
}
static function easeOut(t, b, c, d) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
}
static function easeInOut(t, b, c, d) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
}
static function easeOutIn(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * Math.sin((Math.PI * t) / 2)) + b);
}
t--;
return((((-c) / 2) * (Math.cos((Math.PI * t) / 2) - 2)) + b);
}
}
Symbol 1218 MovieClip [__Packages.com.robertpenner.easing.Back] Frame 0
class com.robertpenner.easing.Back
{
function Back () {
}
static function easeIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static function easeOutIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
t--;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
t--;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) - s)) + 1)) + b);
}
}
Symbol 1219 MovieClip [__Packages.com.robertpenner.easing.Quint] Frame 0
class com.robertpenner.easing.Quint
{
function Quint () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static function easeOutIn(t, b, c, d) {
t = t / (d / 2);
t--;
return(((c / 2) * (((((t * t) * t) * t) * t) + 1)) + b);
}
}
Symbol 1220 MovieClip [__Packages.com.robertpenner.easing.Linear] Frame 0
class com.robertpenner.easing.Linear
{
function Linear () {
}
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 function easeOutIn(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1221 MovieClip [__Packages.com.robertpenner.easing.Expo] Frame 0
class com.robertpenner.easing.Expo
{
function Expo () {
}
static function easeIn(t, b, c, d) {
return(((t == 0) ? (b) : ((c * Math.pow(2, 10 * ((t / d) - 1))) + b)));
}
static function easeOut(t, b, c, d) {
return(((t == d) ? (b + c) : ((c * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
}
static function easeInOut(t, b, c, d) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * Math.pow(2, 10 * (t - 1))) + b);
}
t--;
return(((c / 2) * ((-Math.pow(2, -10 * t)) + 2)) + b);
}
static function easeOutIn(t, b, c, d) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * ((-Math.pow(2, -10 * t)) + 1)) + b);
}
return(((c / 2) * (Math.pow(2, 10 * (t - 2)) + 1)) + b);
}
}
Symbol 1222 MovieClip [__Packages.com.robertpenner.easing.Elastic] Frame 0
class com.robertpenner.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static function easeOutIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
return(((0.5 * ((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + (c / 2)) + b);
}
return(((c / 2) + (0.5 * ((a * Math.pow(2, 10 * (t - 2))) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)))) + b);
}
}
Symbol 1223 MovieClip [__Packages.com.robertpenner.easing.Bounce] Frame 0
class com.robertpenner.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeOutIn(t, b, c, d) {
if (t < (d / 2)) {
return((easeOut(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeIn((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
}
Symbol 1224 MovieClip [__Packages.zigo.tweenManager] Frame 0
class zigo.tweenManager
{
var playing, autoStop, broadcastEvents, autoOverwrite, ints, lockedTweens, tweenList, updateTime, tweenHolder, updateIntId, now;
function tweenManager () {
playing = false;
autoStop = false;
broadcastEvents = false;
autoOverwrite = true;
ints = new Array();
lockedTweens = new Object();
tweenList = new Array();
}
function cleanUp() {
if (!((tweenList instanceof Array) && (tweenList.length > 0))) {
return(undefined);
}
for (var _local2 in tweenList) {
if (tweenList[_local2].mc._x == undefined) {
tweenList.splice(Number(_local2), 1);
}
}
if (tweenList.length == 0) {
tweenList = [];
deinit();
}
for (var _local2 in ints) {
if ((ints[_local2] != undefined) && (ints[_local2].mc._x == undefined)) {
removeDelayedTween(Number(_local2));
}
}
}
function set updateInterval(time) {
if (playing) {
deinit();
updateTime = time;
init();
} else {
updateTime = time;
}
//return(updateInterval);
}
function get updateInterval() {
return(updateTime);
}
function set controllerDepth(v) {
if (_global.isNaN(v) == true) {
return;
}
if (tweenHolder._name != undefined) {
tweenHolder.swapDepths(v);
} else {
_th_depth = v;
}
//return(controllerDepth);
}
function get controllerDepth() {
return(_th_depth);
}
function init() {
if (updateTime > 0) {
clearInterval(updateIntId);
updateIntId = setInterval(this, "update", updateTime);
} else {
if (tweenHolder._name == undefined) {
tweenHolder = _root.createEmptyMovieClip("_th_", _th_depth);
}
var tm = this;
tweenHolder.onEnterFrame = function () {
tm.update.call(tm);
};
}
playing = true;
now = getTimer();
}
function deinit() {
playing = false;
clearInterval(updateIntId);
delete tweenHolder.onEnterFrame;
}
function update() {
var _local2;
var _local10;
var _local3;
var _local13 = false;
_local10 = tweenList.length;
if (broadcastEvents) {
var _local4;
var _local7;
var _local5;
var _local9;
_local4 = {};
_local7 = {};
_local5 = {};
_local9 = {};
}
while (_local10--) {
_local2 = tweenList[_local10];
if (_local2.mc._x == undefined) {
_local13 = true;
continue;
}
if (_local2.pt != -1) {
continue;
}
if ((_local2.ts + _local2.d) > now) {
if (_local2.ctm == undefined) {
_local2.mc[_local2.pp] = _local2.ef(now - _local2.ts, _local2.ps, _local2.ch, _local2.d, _local2.e1, _local2.e2);
} else {
var _local8 = {};
for (_local3 in _local2.ctm) {
_local8[_local3] = _local2.ef(now - _local2.ts, _local2.stm[_local3], _local2.ctm[_local3], _local2.d, _local2.e1, _local2.e2);
}
_local2.c.setTransform(_local8);
}
if (broadcastEvents) {
if (_local4[targetPath(_local2.mc)] == undefined) {
_local4[targetPath(_local2.mc)] = _local2.mc;
}
if (_local5[targetPath(_local2.mc)] == undefined) {
_local5[targetPath(_local2.mc)] = [];
}
_local5[targetPath(_local2.mc)].push(((_local2.ctm != undefined) ? "_ct_" : (_local2.pp)));
}
if (_local2.cb.updfunc != undefined) {
var _local6 = _local2.cb.updfunc;
if ((typeof(_local6) == "string") && (_local2.cb.updscope != undefined)) {
_local6 = _local2.cb.updscope[_local6];
}
_local6.apply(_local2.cb.updscope, _local2.cb.updargs);
}
} else {
if (_local2.ctm == undefined) {
_local2.mc[_local2.pp] = _local2.ps + _local2.ch;
} else {
var _local8 = {};
for (_local3 in _local2.ctm) {
_local8[_local3] = _local2.stm[_local3] + _local2.ctm[_local3];
}
_local2.c.setTransform(_local8);
}
if (broadcastEvents) {
if (_local4[targetPath(_local2.mc)] == undefined) {
_local4[targetPath(_local2.mc)] = _local2.mc;
}
if (_local7[targetPath(_local2.mc)] == undefined) {
_local7[targetPath(_local2.mc)] = _local2.mc;
}
if (_local5[targetPath(_local2.mc)] == undefined) {
_local5[targetPath(_local2.mc)] = [];
}
_local5[targetPath(_local2.mc)].push(((_local2.ctm != undefined) ? "_ct_" : (_local2.pp)));
if (_local9[targetPath(_local2.mc)] == undefined) {
_local9[targetPath(_local2.mc)] = [];
}
_local9[targetPath(_local2.mc)].push(((_local2.ctm != undefined) ? "_ct_" : (_local2.pp)));
}
if (_local2.cb.updfunc != undefined) {
var _local6 = _local2.cb.updfunc;
if ((typeof(_local6) == "string") && (_local2.cb.updscope != undefined)) {
_local6 = _local2.cb.updscope[_local6];
}
_local6.updfunc.apply(_local2.cb.updscope, _local2.cb.updargs);
}
if (endt == undefined) {
var endt = new Array();
}
endt.push(_local10);
}
}
if (_local13) {
cleanUp();
}
for (_local3 in _local4) {
_local4[_local3].broadcastMessage("onTweenUpdate", {target:_local4[_local3], props:_local5[_local3]});
}
if (endt != undefined) {
endTweens(endt);
}
for (_local3 in _local7) {
_local7[_local3].broadcastMessage("onTweenEnd", {target:_local7[_local3], props:_local9[_local3]});
}
now = getTimer();
if (updateTime > 0) {
updateAfterEvent();
}
}
function endTweens(tid_arr) {
var _local2;
var _local9;
var _local3;
var _local5;
var _local8;
_local2 = [];
_local9 = tid_arr.length;
_local3 = 0;
while (_local3 < _local9) {
_local5 = tweenList[tid_arr[_local3]].cb;
if (_local5 != undefined) {
var _local6 = true;
for (_local8 in _local2) {
if (_local2[_local8] == _local5) {
_local6 = false;
break;
}
}
if (_local6) {
_local2.push(_local5);
}
}
tweenList.splice(tid_arr[_local3], 1);
_local3++;
}
_local3 = 0;
while (_local3 < _local2.length) {
var _local4 = _local2[_local3].func;
if ((typeof(_local4) == "string") && (_local2[_local3].scope != undefined)) {
_local4 = _local2[_local3].scope[_local4];
}
_local4.apply(_local2[_local3].scope, _local2[_local3].args);
_local3++;
}
if (tweenList.length == 0) {
deinit();
}
}
function removeDelayedTween(index) {
clearInterval(ints[index].intid);
ints[index] = undefined;
var _local2 = true;
for (var _local3 in ints) {
if (ints[_local3] != undefined) {
_local2 = false;
break;
}
}
if (_local2) {
ints = [];
}
}
function addTween(mc, props, pEnd, sec, eqFunc, callback, extra1, extra2) {
var _local4;
var _local13;
var _local6;
var _local3;
var _local2;
if (!playing) {
init();
}
var _local12 = [];
for (_local4 in props) {
_local13 = props[_local4];
_local6 = true;
if (_local13.substr(0, 4) != "_ct_") {
var _local17 = ((typeof(pEnd[_local4]) == "string") ? (Number(pEnd[_local4])) : (pEnd[_local4] - mc[_local13]));
if (autoOverwrite) {
for (_local3 in tweenList) {
_local2 = tweenList[_local3];
if ((_local2.mc == mc) && (_local2.pp == _local13)) {
_local2.ps = mc[_local13];
_local2.ch = _local17;
_local2.ts = now;
_local2.d = sec * 1000;
_local2.ef = eqFunc;
_local2.cb = callback;
_local2.e1 = extra1;
_local2.e2 = extra2;
_local2.pt = -1;
_local6 = false;
_local12.push(_local2.pp);
break;
}
}
}
if (_local6) {
tweenList.unshift({mc:mc, pp:_local13, ps:mc[_local13], ch:_local17, ts:now, d:sec * 1000, ef:eqFunc, cb:callback, e1:extra1, e2:extra2, pt:-1});
}
} else {
var _local16 = new Color(mc);
var _local20 = _local16.getTransform();
var _local19 = {};
for (_local3 in pEnd[_local4]) {
if ((pEnd[_local4][_local3] != _local20[_local3]) && (pEnd[_local4][_local3] != undefined)) {
_local19[_local3] = ((typeof(pEnd[_local4][_local3]) == "string") ? (_local20[_local3] + Number(pEnd[_local4][_local3])) : (pEnd[_local4][_local3] - _local20[_local3]));
}
}
if (autoOverwrite) {
for (_local3 in tweenList) {
_local2 = tweenList[_local3];
if ((_local2.mc == mc) && (_local2.ctm != undefined)) {
_local2.c = _local16;
_local2.stm = _local20;
(_local2.ctm = _local19);
(_local2.ts = now);
_local2.d = sec * 1000;
_local2.ef = eqFunc;
_local2.cb = callback;
_local2.e1 = extra1;
_local2.e2 = extra2;
_local2.pt = -1;
_local6 = false;
_local12.push("_ct_");
break;
}
}
}
if (_local6) {
tweenList.unshift({mc:mc, c:_local16, stm:_local20, ctm:_local19, ts:now, d:sec * 1000, ef:eqFunc, cb:callback, e1:extra1, e2:extra2, pt:-1});
}
}
}
if (broadcastEvents) {
if (_local12.length > 0) {
mc.broadcastMessage("onTweenInterrupt", {target:mc, props:_local12});
}
mc.broadcastMessage("onTweenStart", {target:mc, props:props});
}
if (callback.startfunc != undefined) {
var _local27 = callback.startfunc;
if ((typeof(_local27) == "string") && (callback.startscope != undefined)) {
_local27 = callback.startscope[_local27];
}
_local27.apply(callback.startscope, callback.startargs);
}
if (sec == 0) {
update();
}
}
function addTweenWithDelay(delay, mc, props, pEnd, sec, eqFunc, callback, extra1, extra2) {
var il;
var _local3;
il = ints.length;
_local3 = setInterval(function (obj) {
obj.removeDelayedTween(il);
if (mc._x != undefined) {
obj.addTween(mc, props, pEnd, sec, eqFunc, callback, extra1, extra2);
}
}, delay * 1000, this);
ints[il] = {mc:mc, props:props, pend:pEnd, intid:_local3, st:getTimer(), delay:delay * 1000, args:arguments.slice(1), pt:-1};
if (!playing) {
init();
}
}
function removeTween(mc, props) {
var _local8;
var _local2;
var _local5;
_local8 = false;
if ((props == undefined) && (broadcastEvents != true)) {
_local8 = true;
}
_local2 = tweenList.length;
var _local4 = {};
while (_local2--) {
if (tweenList[_local2].mc == mc) {
if (_local8) {
tweenList.splice(_local2, 1);
} else {
for (_local5 in props) {
if (tweenList[_local2].pp == props[_local5]) {
tweenList.splice(_local2, 1);
if (_local4[targetPath(mc)] == undefined) {
_local4[targetPath(mc)] = {t:mc, p:[]};
}
_local4[targetPath(mc)].p.push(props[_local5]);
} else if (((props[_local5] == "_ct_") && (tweenList[_local2].ctm != undefined)) && (tweenList[_local2].mc == mc)) {
tweenList.splice(_local2, 1);
if (_local4[targetPath(mc)] == undefined) {
_local4[targetPath(mc)] = {t:mc, p:[]};
}
_local4[targetPath(mc)].p.push("_ct_");
}
}
}
}
}
_local2 = ints.length;
while (_local2--) {
if (ints[_local2].mc == mc) {
if (_local8) {
removeDelayedTween(Number(_local2));
} else {
for (_local5 in props) {
for (var _local11 in ints[_local2].props) {
if (ints[_local2].props[_local11] == props[_local5]) {
ints[_local2].props.splice(_local11, 1);
ints[_local2].pend.splice(_local11, 1);
if (_local4[targetPath(mc)] == undefined) {
_local4[targetPath(mc)] = {t:mc, p:[]};
}
_local4[targetPath(mc)].p.push(props[_local5]);
}
}
if (ints[_local2].props.length == 0) {
clearInterval(ints[_local2].intid);
}
}
}
}
}
if (broadcastEvents) {
for (var _local11 in _local4) {
if (_local4[_local11].p.length > 0) {
_local4[_local11].t.broadcastMessage("onTweenInterrupt", {target:_local4[_local11].t, props:_local4[_local11].p});
}
}
}
if (tweenList.length == 0) {
deinit();
}
}
function isTweening(mc, prop) {
var _local4 = prop == undefined;
for (var _local6 in tweenList) {
var _local2 = tweenList[_local6];
if (((tweenList[_local6].mc == mc) && (tweenList[_local6].pt == -1)) && ((_local4 || (prop == _local2.pp)) || ((prop == "_ct_") && (_local2.ctm != undefined)))) {
return(true);
}
}
return(false);
}
function getTweens(mc) {
var _local2 = 0;
for (var _local4 in tweenList) {
if (tweenList[_local4].mc == mc) {
_local2++;
}
}
return(_local2);
}
function lockTween(mc, bool) {
lockedTweens[targetPath(mc)] = bool;
}
function isTweenLocked(mc) {
if (lockedTweens[targetPath(mc)] == undefined) {
return(false);
}
return(lockedTweens[targetPath(mc)]);
}
function ffTween(mc, propsObj) {
var _local4 = mc == undefined;
var _local6 = propsObj == undefined;
for (var _local8 in tweenList) {
var _local2 = tweenList[_local8];
if (((_local2.mc == mc) || (_local4)) && (_local6 || (propsObj[_local2.pp] == true))) {
if (_local2.pt != -1) {
_local2.pt = -1;
}
_local2.ts = now - _local2.d;
}
}
for (var _local8 in ints) {
if (ints[_local8] != undefined) {
if ((ints[_local8].mc == mc) || (_local4)) {
if (ints[_local8].mc._x != undefined) {
var _local3 = ints[_local8].args;
_local3[3] = 0;
addTween.apply(this, _local3);
}
removeDelayedTween(Number(_local8));
}
}
}
update();
}
function rewTween(mc, propsObj) {
var _local3 = mc == undefined;
var _local5 = propsObj == undefined;
for (var _local7 in tweenList) {
var _local2 = tweenList[_local7];
if (((_local2.mc == mc) || (_local3)) && (_local5 || (propsObj[_local2.pp] == true))) {
if (_local2.pt != -1) {
_local2.pt = -1;
}
_local2.ts = now;
}
}
for (var _local7 in ints) {
if (ints[_local7] != undefined) {
if ((ints[_local7].mc == mc) || (_local3)) {
if (ints[_local7].mc._x != undefined) {
addTween.apply(this, ints[_local7].args);
}
removeDelayedTween(Number(_local7));
}
}
}
update();
}
function isTweenPaused(mc, prop) {
if (mc == undefined) {
return(null);
}
var _local5 = prop == undefined;
for (var _local6 in tweenList) {
var _local2 = tweenList[_local6];
if ((tweenList[_local6].mc == mc) && ((_local5 || (prop == _local2.pp)) || ((prop == "_ct_") && (_local2.ctm != undefined)))) {
return(Boolean(tweenList[_local6].pt != -1));
}
}
for (var _local6 in ints) {
if ((ints[_local6] != undefined) && (ints[_local6].mc == mc)) {
return(Boolean(ints[_local6].pt != -1));
}
}
return(false);
}
function pauseTween(mc, propsObj) {
var _local3 = mc == undefined;
if ((_local3 == false) && (isTweenPaused(mc) == true)) {
return(undefined);
}
var _local6 = propsObj == undefined;
for (var _local7 in tweenList) {
var _local2 = tweenList[_local7];
if (((_local2.pt == -1) && ((_local2.mc == mc) || (_local3))) && ((_local6 || (propsObj[_local2.pp] == true)) || ((propsObj._ct_ != undefined) && (_local2.ctm != undefined)))) {
_local2.pt = now;
}
}
for (var _local7 in ints) {
if (ints[_local7] != undefined) {
if ((ints[_local7].pt == -1) && ((ints[_local7].mc == mc) || (_local3))) {
ints[_local7].pt = now;
}
}
}
}
function unpauseTween(mc, propsObj) {
var _local4 = mc == undefined;
if ((_local4 == false) && (isTweenPaused(mc) === false)) {
return(undefined);
}
var _local7 = propsObj == undefined;
if (!playing) {
init();
}
for (var _local2 in tweenList) {
var _local3 = tweenList[_local2];
if ((((_local3.pt != -1) && ((_local3.mc == mc) || (_local4))) && (_local7 || (propsObj[_local3.pp] == true))) || ((propsObj._ct_ != undefined) && (_local3.ctm != undefined))) {
_local3.ts = now - (_local3.pt - _local3.ts);
_local3.pt = -1;
}
}
for (var _local2 in ints) {
if (ints[_local2] != undefined) {
if ((ints[_local2].pt != -1) && ((ints[_local2].mc == mc) || (_local4))) {
ints[_local2].delay = ints[_local2].delay - (ints[_local2].pt - ints[_local2].st);
ints[_local2].st = now;
ints[_local2].intid = setInterval(function (obj, id) {
obj.addTween.apply(obj, obj.ints[id].args);
clearInterval(obj.ints[id].intid);
obj.ints[id] = undefined;
}, ints[_local2].delay, this, _local2);
}
}
}
}
function pauseAll() {
pauseTween();
}
function unpauseAll() {
unpauseTween();
}
function stopAll() {
for (var _local2 in ints) {
removeDelayedTween(Number(_local2));
}
tweenList = new Array();
deinit();
}
function toString() {
return("[AS2 tweenManager 1.2.0]");
}
var _th_depth = 6789;
}
Symbol 1225 MovieClip [__Packages.com.robertpenner.easing.Cubic] Frame 0
class com.robertpenner.easing.Cubic
{
function Cubic () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((c * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((t * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((t * t) * t) + 2)) + b);
}
static function easeOutIn(t, b, c, d) {
t = t / (d / 2);
t--;
return(((c / 2) * (((t * t) * t) + 1)) + b);
}
}
Symbol 1226 MovieClip [__Packages.MenuSelect] Frame 0
class MenuSelect
{
static var pos;
function MenuSelect () {
}
static function init() {
pos = 0;
updateView();
}
static function downArrow() {
pos++;
if (pos > 3) {
pos = 0;
}
updateView();
}
static function upArrow() {
pos--;
if (pos < 0) {
pos = 3;
}
updateView();
}
static function setPos(num) {
pos = num;
updateView();
}
static function goPressed() {
switch (pos) {
case 0 :
GlobalData.init();
_root.gotoAndPlay("cutScene");
break;
case 1 :
_root.gotoAndPlay("levelSelect");
break;
case 2 :
_root.gotoAndPlay("optionsScreen");
break;
case 3 :
_root.gotoAndStop("egg");
}
}
static function updateView() {
var _local2 = 0;
while (_local2 < 4) {
_root.menuSelect_mc[("head" + _local2) + "_mc"]._visible = _local2 == pos;
_local2++;
}
}
}
Symbol 1227 MovieClip [__Packages.LevelSelect] Frame 0
class LevelSelect
{
static var _mc, savedData, choiceClips, openStates, scrollJumpHeight, scrollPosition, hiPosition, lowPosition;
function LevelSelect (p_mc) {
}
static function update(p_mc) {
if (p_mc != undefined) {
_mc = p_mc;
}
savedData = StinkoSaveData.getIt();
choiceClips = new Array();
openStates = new Array();
var _local1 = 1;
while (_local1 <= GlobalData.maxSublevel) {
choiceClips.push(_mc["choice" + _local1]);
if (_local1 > savedData.sublevel) {
_mc["choice" + _local1]._visible = false;
}
openStates.push(false);
_local1++;
}
scrollJumpHeight = 112;
scrollPosition = 0;
hiPosition = GlobalData.maxSublevel - 1;
lowPosition = 0;
_local1 = 0;
while (_local1 <= GlobalData.maxSublevel) {
choiceClips[_local1].mID = _local1;
choiceClips[_local1]._y = choiceClips[_local1]._y - (scrollJumpHeight * (GlobalData.maxSublevel - savedData.sublevel));
choiceClips[_local1].levelSelectHighlight_mc._visible = false;
_local1++;
}
choiceClips[GlobalData.maxSublevel - 1].levelSelectHighlight_mc._visible = true;
_mc.scrollUp_btn.onRelease = function () {
LevelSelect.scrollSelector(-1);
};
_mc.scrollDown_btn.onRelease = function () {
LevelSelect.scrollSelector(1);
};
updateScrollBarAvailability();
}
static function updateHighlight() {
var _local1 = 0;
while (_local1 < GlobalData.maxSublevel) {
choiceClips[_local1].levelSelectHighlight_mc._visible = hiPosition == _local1;
choiceClips[_local1].choice1.highlight_mc._visible = false;
choiceClips[_local1].choice2.highlight_mc._visible = false;
_local1++;
}
if (openStates[hiPosition]) {
if (lowPosition == 0) {
choiceClips[hiPosition].choice1.highlight_mc._visible = true;
choiceClips[hiPosition].choice2.highlight_mc._visible = false;
} else {
choiceClips[hiPosition].choice1.highlight_mc._visible = false;
choiceClips[hiPosition].choice2.highlight_mc._visible = true;
}
}
}
static function jumpToSubnav(num) {
openStates[num] = true;
hiPosition = num;
updateHighlight();
}
static function returnFromSubnav(num) {
trace("LevelSelect::returnFromSubnav " + num);
openStates[num] = false;
hiPosition = num;
updateHighlight();
}
static function rollOver(num) {
trace((("LevelSelect::rollOver " + num) + ",") + choiceClips[num].levelSelectHighlight_mc._name);
hiPosition = num;
updateHighlight();
}
static function upArrow() {
hiPosition++;
if (hiPosition > (GlobalData.maxSublevel - 1)) {
hiPosition = GlobalData.maxSublevel - 1;
}
updateHighlight();
scrollToLevel(hiPosition);
}
static function downArrow() {
hiPosition--;
if (hiPosition < 0) {
hiPosition = 0;
}
updateHighlight();
scrollToLevel(hiPosition);
}
static function sideArrow() {
if (choiceClips[hiPosition].choice2._visible && (choiceClips[hiPosition].choice2._alpha > 0)) {
lowPosition++;
if (lowPosition > 1) {
lowPosition = 0;
}
} else {
lowPosition = 0;
}
updateHighlight();
}
static function subnavRollOver(num, snum) {
trace((("LevelSelect::subnavRollOver " + num) + ",") + snum);
hiPosition = num - 1;
lowPosition = snum - 1;
updateHighlight();
}
static function goPressed() {
if (openStates[hiPosition]) {
choose(hiPosition + 1, lowPosition + 1);
} else {
choiceClips[hiPosition].gotoAndStop("stageselect");
openStates[hiPosition] = true;
lowPosition = 0;
}
updateHighlight();
}
static function choose(levelNum, subLevel) {
GlobalData.sublevel = levelNum;
GlobalData.subsublevel = subLevel;
GlobalData.level = 1;
_mc._parent.gotoAndPlay("cutScene");
}
static function subDisplay(levelNum, buttonParent_mc) {
var _local6 = StinkoSaveData.getIt();
var _local4;
if (_local6.sublevel > levelNum) {
_local4 = 2;
} else {
_local4 = _local6.subsublevel;
}
var _local3 = 1;
while (_local3 <= _local4) {
buttonParent_mc["choice" + _local3]._alpha = 100;
buttonParent_mc["choice" + _local3].mID = levelNum;
buttonParent_mc["choice" + _local3].smID = _local3;
buttonParent_mc["choice" + _local3]._btn.onRelease = function () {
LevelSelect.choose(this._parent.mID, this._parent.smID);
};
_local3++;
}
_local3 = _local4 + 1;
while (_local3 <= 2) {
buttonParent_mc["choice" + _local3]._alpha = 0;
buttonParent_mc["choice" + _local3].enabled = false;
_local3++;
}
}
static function scrollToLevel(num) {
num = (choiceClips.length - num) - 1;
trace((((("LevelSelect::scrollToLevel(): called ," + num) + ",") + scrollPosition) + "->") + (scrollPosition - num));
if ((num < scrollPosition) || (num > (scrollPosition + 2))) {
scrollSelector(num - scrollPosition);
}
}
static function scrollSelector(dir) {
trace((("LevelSelect::scrollSelector: called " + dir) + " before: ") + scrollPosition);
scrollPosition = scrollPosition + dir;
trace((("LevelSelect::scrollSelector: called " + dir) + " after: ") + scrollPosition);
updateScrollBarAvailability();
if (scrollPosition < 0) {
scrollPosition = 0;
return(undefined);
}
if (scrollPosition > (GlobalData.maxSublevel - 3)) {
scrollPosition = GlobalData.maxSublevel - 3;
return(undefined);
}
var _local1 = 0;
while (_local1 < GlobalData.maxSublevel) {
choiceClips[_local1]._y = choiceClips[_local1]._y + ((-dir) * scrollJumpHeight);
_local1++;
}
}
static function updateScrollBarAvailability() {
if (scrollPosition <= 0) {
_mc.scrollUp_btn.enabled = false;
_mc.scrollUp_btn._visible = false;
} else {
_mc.scrollUp_btn.enabled = true;
_mc.scrollUp_btn._visible = true;
}
if (scrollPosition >= (GlobalData.maxSublevel - 3)) {
_mc.scrollDown_btn.enabled = false;
_mc.scrollDown_btn._visible = false;
} else {
_mc.scrollDown_btn.enabled = true;
_mc.scrollDown_btn._visible = true;
}
}
}
Symbol 269 Button
on (release, keyPress "<Space>") {
_parent.gotoAndStop("titleScreen");
}
Symbol 392 MovieClip Frame 1
stop();
Symbol 392 MovieClip Frame 6
stop();
Symbol 408 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 20
this._parent.mBoss.shoot();
Symbol 408 MovieClip Frame 56
stop();
this._parent.mBoss.blow();
Symbol 420 MovieClip [shipFlyBy] Frame 302
stop();
Symbol 455 MovieClip Frame 2
_parent.mPlayerWithFist.punchGround(punchGroundTest_mc);
Symbol 462 MovieClip Frame 12
StinkoGame.killAll();
Symbol 462 MovieClip Frame 41
Interface.showKeepTry();
Symbol 462 MovieClip Frame 80
if (_parent.gameMode == "jumping") {
JumpingGame.doneDying();
} else {
StinkoGame.doneDying();
}
stop();
Symbol 470 MovieClip Frame 82
StinkoGame.levelDoneDone();
Symbol 476 MovieClip Frame 48
gotoAndPlay ("loop");
Symbol 480 MovieClip [playerFistman] Frame 1
stop();
Symbol 480 MovieClip [playerFistman] Frame 7
stop();
Symbol 480 MovieClip [playerFistman] Frame 13
stop();
Symbol 480 MovieClip [playerFistman] Frame 19
stop();
Symbol 480 MovieClip [playerFistman] Frame 25
stop();
Symbol 480 MovieClip [playerFistman] Frame 33
stop();
Symbol 480 MovieClip [playerFistman] Frame 41
stop();
Symbol 480 MovieClip [playerFistman] Frame 47
stop();
Symbol 480 MovieClip [playerFistman] Frame 53
stop();
Symbol 480 MovieClip [playerFistman] Frame 59
stop();
Symbol 480 MovieClip [playerFistman] Frame 65
stop();
Symbol 480 MovieClip [playerFistman] Frame 73
stop();
Symbol 480 MovieClip [playerFistman] Frame 81
stop();
Symbol 480 MovieClip [playerFistman] Frame 89
stop();
Symbol 480 MovieClip [playerFistman] Frame 97
stop();
Symbol 480 MovieClip [playerFistman] Frame 110
stop();
Symbol 480 MovieClip [playerFistman] Frame 123
stop();
Symbol 480 MovieClip [playerFistman] Frame 131
stop();
Symbol 480 MovieClip [playerFistman] Frame 139
stop();
Symbol 480 MovieClip [playerFistman] Frame 145
stop();
Symbol 480 MovieClip [playerFistman] Frame 219
gotoAndStop ("levelDone");
Symbol 503 MovieClip [sky] Frame 1
stop();
Symbol 506 MovieClip [sky2] Frame 1
stop();
Symbol 507 MovieClip Frame 173
_parent.gotoAndPlay("titleScreen");
Symbol 525 MovieClip [descent0] Frame 1
stop();
Symbol 525 MovieClip [descent0] Frame 5
mFood.kill();
this.removeMovieClip();
Symbol 527 MovieClip [descent1] Frame 1
stop();
Symbol 527 MovieClip [descent1] Frame 5
mFood.kill();
this.removeMovieClip();
Symbol 529 MovieClip [descent2] Frame 1
stop();
Symbol 529 MovieClip [descent2] Frame 5
mFood.kill();
this.removeMovieClip();
Symbol 531 MovieClip [descent3] Frame 1
stop();
Symbol 531 MovieClip [descent3] Frame 5
mFood.kill();
this.removeMovieClip();
Symbol 533 MovieClip [descent4] Frame 1
stop();
Symbol 533 MovieClip [descent4] Frame 5
mFood.kill();
this.removeMovieClip();
Symbol 535 MovieClip [jumpShadow] Frame 1
stop();
Symbol 535 MovieClip [jumpShadow] Frame 6
stop();
Symbol 546 MovieClip [level9_foreground] Frame 1
stop();
Symbol 549 MovieClip [level9_background] Frame 1
stop();
Symbol 565 MovieClip [Bullet16] Frame 1
stop();
Symbol 571 MovieClip [Bullet17] Frame 1
stop();
Symbol 596 MovieClip Frame 1
stop();
Symbol 596 MovieClip Frame 6
_parent.mBoss.shoot();
Symbol 596 MovieClip Frame 8
_parent.mBoss.shoot();
Symbol 596 MovieClip Frame 10
_parent.mBoss.shoot();
Symbol 596 MovieClip Frame 12
_parent.mBoss.shoot();
Symbol 596 MovieClip Frame 14
_parent.mBoss.shoot();
Symbol 596 MovieClip Frame 16
_parent.mBoss.shoot();
Symbol 599 MovieClip Frame 1
stop();
Symbol 599 MovieClip Frame 7
stop();
Symbol 610 MovieClip [cavern] Frame 1
stop();
Symbol 612 MovieClip [iceskyback] Frame 1
stop();
Symbol 614 MovieClip [iceskyfront] Frame 1
stop();
Symbol 627 MovieClip [moonsky1] Frame 1
stop();
Symbol 628 MovieClip [negativeSkyBack] Frame 1
stop();
Symbol 630 MovieClip Frame 1
stop();
Symbol 631 MovieClip [negativeSkyFront] Frame 1
stop();
Symbol 633 MovieClip [cameraFlash_mc] Frame 2
stop();
Symbol 652 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 63
_parent.mBoss.fireChurn();
Symbol 663 MovieClip Frame 1
stop();
Symbol 663 MovieClip Frame 19
stop();
Symbol 663 MovieClip Frame 29
stop();
Symbol 672 MovieClip Frame 24
gotoAndPlay ("loop");
Symbol 673 MovieClip Frame 1
stop();
Symbol 673 MovieClip Frame 6
stop();
Symbol 678 MovieClip Frame 2
_parent.mouth_mc.gotoAndStop("opened");
Symbol 678 MovieClip Frame 13
_parent.mouth_mc.gotoAndStop("closed");
Symbol 678 MovieClip Frame 56
stop();
Symbol 684 MovieClip Frame 1
stop();
Symbol 684 MovieClip Frame 8
_parent.mBullet.kill();
Symbol 719 MovieClip Frame 7
_parent._parent.mBoss.setFridgeOpen(true, "left");
Symbol 719 MovieClip Frame 14
stop();
Symbol 719 MovieClip Frame 39
_parent._parent.mBoss.setFridgeOpen(false, "left");
Symbol 719 MovieClip Frame 48
stop();
Symbol 719 MovieClip Frame 71
_parent._parent.mBoss.setFridgeOpen(true, "right");
Symbol 719 MovieClip Frame 79
stop();
Symbol 719 MovieClip Frame 103
_parent._parent.mBoss.setFridgeOpen(false, "left");
Symbol 719 MovieClip Frame 110
stop();
Symbol 723 MovieClip Frame 75
_parent.mBoss.shoot(mDometantID);
Symbol 726 MovieClip [BossNegative_mc] Frame 86
mBoss.entranceFinished();
Symbol 726 MovieClip [BossNegative_mc] Frame 124
mBoss.roarFinished();
Symbol 726 MovieClip [BossNegative_mc] Frame 161
mBoss.stepFinished();
Symbol 726 MovieClip [BossNegative_mc] Frame 219
mBoss.stepFinished();
Symbol 740 MovieClip Frame 1
stop();
Symbol 746 MovieClip Frame 1
stop();
Symbol 754 MovieClip Frame 4
stop();
Symbol 759 MovieClip Frame 4
stop();
Symbol 760 MovieClip Frame 6
stop();
Symbol 761 MovieClip Frame 6
stop();
Symbol 768 MovieClip Frame 22
stop();
Symbol 772 MovieClip Frame 9
ShootingGame.killAll();
Symbol 772 MovieClip Frame 56
Interface.showKeepTry();
Symbol 772 MovieClip Frame 86
StinkoGame.doneDying();
stop();
Symbol 774 MovieClip Frame 60
StinkoGame.levelDoneDone();
stop();
Symbol 775 MovieClip [playerShooter] Frame 1
stop();
Symbol 775 MovieClip [playerShooter] Frame 8
stop();
Symbol 775 MovieClip [playerShooter] Frame 13
stop();
Symbol 775 MovieClip [playerShooter] Frame 19
stop();
Symbol 775 MovieClip [playerShooter] Frame 25
stop();
Symbol 775 MovieClip [playerShooter] Frame 30
stop();
Symbol 775 MovieClip [playerShooter] Frame 37
stop();
Symbol 775 MovieClip [playerShooter] Frame 49
stop();
Symbol 777 MovieClip [Bullet15] Frame 1
stop();
Symbol 777 MovieClip [Bullet15] Frame 2
play();
Symbol 777 MovieClip [Bullet15] Frame 5
myBullet.kill();
Symbol 777 MovieClip [Bullet15] Frame 11
play();
Symbol 777 MovieClip [Bullet15] Frame 14
myBullet.kill();
Symbol 808 MovieClip Frame 12
StinkoGame.killAll();
Symbol 808 MovieClip Frame 41
Interface.showKeepTry();
Symbol 808 MovieClip Frame 80
if (_parent.gameMode == "jumping") {
JumpingGame.doneDying();
} else {
StinkoGame.doneDying();
}
stop();
Symbol 814 MovieClip Frame 64
StinkoGame.levelDoneDone();
Symbol 819 MovieClip [playerOneUp] Frame 1
stop();
Symbol 819 MovieClip [playerOneUp] Frame 7
stop();
Symbol 819 MovieClip [playerOneUp] Frame 13
stop();
Symbol 819 MovieClip [playerOneUp] Frame 19
stop();
Symbol 819 MovieClip [playerOneUp] Frame 25
stop();
Symbol 819 MovieClip [playerOneUp] Frame 31
stop();
Symbol 819 MovieClip [playerOneUp] Frame 37
stop();
Symbol 819 MovieClip [playerOneUp] Frame 43
stop();
Symbol 819 MovieClip [playerOneUp] Frame 49
stop();
Symbol 819 MovieClip [playerOneUp] Frame 55
stop();
Symbol 819 MovieClip [playerOneUp] Frame 61
stop();
Symbol 819 MovieClip [playerOneUp] Frame 69
stop();
Symbol 819 MovieClip [playerOneUp] Frame 77
stop();
Symbol 819 MovieClip [playerOneUp] Frame 85
stop();
Symbol 819 MovieClip [playerOneUp] Frame 93
stop();
Symbol 819 MovieClip [playerOneUp] Frame 104
stop();
Symbol 819 MovieClip [playerOneUp] Frame 115
stop();
Symbol 819 MovieClip [playerOneUp] Frame 123
stop();
Symbol 819 MovieClip [playerOneUp] Frame 131
stop();
Symbol 819 MovieClip [playerOneUp] Frame 143
stop();
Symbol 819 MovieClip [playerOneUp] Frame 154
stop();
Symbol 819 MovieClip [playerOneUp] Frame 167
stop();
Symbol 819 MovieClip [playerOneUp] Frame 180
stop();
Symbol 819 MovieClip [playerOneUp] Frame 188
stop();
Symbol 819 MovieClip [playerOneUp] Frame 196
stop();
Symbol 819 MovieClip [playerOneUp] Frame 202
play();
Symbol 819 MovieClip [playerOneUp] Frame 276
gotoAndStop ("levelDone");
Symbol 820 Button
on (release, keyPress "<Space>") {
_parent.gotoAndPlay("menuSelect");
}
Symbol 912 MovieClip Frame 1
play();
Symbol 912 MovieClip Frame 894
gotoAndPlay ("titleLoop");
Symbol 917 Button
on (release) {
GlobalData.init();
_parent.gotoAndPlay("cutScene");
}
on (rollOver) {
MenuSelect.setPos(0);
}
Symbol 920 Button
on (release) {
_parent.gotoAndPlay("levelSelect");
}
on (rollOver) {
MenuSelect.setPos(1);
}
Symbol 923 Button
on (release) {
_parent.gotoAndPlay("optionsScreen");
}
on (rollOver) {
MenuSelect.setPos(2);
}
Symbol 925 Button
on (release) {
_root.gotoAndStop("egg");
}
on (rollOver) {
MenuSelect.setPos(3);
}
Symbol 928 Button
on (keyPress "<Down>") {
MenuSelect.downArrow();
}
on (keyPress "<Up>") {
MenuSelect.upArrow();
}
on (keyPress "<Space>") {
MenuSelect.goPressed();
}
Symbol 931 MovieClip Frame 1
GlobalData.init();
if ((StinkoSaveData.getIt().sublevel > 1) || (StinkoSaveData.getIt().subsublevel > 1)) {
} else {
continue_btn.enabled = false;
continue_btn._alpha = 50;
}
MenuSelect.init();
Symbol 931 MovieClip Frame 24
stop();
Symbol 934 Button
on (release, keyPress "<Space>") {
_root.gotoAndStop("menuSelect");
}
Symbol 938 Button
on (keyPress "<Left>") {
book_mc.book_mc.gotoAndStop(book_mc.book_mc._currentframe - 1);
}
on (keyPress "<Right>") {
book_mc.book_mc.gotoAndStop(book_mc.book_mc._currentframe + 1);
}
Symbol 939 MovieClip Frame 1
book_mc.loadMovie("externalSwf/stinkomanual.swf");
Symbol 939 MovieClip Frame 24
stop();
Symbol 961 Button
on (release, keyPress "<Space>") {
_parent.gotoAndPlay("menuSelect");
}
Symbol 962 MovieClip Frame 1
trace("got to optionsScreen");
Symbol 962 MovieClip Frame 301
gotoAndPlay ("optionsLoop");
Symbol 969 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 973 Button
on (release) {
gotoAndStop (1);
LevelSelect.returnFromSubnav(mID);
}
Symbol 979 Button
on (rollOver) {
LevelSelect.subnavRollOver(mID, smID);
}
Symbol 983 MovieClip Frame 1
stop();
Symbol 983 MovieClip Frame 3
LevelSelect.subDisplay(1, this);
Symbol 987 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 988 Button
on (release) {
gotoAndStop (1);
LevelSelect.returnFromSubnav(mID);
}
Symbol 991 MovieClip Frame 1
stop();
Symbol 991 MovieClip Frame 3
LevelSelect.subDisplay(2, this);
Symbol 995 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 996 Button
on (release) {
gotoAndStop (1);
LevelSelect.returnFromSubnav(mID);
}
Symbol 999 MovieClip Frame 1
stop();
Symbol 999 MovieClip Frame 3
LevelSelect.subDisplay(3, this);
Symbol 1004 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 1005 Button
on (release) {
gotoAndStop (1);
LevelSelect.returnFromSubnav(mID);
}
Symbol 1008 MovieClip Frame 1
stop();
Symbol 1008 MovieClip Frame 3
LevelSelect.subDisplay(4, this);
Symbol 1013 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 1014 Button
on (release) {
gotoAndStop (1);
LevelSelect.returnFromSubnav(mID);
}
Symbol 1017 MovieClip Frame 1
stop();
Symbol 1017 MovieClip Frame 3
LevelSelect.subDisplay(5, this);
Symbol 1022 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 1023 Button
on (release) {
gotoAndStop (1);
LevelSelect.returnFromSubnav(mID);
}
Symbol 1026 MovieClip Frame 1
stop();
Symbol 1026 MovieClip Frame 3
LevelSelect.subDisplay(6, this);
Symbol 1032 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 1033 Button
on (release) {
gotoAndStop (1);
LevelSelect.returnFromSubnav(mID);
}
Symbol 1036 MovieClip Frame 1
stop();
Symbol 1036 MovieClip Frame 3
LevelSelect.subDisplay(7, this);
Symbol 1041 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 1042 Button
on (release) {
LevelSelect.returnFromSubnav(mID);
gotoAndStop (1);
}
Symbol 1045 MovieClip Frame 1
stop();
Symbol 1045 MovieClip Frame 3
LevelSelect.subDisplay(8, this);
Symbol 1050 Button
on (release) {
gotoAndStop ("stageselect");
LevelSelect.jumpToSubnav(mID);
}
on (rollOver) {
LevelSelect.rollOver(mID);
}
Symbol 1051 Button
on (release) {
LevelSelect.returnFromSubnav(mID);
gotoAndStop (1);
}
Symbol 1053 MovieClip Frame 1
stop();
Symbol 1053 MovieClip Frame 3
LevelSelect.subDisplay(9, this);
Symbol 1058 MovieClip Frame 300
gotoAndPlay ("levelSelectLoop");
Symbol 1059 Button
on (keyPress "<Down>") {
LevelSelect.downArrow();
}
on (keyPress "<Up>") {
LevelSelect.upArrow();
}
on (keyPress "<Left>") {
LevelSelect.sideArrow();
}
on (keyPress "<Right>") {
LevelSelect.sideArrow();
}
on (keyPress "<Space>") {
LevelSelect.goPressed();
}
Symbol 1060 MovieClip Frame 1
LevelSelect.update(this);
stop();
Symbol 1061 Button
on (release, keyPress "<Space>") {
GlobalData.cutSceneEnded();
}
Symbol 1063 MovieClip Frame 8
stop();
Symbol 1070 MovieClip Frame 1
stop();
Symbol 1072 Button
on (release, keyPress "<Space>") {
_parent.gotoAndPlay("gamePlayGo");
}
Symbol 1073 MovieClip Frame 1
lDataArray = new Array();
_root.lData = new LevelData(_root, _root.gameStage_mc, false);
trace("GamePlay lData.gameStage_mc = " + gameStage_mc._name);
_root.lData.setXML(StinkomanXMLData.getXML(GlobalData.sublevel, GlobalData.subsublevel));
StinkoGame.gameSound.stop();
if (GlobalData.sublevel == 5) {
levelPose_mc.gotoAndStop("oneUp");
} else if (GlobalData.sublevel == 8) {
levelPose_mc.gotoAndStop("negative");
} else if (GlobalData.sublevel == 9) {
levelPose_mc.gotoAndStop("ship");
}
gotoAndPlay ("levelLoaded");
Symbol 1073 MovieClip Frame 2
if (GlobalData.sublevel == 8) {
level_txt.text = "TRY LEVEL -0." + GlobalData.subsublevel;
} else {
level_txt.text = (("TRY LEVEL " + GlobalData.sublevel) + ".") + GlobalData.subsublevel;
}
Symbol 1073 MovieClip Frame 117
_parent.gotoAndPlay("gamePlayGo");
Symbol 1076 MovieClip Frame 1
stop();
Symbol 1076 MovieClip Frame 32
Interface.showKeepTry();
Symbol 1076 MovieClip Frame 75
StinkoGame.doneDying();
Symbol 1086 MovieClip Frame 1
stop();
Symbol 1093 MovieClip Frame 1
stop();
Symbol 1100 MovieClip Frame 1
stop();
Symbol 1103 MovieClip Frame 67
stop();
Symbol 1105 Button
on (release, keyPress "<Space>") {
_root.gotoAndPlay("tenderVittles");
}
Symbol 1115 MovieClip Frame 1
stop();
Symbol 1116 MovieClip Frame 1
if (GlobalData.sublevel == 5) {
gameOverPortrait_mc.gotoAndStop("oneUp");
}
if (GlobalData.sublevel == 8) {
gameOverPortrait_mc.gotoAndStop("negative");
}
if (GlobalData.sublevel == 9) {
gameOverPortrait_mc.gotoAndStop("ship");
}
Symbol 1116 MovieClip Frame 132
_parent.gotoAndPlay("tenderVittles");
Symbol 1118 MovieClip Frame 275
getURL ("stinkogame.html");
stop();