Frame 1
var percent = 0;
_quality = "HIGH";
stop();
_root.attachMovie("screen_Loader", "loader", this.getNextHighestDepth());
onEnterFrame = function () {
var _local3 = _root.getBytesLoaded() / _root.getBytesTotal();
var _local2 = _local3 * 100;
trace("Loading Game: " + int(_local2));
loader.percent = int(_local2);
if (_local2 > 20) {
loader.fl_1._visible = true;
loader.fl_1._alpha = 100;
}
if (_local2 > 40) {
loader.fl_2._visible = true;
loader.fl_2._alpha = 100;
}
if (_local2 > 60) {
loader.fl_3._visible = true;
loader.fl_3._alpha = 100;
}
if (_local2 > 80) {
loader.fl_4._visible = true;
loader.fl_4._alpha = 100;
}
if (_local2 > 95) {
loader.fl_5._visible = true;
loader.fl_5._alpha = 100;
}
if (_local3 == 1) {
trace("Game Loaded");
delete onEnterFrame;
loader.removeMovieClip();
gotoAndPlay (3);
}
};
Frame 3
function loadMap() {
var _local5 = this.createEmptyMovieClip("worldContainer", 4);
var _local6 = _local5.createEmptyMovieClip("worldMain", -1);
World = new com.kaboose.games.worldengine.WorldRenderer(_local5, _local6);
World.SetPlayerSpawn(200, 350);
World.SetPlayerScreenPosition(325, 250);
World.SetArea(650, 500);
World.SetWorldBounds(0, 2700, 0, 2880);
World.SetGravity(0.5);
World.SetDrag(0.99);
World.SetFriction(0.1);
World.SetTileSize(50);
var _local4 = ledges.length / 4;
var _local3 = false;
var _local2 = 0;
while (!_local3) {
curSet = _local2 * 4;
World.generateTile(ledges[curSet], ledges[curSet + 1], ledges[curSet + 2], ledges[curSet + 3] - 1, "", true);
if (_local2 >= _local4) {
_local3 = true;
}
_local2++;
}
_local4 = cliffTiles.length / 4;
_local3 = false;
_local2 = 0;
while (!_local3) {
curSet = _local2 * 4;
World.generateTile(cliffTiles[curSet], cliffTiles[curSet + 1], cliffTiles[curSet + 2], cliffTiles[curSet + 3] - 1, "", true);
if (_local2 >= _local4) {
_local3 = true;
}
_local2++;
}
_local4 = mapObjects.length / 7;
_local3 = false;
_local2 = 0;
while (!_local3) {
curSet = _local2 * 7;
World.generateObject(mapObjects[curSet], mapObjects[curSet + 1], mapObjects[curSet + 2], mapObjects[curSet + 3] - 1, mapObjects[curSet + 4], mapObjects[curSet + 5], mapObjects[curSet + 6]);
if (_local2 >= _local4) {
_local3 = true;
}
_local2++;
}
}
function CreateGameObjects() {
Controller.mapLoaded = true;
_quality = "LOW";
Controller.KillMusic();
Controller.StartMusic("game");
Controller.enemies = Array();
Controller.returningEnemies = Array();
Controller.delayStarted = false;
var _local16 = 0;
var _local23 = 0;
HUD = new com.kaboose.games.dinosoars.GameHUD(_local16, _local23);
HUD.mc = gfxHUD.CreateSprite("HUD");
HUD.mc.level = Controller.currentLevel;
var _local5 = 0;
var _local10 = 32;
delete PlayerObj;
PlayerObj = new com.kaboose.games.dinosoars.PlayerObject(_root.World.playerSpawnX, _root.World.playerSpawnY, _local10, "player", _local5);
PlayerObj.mc = gfxPlayer.CreateSprite("toucanSam");
PlayerObj.mc._x = _root.World.playerScreenX;
PlayerObj.mc._y = _root.World.playerScreenY;
World.setMovementReference(PlayerObj);
var _local14 = 65;
var _local13 = 340;
var _local17 = 64;
PlayerHQ = new com.kaboose.games.dinosoars.Nest(_local14, _local13, _local17, "playernest");
PlayerHQ.mc = gfxEnemies.CreateSprite("pNest");
var _local20 = (_local14 - _root.World.playerSpawnX) + _root.World.playerScreenX;
var _local19 = (_local13 - _root.World.playerSpawnY) + _root.World.playerScreenY;
PlayerHQ.mc._x = _local20;
PlayerHQ.mc._y = _local19;
var _local12 = 200;
var _local15 = _root.World.YMAX - 64;
var _local18 = 64;
var _local22 = -1;
var _local21 = 1;
_local5 = 1;
var _local24 = false;
Phil = new com.kaboose.games.dinosoars.Worm(_local12, _local15, _local18, _local22, _local21, _local5, _local24);
Phil.mc = gfxEnemies.CreateSprite("phil");
Phil.registerOwner();
Phil.mc.cacheAsBitmap();
_local20 = (_local12 - _root.World.playerSpawnX) + _root.World.playerScreenX;
_local19 = (_local15 - _root.World.playerSpawnY) + _root.World.playerScreenY;
Phil.mc._x = _local20;
Phil.mc._y = _local19;
Controller.frootLoops = Array();
var _local11 = (int(Controller.gameScores.length + 1) * Controller.levelLoop) + Controller.loopStartIndex;
Controller.totalLoops = (Controller.remainingLoops = _local11);
Controller.bowlLoops = 0;
Controller.targetLoops = int(_local11 * Controller.parPercentage);
if (int(Controller.gameScores.length + 1) < 3) {
Controller.levelTime = Math.max(Controller.totalLoops * Controller.secondsPerLoop, 55);
Controller.levelTime = 20;
} else {
Controller.levelTime = Math.min(Controller.totalLoops * Controller.secondsPerLoop, Controller.maxLevelTime);
}
Controller.levelTime = 120;
trace("frTotal: " + _local11);
trace("Controller.currentLevel: " + Controller.currentLevel);
HUD.UpdateLoops();
mapPickups.sort(function (a, b) {
return(random(2));
});
var _local2 = 0;
while (_local2 < _local11) {
var _local4 = mapPickups[_local2][0];
var _local3 = mapPickups[_local2][1];
_local5 = 0.9;
var _local8 = 0;
var _local6 = -2;
_local10 = 8;
var _local7 = _local2;
var _local9 = randomRange(2, 7);
temp = new com.kaboose.games.dinosoars.FrootLoop(_local4, _local3, _local10, "frootLoop", _local5, _local8, _local6, _local9, _local7);
Controller.frootLoops.push(temp);
temp.mc = gfxFrootLoops.CreateSprite("frootLoop");
temp.mc.clip.clip.gotoAndStop(temp.frame);
temp.mc.clip.gotoAndPlay(randomRange(2, 98));
_local20 = (_local4 - _root.World.playerSpawnX) + _root.World.playerScreenX;
_local19 = (_local3 - _root.World.playerSpawnY) + _root.World.playerScreenY;
temp.mc._x = _local20;
temp.mc._y = _local19;
_local2++;
}
_local14 = 1400;
_local13 = 1470;
_local17 = 64;
flyHQ = new com.kaboose.games.dinosoars.Nest(_local14, _local13, _local17, "flynest");
flyHQ.mc = gfxEnemies.CreateSprite("fNest");
_local20 = (_local14 - _root.World.playerSpawnX) + _root.World.playerScreenX;
_local19 = (_local13 - _root.World.playerSpawnY) + _root.World.playerScreenY;
flyHQ.mc._x = _local20;
flyHQ.mc._y = _local19;
_root.worldContainer._visible = true;
}
function gameLoop() {
if (fpsInt == undefined) {
fpsInt = setInterval(fps, 1000);
}
if (!Controller.gamePaused) {
PlayerObj.Verlet();
var _local7 = 0;
var _local8 = 0;
var _local11 = PlayerObj.colObj.pos;
var _local12 = PlayerObj.colObj.oldpos;
if (PlayerObj.stunned || (!PlayerObj.alive)) {
_local8 = 0;
_local7 = _local8;
} else {
if (PlayerObj.leftPressed) {
_local7 = _local7 - PlayerObj.accel;
} else if (PlayerObj.rightPressed) {
_local7 = _local7 + PlayerObj.accel;
} else {
_local7 = 0;
}
if (PlayerObj.upPressed) {
_local8 = _local8 - (PlayerObj.accel + _root.World.GRAV);
} else if (PlayerObj.downPressed) {
if (!PlayerObj.onGround) {
_local8 = _local8 + (PlayerObj.accel + _root.World.GRAV);
}
}
}
var _local9 = _local11.x - _local12.x;
var _local14 = _local11.y - _local12.y;
var _local13 = mMin(PlayerObj.maxSpeed, mMax(-1 * PlayerObj.maxSpeed, _local9 + _local7));
var _local10 = mMin(PlayerObj.maxSpeed, mMax(-1 * PlayerObj.maxSpeed, _local14 + _local8));
if (int(_local10) != 0) {
PlayerObj.onGround = false;
PlayerObj.colObj.slopeN = undefined;
if (PlayerObj.stunned) {
PlayerObj.anim = 5;
PlayerObj.lockAnimation = false;
PlayerObj.SetAnimation();
} else {
PlayerObj.anim = 2;
}
} else if (PlayerObj.colObj.slopeN != undefined) {
if (PlayerObj.colObj.colV < 0) {
if (!PlayerObj.onGround) {
if (PlayerObj.stunned) {
PlayerObj.anim = 30;
PlayerObj.lockAnimation = false;
PlayerObj.SetAnimation();
} else {
PlayerObj.anim = 10;
PlayerObj.SetAnimation();
PlayerObj.onGround = true;
}
}
}
}
if (PlayerObj.onGround) {
PlayerObj.mc._rotation = PlayerObj.colObj.slopeN;
if (Math.round(_local9) != 0) {
PlayerObj.anim = 20;
} else {
PlayerObj.anim = 15;
}
} else {
var _local15 = rad2deg(Math.atan(_local10 / _local13));
PlayerObj.mc._rotation = _local15;
}
speedo_mc.maskee_mc.setMask(speedo_mc.masker_mc);
speedo_mc.masker_mc._xscale = (mAbs(_local9) / PlayerObj.maxSpeed) * 100;
_local11.x = _local12.x + _local13;
_local11.y = _local12.y + _local10;
World.UpdateScreenPos(_local13, _local10);
PlayerObj.CollideVsWorldBounds();
if (PlayerObj.totLoops > 0) {
PlayerObj.CollideVsHQ();
}
PlayerObj.SetAnimation();
flyHQ.UpdateClip();
PlayerHQ.UpdateClip();
var _local6 = Controller.returningEnemies.length;
if (_local6 > 0) {
var _local4 = 0;
while (_local4 < _local6) {
var _local3 = Controller.returningEnemies[_local4];
_local3.Verlet();
if (!_local3.stunned) {
_local3.DefineTarget();
_local3.CheckTargetCollision();
}
if (!_local3.stunned) {
_local3.Move();
}
_local3.CollideVsWorldBounds();
_local3.UpdateClip();
_local4++;
}
}
_local6 = Controller.enemies.length;
if (_local6 > 0) {
var _local4 = 0;
while (_local4 < _local6) {
var _local3 = Controller.enemies[_local4];
_local4++;
_local3.Verlet();
if (PlayerObj.alive) {
if (!PlayerObj.stunned) {
if (!PlayerObj.invul) {
if (!_local3.stunned) {
_local3.DefineTarget();
_local3.CheckTargetCollision();
}
}
}
}
if (!_local3.stunned) {
if (!PlayerObj.stunned) {
_local3.Move();
}
}
_local3.CollideVsWorldBounds();
_local3.UpdateClip();
}
}
var _local5 = Controller.frootLoops.length;
if (_local5 > 0) {
var _local4 = 0;
while (_local4 < _local5) {
var _local2 = Controller.frootLoops[_local4];
_local4++;
if (_local2.owner == 2) {
_local2.Verlet();
_local2.UpdateMovement();
_local2.CollideVsWorldBounds();
}
_local2.UpdateClip();
if (_local2.owner != 3) {
if (_local2.owner != 4) {
if (_local2.owner != 5) {
if (_local2.owner != 6) {
if (PlayerObj.alive) {
if (!PlayerObj.stunned) {
_local2.CheckCollision(PlayerObj);
}
if (!Phil.stunned) {
_local2.CheckCollision(Phil);
}
}
}
}
}
}
}
}
if (!Phil.stunned) {
Phil.UpdateMovement();
if (!PlayerObj.stunned) {
if (PlayerObj.alive) {
if (!PlayerObj.invul) {
Phil.CollideVsPlayer();
}
}
}
}
Phil.Verlet();
Phil.CollideVsWorldBounds();
Phil.UpdateClip();
Phil.UpdateSoundRadar();
if (_local9 < 0) {
PlayerObj.mc._xscale = -100;
} else if (_local7 > 0) {
PlayerObj.mc._xscale = 100;
}
World.render();
}
ticks++;
updateAfterEvent();
}
function loadLayers() {
World.AddBKGLayer("mapLayerBack", 1, 0, 0, false);
World.AddBKGLayer("mapLayerMiddle", 0.75, 0, 0, true);
World.AddBKGLayer("mapLayerTop", 1, -500, -300, true);
}
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") {
props = [props];
}
if (pEnd.length == undefined) {
pEnd = [pEnd];
}
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, props);
}
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") {
props = [props];
}
_global.$tweenManager.removeTween(this, props);
};
Mp.isTweening = function () {
return(_global.$tweenManager.isTweening(this));
};
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 () {
return(_global.$tweenManager.isTweenPaused(this));
};
Mp.pauseTween = function () {
_global.$tweenManager.pauseTween(this);
};
Mp.unpauseTween = function () {
_global.$tweenManager.unpauseTween(this);
};
Mp.pauseAllTweens = function () {
_global.$tweenManager.pauseTween();
};
Mp.unpauseAllTweens = function () {
_global.$tweenManager.unpauseTween();
};
Mp.ffTween = function () {
_global.$tweenManager.ffTween(this);
};
Mp.rewTween = function () {
_global.$tweenManager.rewTween(this);
};
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.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);
};
Mp.brightnessTo = function (bright, seconds, animType, delay, callback, extra1, extra2) {
var _local3 = 100 - Math.abs(bright);
var _local2 = 0;
if (bright > 0) {
_local2 = 256 * (bright / 100);
}
var _local5 = {ra:_local3, rb:_local2, ga:_local3, gb:_local2, ba:_local3, bb:_local2};
this.tween(["_ct_"], [_local5], seconds, animType, delay, callback, extra1, extra2);
};
Mp.colorTo = function (destColor, seconds, animType, delay, callback, extra1, extra2) {
var _local3;
if ((destColor == undefined) || (destColor == null)) {
_local3 = {rb:0, ra:100, gb:0, ga:100, bb:0, ba:100};
} else {
_local3 = {rb:destColor >> 16, ra:0, gb:(destColor & 65280) >> 8, ga:0, bb:destColor & 255, ba:0};
}
this.tween(["_ct_"], [_local3], seconds, animType, delay, callback, extra1, extra2);
};
Mp.tintTo = function (rgb, percent, seconds, animType, delay, callback, extra1, extra2) {
var _local6 = rgb >> 16;
var _local7 = (rgb >> 8) & 255;
var _local5 = rgb & 255;
var _local3 = percent / 100;
var _local2 = {rb:_local6 * _local3, gb:_local7 * _local3, bb:_local5 * _local3};
_local2.ra = (_local2.ga = (_local2.ba = 100 - percent));
this.tween(["_ct_"], [_local2], seconds, animType, delay, callback, extra1, extra2);
};
Mp.invertColorTo = function (percent, seconds, animType, delay, callback, extra1, extra2) {
var _local2 = {};
_local2.ra = (_local2.ga = (_local2.ba = 100 - (2 * percent)));
_local2.rb = (_local2.gb = (_local2.bb = percent * 2.55));
this.tween(["_ct_"], [_local2], seconds, animType, delay, callback, extra1, extra2);
};
Mp.brightOffsetTo = function (percent, seconds, animType, delay, callback, extra1, extra2) {
var _local2 = 256 * (percent / 100);
var _local3 = {ra:100, rb:_local2, ga:100, gb:_local2, ba:100, bb:_local2};
this.tween(["_ct_"], [_local3], seconds, animType, delay, callback, extra1, extra2);
};
Mp.contrastTo = function (percent, seconds, animType, delay, callback, extra1, extra2) {
var _local2 = {};
_local2.ra = (_local2.ga = (_local2.ba = percent));
_local2.rb = (_local2.gb = (_local2.bb = 128 - (1.28 * percent)));
this.tween(["_ct_"], [_local2], 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.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;
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", "ffTween", "rewTween", "getFrame", "setFrame", "_frame", "frameTo", "alphaTo", "brightnessTo", "colorTo", "colorTo", "colorTransformTo", "invertColorTo", "tintTo", "scaleTo", "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;
var Prefabs;
Prefabs = {Peak22_1:[[15, 14]], Peak22_2:[[0, 0, 15, 14, 0, 0], [15, 19, 1, 1, 18, 14]], Jump45_2_L:[[0, 3], [3, 1]], Jump45_1_L:[[0, 0], [3, 1]], Jump45_2_R:[[0, 0, 0], [0, 2, 0], [0, 1, 2]], Jump45_1_R:[[0, 0], [1, 2]], Tree_1:[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 9, 1, 1, 1, 1, 11, 12, 8, 6, 5, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]]};
var ledges = [1348.95, 504.55, 100, 33, 1248.95, 504.6, 100, 17, 1248.95, 404.6, 100, 15, 1699.95, 804.55, 100, 4, 2099.95, 2102.55, 100, 18, 1999.95, 2153.55, 100, 18, 1999.95, 2053.55, 100, 16, 1699.95, 2203.95, 100, 18, 1699.95, 2103.95, 100, 16, 1899.95, 2153.55, 100, 33, 1799.95, 2153.55, 100, 33, 1499.95, 2203.95, 100, 33, 1599.95, 2203.95, 100, 33, 599.95, 1854.55, 100, 17, 699.95, 1904.55, 100, 17, 999.95, 1954.5, 100, 17, 999.95, 1854.55, 100, 15, 599.95, 1754.55, 100, 15, 699.95, 1804.55, 100, 15, 499.95, 1804.55, 100, 33, 899.95, 1904.55, 100, 33, 1099.95, 1954.5, 100, 33, 799.95, 1904.55, 100, 33, 998.95, 1003.55, 100, 17, 898.95, 953.55, 100, 17, 798.95, 903.55, 100, 17, 998.95, 903.55, 100, 15, 898.95, 853.55, 100, 15, 798.95, 803.55, 100, 15, 1098.95, 1003.55, 100, 33, 698.95, 853.55, 100, 33, 598.95, 853.55, 100, 33, 997.95, 1455.5, 100, 17, 697.95, 1405.5, 100, 17, 597.95, 1355.55, 100, 17, 697.95, 1305.55, 100, 15, 997.95, 1355.55, 100, 15, 1097.95, 1455.5, 100, 33, 897.95, 1405.5, 100, 33, 797.95, 1405.5, 100, 33, 1997.95, 1604.55, 100, 18, 1797.95, 1654.55, 100, 18, 1697.95, 1704.55, 100, 18, 1797.95, 1554.55, 100, 16, 1697.95, 1604.55, 100, 16, 1897.95, 1604.55, 100, 33, 1597.95, 1704.55, 100, 33, 1497.95, 1704.55, 100, 33, 2049.95, 1204.55, 100, 18, 2049.95, 1104.55, 100, 16, 1749.95, 1254.55, 100, 18, 1649.95, 1304.55, 100, 18, 1749.95, 1154.55, 100, 16, 1649.95, 1204.55, 100, 16, 1949.95, 1204.55, 100, 33, 1849.95, 1204.55, 100, 33, 1549.95, 1304.55, 100, 33, 1449.95, 1304.55, 100, 33, 2099.95, 702.55, 100, 18, 1999.95, 702.55, 100, 33, 1899.95, 753.55, 100, 18, 1899.95, 653.55, 100, 16, 1799.95, 803.55, 100, 18, 1799.95, 703.55, 100, 16, 1499.95, 954.55, 100, 18, 1499.95, 854.55, 100, 16, 1599.95, 904.55, 100, 33, 1399.95, 954.55, 100, 33, 1548.95, 504.55, 100, 33, 1448.95, 504.55, 100, 33, 1148.95, 454.55, 100, 33];
var cliffTiles = [2600, 2158, 100, 17, 2400, 2058, 100, 31, 2500, 2058, 100, 31, 2600, 2058, 100, 31, 2400, 2158, 100, 17, 2500, 2158, 100, 18, 2600, 1658, 100, 17, 2400, 1558, 100, 31, 2500, 1558, 100, 31, 2600, 1558, 100, 31, 2400, 1658, 100, 17, 2500, 1658, 100, 18, 2600, 1058, 100, 17, 2400, 958, 100, 31, 2500, 958, 100, 31, 2600, 958, 100, 31, 2400, 1058, 100, 17, 2500, 1058, 100, 18, 2600, 462, 100, 17, 2400, 362, 100, 31, 2500, 362, 100, 31, 2600, 362, 100, 31, 2400, 462, 100, 17, 2500, 462, 100, 18, 198, 2157, 100, 18, 198, 2057, 100, 31, 98, 2057, 100, 31, -2, 2057, 100, 31, 98, 2157, 100, 17, -2, 2157, 100, 18, 198, 1657, 100, 18, 198, 1557, 100, 31, 98, 1557, 100, 31, -2, 1557, 100, 31, 98, 1657, 100, 17, -2, 1657, 100, 18, 198, 1057, 100, 18, 198, 957, 100, 31, 98, 957, 100, 31, -2, 957, 100, 31, 98, 1057, 100, 17, -2, 1057, 100, 18, 198, 461, 100, 18, 198, 361, 100, 31, 98, 361, 100, 31, -2, 361, 100, 31, 98, 461, 100, 17, -2, 461, 100, 18];
var mapPickups = [[262, 130], [466, 192], [670, 130], [872, 192], [1078, 130], [1282, 192], [1486, 130], [1691, 192], [1894, 130], [2093, 192], [2302, 130], [2470, 196], [645, 806], [741, 806], [2055, 659], [2151, 659], [1910, 1163], [2006, 1163], [1502, 1265], [1598, 1265], [849, 1361], [945, 1361], [849, 1855], [945, 1855], [1550, 1659], [1646, 1659], [1554, 2164], [1650, 2164], [1865, 2113], [1961, 2113], [546, 1757], [2054, 1571], [646, 1306], [2152, 2063], [1191, 409], [1598, 460], [1502, 459], [1405, 459], [1146, 963], [1456, 917], [1657, 866], [1144, 1409], [1146, 1908], [1958, 1571], [245, 955], [149, 954], [52, 954], [2651, 959], [2555, 958], [2458, 958], [245, 1567], [149, 1566], [52, 1566], [2651, 1571], [2555, 1570], [2458, 1570], [245, 2069], [149, 2068], [52, 2068], [2651, 2073], [2555, 2072], [2458, 2072], [502, 2068], [957, 2154], [1907, 2348], [2277, 2286], [2243, 1800], [2263, 1416], [2105, 926], [2552, 754], [281, 739], [998, 597], [801, 1152], [474, 1122], [348, 1423], [1037, 1694], [1634, 1939], [652, 1787], [1723, 2450], [1680, 1483], [155, 2459], [359, 2521], [563, 2459], [765, 2521], [971, 2459], [1175, 2521], [1379, 2459], [1584, 2521], [1319, 2272], [1986, 2521], [2195, 2459], [2400, 2521], [746, 1832], [1048, 1884], [746, 1341], [1055, 1388], [1701, 1238], [1800, 1193], [1748, 1636], [1850, 1587], [1550, 888], [1730, 818], [1848, 730], [1947, 689], [850, 833], [945, 887], [1044, 935], [1305, 436], [2651, 374], [2555, 373], [2458, 373], [2097, 1138], [1749, 2137], [2049, 2092]];
fscommand ("allowscale", false);
Controller = new com.kaboose.games.dinosoars.GameManager(gameID, trackerURL);
trace("wtf");
gfxFrootLoops = new com.kaboose.games.dinosoars.SpriteManager(this.createEmptyMovieClip("tilebuffer", 1001));
gfxEnemies = new com.kaboose.games.dinosoars.SpriteManager(this.createEmptyMovieClip("enemybuffer", 1000));
gfxPlayer = new com.kaboose.games.dinosoars.SpriteManager(this.createEmptyMovieClip("playerbuffer", 1002));
gfxHUD = new com.kaboose.games.dinosoars.SpriteManager(this.createEmptyMovieClip("hudbuffer", 1003));
Controller.spriteBuffers.push(gfxPlayer, gfxFrootLoops, gfxEnemies, gfxHUD);
keyd = Key.isDown;
kL = 37;
kR = 39;
kU = 38;
kD = 40;
kSP = 32;
mAbs = Math.abs;
mMax = Math.max;
mMin = Math.min;
_quality = "HIGH";
function fps() {
HUD.mc.fpsText = ticks - oldticks;
oldticks = ticks;
}
Sound.prototype.atcPlay = function (id, loops, offset) {
this.attachSound(id);
if (this.position <= 0) {
if ((loops <= 0) || (loops == undefined)) {
if (offset != undefined) {
this.start();
} else {
this.start(offset, 0);
}
} else if (offset != undefined) {
this.start(offset, loops);
} else {
this.start(0, loops);
}
}
this.onSoundComplete = function () {
};
};
var trackerVars_get = new LoadVars();
var trackerVars_send = new LoadVars();
trackerVars_send.gameID = _root.gameID;
trackerVars_get.onLoad = function (success) {
if (success) {
trace("Your gameplay has been tracked succesfully");
}
};
addGamePlay = function () {
trace("ADD GAMEPLAY NOW!");
trace("Game ID: " + trackerVars_send.gameID);
trackerVars_send.sendAndLoad(_root.trackerURL, trackerVars_get, "POST");
};
_global.home = this;
gk1 = "frootLoopsFlight";
loadVariables (userInfoURL, this);
gotKey = true;
_global.loadScores = function (score, obj) {
delete home.scoreList;
home.scoreList = new LoadVars();
home.scoreList.onLoad = function (success) {
if (success) {
for (var _local1 in home.scoreList) {
}
setScores(1, obj);
} else {
setScores(0, obj);
}
};
if (score != undefined) {
trace("You have submitted a score to the list: " + score);
home.scoreList.load(score);
} else {
var _local2 = (home.highScoresURL + "?gk=") + home.gk1;
home.scoreList.load(_local2);
}
};
_global.getScores = function (score, obj) {
if ((score != undefined) || (score != null)) {
var _local1 = score;
var _local3 = (((((((((home.highScoresURL + "?gk=") + home.gk1) + "&uk=") + home.userKey) + "&s=") + _local1) + "&es=") + encrypt(_local1)) + "&sd=") + home.seed;
loadScores(_local3, obj);
} else {
loadScores(null, obj);
}
};
_global.setScores = function (type, obj) {
if (type) {
if (home.scoreList.rank != undefined) {
home.returnedInfo = "Good Job, you've made the list. Your RANK is " + home.scoreList.rank;
} else {
home.returnedInfo = "You're score did not make the list";
}
var _local1 = 1;
while (_local1 <= 10) {
obj["total_" + _local1] = (home.scoreList[("hs_" + _local1) + "_score"] + " pts - ") + home.scoreList[("hs_" + _local1) + "_username"];
_local1++;
}
}
};
_global.clearScores = function (obj) {
var _local1 = 1;
while (_local1 <= 10) {
obj["total_" + _local1] = "";
_local1++;
}
obj.total_1 = "Retrieving...";
};
_global.encrypt = function (encScore) {
encScore = encScore.toString();
my_date = new Date();
my_date.hours = my_date.getUTCHours();
my_date.minutes = my_date.getUTCMinutes();
my_date.seconds = my_date.getUTCSeconds();
if (my_date.seconds < 10) {
my_date.seconds = "0" + my_date.seconds;
}
if (my_date.minutes < 10) {
my_date.minutes = "0" + my_date.minutes;
}
if (my_date.hours < 10) {
my_date.hours = "0" + my_date.hours;
}
home.seed = ((((my_date.hours + ":") + my_date.minutes) + ":") + my_date.seconds) + ":28";
charList = new Array(2, 8, 10, 5, 4, 1, 11, 7);
keyChars = new Array();
i = 0;
while (i < 8) {
var _local1 = charList[i];
keyChars.push(seed.charAt(_local1 - 1));
i++;
}
snafuText = "";
i = 0;
while (i < encScore.length) {
tempHolder = keyChars.shift();
keyChars.push(tempHolder);
tempName = "ascii" + i;
tempName = encScore.charCodeAt(i) + Math.round(tempHolder);
snafuText = snafuText + String.fromCharCode(tempName);
i++;
}
return(snafuText);
};
Function.prototype.callIn = function (msec, args) {
var f = this;
var i = setInterval(function () {
f.call(null, args);
clearInterval(i);
}, msec);
};
function randomRange(min, max) {
return(Math.floor(Math.random() * ((max - min) + 1)) + min);
}
function hitAngle(x1, y1, x2, y2) {
var _local1 = (Math.atan((x1 - x2) / (y1 - y2)) * 180) / Math.PI;
return(_local1);
}
function rad2deg(rad) {
return((rad * 180) / Math.PI);
}
function deg2rad(deg) {
return((deg * Math.PI) / 180);
}
function formatNumber($number) {
n = $number.toString();
insPTR = 1;
if (n.indexOf(".") == -1) {
t = "";
n = n.split("");
} else {
t = n.substr(n.indexOf("."), n.length);
n = n.substr(0, n.indexOf(".")).split("");
}
for (ptr in n) {
t = n[ptr] + t;
if ((insPTR++) == 3) {
insPTR = 1;
t = (((isNaN(n[0]) && (ptr > 1)) || ((!isNaN(n[0])) && (ptr >= 1))) ? ("," + t) : (t));
}
}
return(t);
}
Frame 4
Controller.AddScreen("scr_MainMenu");
stop();
Frame 7
if (!Controller.mapLoaded) {
loadMap();
}
Frame 8
attachMovie("screen_creatingLevel", "scr", 999666);
if (!Controller.mapLoaded) {
World.AddBKGLayer("mapLayerBack", 1, 0, 0, false);
}
Frame 15
if (!Controller.mapLoaded) {
World.AddBKGLayer("mapLayerMiddle", 0.75, 0, 0, true);
}
Frame 22
if (!Controller.mapLoaded) {
World.AddBKGLayer("mapLayerTop", 1, -500, -300, true);
}
Frame 29
scr.removeMovieClip();
CreateGameObjects();
Frame 30
World.init();
stop();
Instance of Symbol 19 MovieClip "fl_1" in Symbol 36 MovieClip [screen_Loader] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 22 MovieClip "fl_2" in Symbol 36 MovieClip [screen_Loader] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 25 MovieClip "fl_3" in Symbol 36 MovieClip [screen_Loader] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 28 MovieClip "fl_4" in Symbol 36 MovieClip [screen_Loader] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 31 MovieClip "fl_5" in Symbol 36 MovieClip [screen_Loader] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 97 MovieClip Frame 1
stop();
Symbol 149 MovieClip Frame 21
_root.PlayerObj.lockAnimation = false;
_root.PlayerObj.SetAnimation();
stop();
Symbol 216 MovieClip Frame 20
_root.PlayerObj.lockAnimation = false;
_root.PlayerObj.SetAnimation();
stop();
Symbol 223 MovieClip Frame 94
stop();
Symbol 238 MovieClip [fNest] Frame 1
Symbol 275 MovieClip Frame 1
_parent.owner.playJumpSound();
Symbol 301 MovieClip Frame 36
_parent.gotoAndStop("walk");
Symbol 308 MovieClip Frame 40
_parent.gotoAndStop("walk");
Symbol 309 MovieClip [phil] Frame 2
stop();
Symbol 314 MovieClip Frame 1
stop();
Symbol 362 MovieClip [scr_Highscores] Frame 1
clearScores(this);
getScores(null, this);
Symbol 392 MovieClip [scr_HighscoresEndGame] Frame 1
var tot = 0;
for (var i in _root.Controller.gameScores) {
tot = tot + _root.Controller.gameScores[i][0];
}
clearScores(this);
getScores(tot, this);
Symbol 439 MovieClip Frame 312
stop();
Symbol 440 Button
on (release) {
nextFrame();
}
Symbol 478 MovieClip Frame 20
stop();
Symbol 480 Button
on (release) {
_root.Controller.AddScreen("scr_MainMenu");
}
Symbol 481 MovieClip [scr_Instructions] Frame 1
stop();
Symbol 491 MovieClip Frame 1
stop();
Symbol 549 MovieClip Frame 1
link = "mapObj_rock_wall_left";
Symbol 574 MovieClip Frame 1
stop();
Symbol 595 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);
}
}
Symbol 596 MovieClip [__Packages.com.kaboose.games.worldengine.WorldRenderer] Frame 0
class com.kaboose.games.worldengine.WorldRenderer
{
var mc, containerMC, bkgContainer, oX, oY, oTiles, oW, oH, areaWidth, areaHeight, playerSpawnX, playerSpawnY, playerScreenX, playerScreenY, XMIN, XMAX, YMIN, YMAX, GRAV, DRAG, FRICTION, TILERAD, xPos, yPos, oX_oW, oY_oH, noo, oldax, olday;
function WorldRenderer ($container, $mc) {
trace("New World Renderer");
mc = $mc;
containerMC = $container;
bkgContainer = $container.createEmptyMovieClip("worldBKGContainer", 0);
oX = [];
oY = [];
oTiles = [];
oW = [];
oH = [];
}
function dAddBKGLayer(layersArray) {
}
function AddBKGLayer($linkageClipToUse, $speed, $offsetx, $offsety, $transparent) {
var _local2 = bkgLayers.length;
var _local3 = bkgContainer.createEmptyMovieClip("container" + _local2, _local2);
bkgLayers.push(new com.kaboose.games.worldengine.StaticWorldLayer($linkageClipToUse, _local3, $speed, areaWidth, areaHeight, $offsetx, $offsety, $transparent));
}
function MoveBKGLayers($dx, $dy) {
for (var _local4 in bkgLayers) {
bkgLayers[_local4].container.mc._x = $dx * bkgLayers[_local4].speed;
bkgLayers[_local4].container.mc._y = $dy * bkgLayers[_local4].speed;
}
}
function SetPlayerSpawn(x, y) {
playerSpawnX = x;
playerSpawnY = y;
}
function SetPlayerScreenPosition(x, y) {
playerScreenX = x;
playerScreenY = y;
}
function SetArea(width, height) {
areaWidth = width;
areaHeight = height;
}
function SetWorldBounds(xmin, xmax, ymin, ymax) {
XMIN = xmin;
XMAX = xmax;
YMIN = ymin;
YMAX = ymax;
}
function SetGravity(grav) {
GRAV = grav;
}
function SetDrag(drag) {
DRAG = drag;
}
function SetFriction(friction) {
FRICTION = friction;
}
function SetTileSize(size) {
TILERAD = size;
}
function UpdateScreenPos($dx, $dy) {
xPos = xPos + $dx;
yPos = yPos + $dy;
}
function crObjMC(n) {
var _local8 = false;
var _local5 = oTiles[n];
var _local7 = mc.createEmptyMovieClip(n, n);
_local7._x = oX[n];
_local7._y = oY[n];
var _local2 = _local5.length / tileAttributeCount;
if (_local2 != 1) {
_local8 = true;
}
while (_local2--) {
var _local4 = tileAttributeCount;
var _local3 = _local7.attachMovie(_local5[_local2 * _local4], _local2, _local2);
_local3.gotoAndStop(_local5[(_local2 * _local4) + 1]);
_local3.objectID = n;
_local3._xscale = _local5[(_local2 * _local4) + 5];
_local3._yscale = _local5[(_local2 * _local4) + 6];
if (_local8) {
_local3._x = _local5[(_local2 * _local4) + 2];
_local3._y = _local5[(_local2 * _local4) + 3];
}
}
nOfVisObj++;
}
function addObject(objectIndex) {
trace("add object");
var _local4 = objectIndex;
var _local8 = Math.max(int(oX[_local4] / areaWidth), 0);
var _local6 = Math.max(int(oY[_local4] / areaHeight), 0);
var _local7 = Math.max(int(oX_oW[_local4] / areaWidth), 0);
var _local5 = Math.max(int(oY_oH[_local4] / areaHeight), 0);
var _local3 = _local8;
while (_local3 <= _local7) {
var _local2 = _local6;
while (_local2 <= _local5) {
if (a[_local3] == undefined) {
a[_local3] = [];
}
if (a[_local3][_local2] == undefined) {
a[_local3][_local2] = [];
}
a[_local3][_local2][_local4] = true;
_local2++;
}
_local3++;
}
}
function getZone(object) {
var _local2 = {x:Number, y:Number};
_local2.x = int(object.colObj.pos.x / areaWidth);
_local2.y = int(object.colObj.pos.y / areaHeight);
return(_local2);
}
function registerObjects() {
if (!((areaWidth > 0) && (areaHeight > 0))) {
trace("registerObjects() failed:");
trace("Screen dimensions (areaWidth, areaHeight) not defined!");
return(undefined);
}
a = [];
var _local7 = Math.max;
var _local4 = 0;
while (_local4 < noo) {
var _local9 = _local7(int(oX[_local4] / areaWidth), 0);
var _local6 = _local7(int(oY[_local4] / areaHeight), 0);
var _local8 = _local7(int(oX_oW[_local4] / areaWidth), 0);
var _local5 = _local7(int(oY_oH[_local4] / areaHeight), 0);
var _local2 = _local9;
while (_local2 <= _local8) {
var _local3 = _local6;
while (_local3 <= _local5) {
if (a[_local2] == undefined) {
a[_local2] = [];
}
if (a[_local2][_local3] == undefined) {
a[_local2][_local3] = [];
}
a[_local2][_local3][_local4] = true;
_local3++;
}
_local2++;
}
_local4++;
}
}
function generateObject(linkage, startx, starty, width, height, scale, frame) {
oX.push(startx);
oY.push(starty);
oTiles.push([linkage, frame, startx, starty, null, scale, scale, true]);
oW.push(width);
oH.push(height);
}
function generateTile(startx, starty, scale, type, tileset, colActive) {
var _local2 = (TILERAD * 2) * (scale / 100);
var _local4 = type;
if ((type == 30) || (type == 32)) {
var _local5 = true;
_local5 = false;
} else {
var _local5 = false;
}
var _local3 = new com.kaboose.games.worldengine.CollisionTile(startx + (_local2 / 2), starty + (_local2 / 2), _local2, _local2, _local5);
if (colActive) {
_local3.SetState(_local4);
}
oX.push(startx);
oY.push(starty);
if (tileset.length > 3) {
var _local9 = true;
} else {
var _local9 = false;
}
oTiles.push([tileset, _local4 + 1, startx, starty, _local3, scale, scale, _local9]);
oW.push(_local2);
oH.push(_local2);
}
function generatePrefab(startx, starty, scale, map, tileset) {
var _local13 = map[0].length;
var _local18 = map.length;
var _local8 = TILERAD * (scale / 100);
var _local10 = _local8 * 2;
var _local9 = _local8 * 2;
var _local14 = new Array();
var _local3 = 0;
while (_local3 < _local18) {
var _local2 = 0;
while (_local2 < _local13) {
if (map[_local3][_local2] != 0) {
var _local5 = _local2 * _local10;
var _local4 = _local3 * _local9;
var _local7 = map[_local3][_local2];
var _local6 = new com.kaboose.games.worldengine.CollisionTile((_local5 + startx) + _local8, (_local4 + starty) + _local8, _local10, _local9);
_local6.SetState(_local7);
_local14.push(tileset, _local7 + 1, _local5, _local4, _local6, scale, scale, false);
}
_local2++;
}
_local3++;
}
oX.push(startx);
oY.push(starty);
oTiles.push(_local14);
oW.push(_local13 * _local10);
oH.push(_local18 * _local9);
}
function init() {
trace("= Initializing WorldRenderer =");
noo = oX.length;
trace("Total Objects in map: " + noo);
oldax = null;
olday = null;
xPos = (sOffX + playerSpawnX) - playerScreenX;
yPos = (sOffY + playerSpawnY) - playerScreenY;
_root.ticks = 0;
oX_oW = [];
oY_oH = [];
nOfVisObj = 0;
var _local3 = 0;
while (_local3 < noo) {
oX_oW[_local3] = oX[_local3] + oW[_local3];
oY_oH[_local3] = oY[_local3] + oH[_local3];
_local3++;
}
registerObjects();
_root.Controller.startEngine();
}
function render() {
var _local19 = Math.round(xPos);
var _local18 = Math.round(yPos);
MoveBKGLayers(sOffX - _local19, sOffY - _local18);
var _local11 = int(_local19 / areaWidth);
var _local10 = int(_local18 / areaHeight);
if ((_local11 == oldax) && (_local10 == olday)) {
for (var _local20 in mc) {
if (!oV[_local20]) {
removeMovieClip(mc[_local20]);
nOfVisObj--;
break;
}
}
} else {
oldax = _local11;
olday = _local10;
ar = [];
for (var _local20 in a[_local11][_local10]) {
ar[_local20] = true;
}
for (var _local20 in a[_local11 + 1][_local10]) {
ar[_local20] = true;
}
for (var _local20 in a[_local11][_local10 + 1]) {
ar[_local20] = true;
}
for (var _local20 in a[_local11 + 1][_local10 + 1]) {
ar[_local20] = true;
}
}
_root.bkgHolder._y = sOffY - _local18;
var _local25 = oX;
var _local23 = oY;
var _local24 = oX_oW;
var _local22 = oY_oH;
var _local27 = _local19 + areaWidth;
var _local26 = _local18 + areaHeight;
oV = [];
var _local20 = 0;
while (_local20 <= ar.length) {
if (_local24[_local20] > _local19) {
if (_local25[_local20] < _local27) {
if (_local22[_local20] > _local18) {
if (_local23[_local20] < _local26) {
oV[_local20] = true;
var _local9 = oTiles[_local20];
if (_local9[7]) {
if (!mc[_local20]) {
crObjMC(_local20);
}
}
var _local8 = _local9.length / tileAttributeCount;
while (_local8--) {
var _local4 = _local9[(_local8 * tileAttributeCount) + 4];
if (_local4 != null) {
if (_local4.CTYPE > 0) {
_root.PlayerObj.CollideVsTile(_local4);
}
}
}
}
}
}
}
_local20++;
}
mc._x = sOffX - _local19;
mc._y = sOffY - _local18;
var _local12 = Math.round;
var _local28 = Math.floor;
var _local21 = _root.Controller.frootLoops.length;
if (_local21 > 0) {
var _local15 = 0;
while (_local15 < _local21) {
var _local3 = _root.Controller.frootLoops[_local15];
_local15++;
if (_local3.owner == 2) {
var _local14 = _local12(_local3.colObj.pos.x);
var _local13 = _local12(_local3.colObj.pos.y);
var _local17 = _local12(_local3.colObj.oldpos.x);
var _local16 = _local12(_local3.colObj.oldpos.y);
if (_local17 == _local14) {
if (_local16 == _local13) {
if ((_local3.yspeed > -5E-12) && (_local3.yspeed < 5E-12)) {
_local3.OwnerChange(1);
}
}
}
var _local7 = int(_local14 / areaWidth);
var _local6 = int(_local13 / areaHeight);
var _local5 = [];
for (_local20 in a[_local7][_local6]) {
_local5[_local20] = true;
}
for (_local20 in a[_local7 + 1][_local6]) {
_local5[_local20] = true;
}
for (_local20 in a[_local7][_local6 + 1]) {
_local5[_local20] = true;
}
for (_local20 in a[_local7 + 1][_local6 + 1]) {
_local5[_local20] = true;
}
for (_local20 in _local5) {
var _local9 = oTiles[_local20];
var _local8 = _local9.length / tileAttributeCount;
while (_local8--) {
var _local4 = _local9[(_local8 * tileAttributeCount) + 4];
if (_local4.CTYPE > 0) {
_local3.CollideVsTile(_local4);
}
}
}
}
}
}
}
var bkgLayers = [];
var tileAttributeCount = 8;
var oV = [];
var ar = [];
var a = [];
var nOfVisObj = 0;
var sOffX = 0;
var sOffY = 0;
}
Symbol 597 MovieClip [__Packages.com.kaboose.games.worldengine.StaticWorldLayer] Frame 0
class com.kaboose.games.worldengine.StaticWorldLayer
{
var speed, container, mc;
function StaticWorldLayer (clipToDraw, superContainer, $speed, maskW, maskH, $offsetx, $offsety, $transparent) {
speed = $speed;
container = superContainer;
mc = superContainer.createEmptyMovieClip("mc", 2);
var clip = _root.attachMovie(clipToDraw, "bigClip", 548684);
clip._alpha = 0;
var clipW = clip._width;
var clipH = clip._height;
var rows = Math.ceil(clipW / w);
var cols = Math.ceil(clipH / h);
var bmpDataArray = [];
var col = 0;
while (col < cols) {
var row = 0;
while (row < rows) {
if ($transparent) {
var bmp = (new flash.display.BitmapData(w, h, true, 0));
} else {
var bmp = (new flash.display.BitmapData(w, h, false));
}
var xpos = (w * row);
var ypos = (h * col);
var graphics = [bmp, xpos, ypos];
bmpDataArray.push(graphics);
row++;
}
col++;
}
var k = 0;
trace("bmpDataArray.length = " + bmpDataArray.length);
for (var i in bmpDataArray) {
with (container.mc.createEmptyMovieClip("holder" + k, k)) {
var matrix = (new flash.geom.Matrix($speed, 0, 0, $speed, -bmpDataArray[i][1], -bmpDataArray[i][2]));
bmpDataArray[i][0].draw(clip, matrix);
attachBitmap(bmpDataArray[i][0], 0);
_x = bmpDataArray[i][1] + $offsetx;
_y = bmpDataArray[i][2] + $offsety;
}
k++;
}
clip.removeMovieClip();
container.scrollRect = new flash.geom.Rectangle(0, 0, maskW, maskH);
}
function addBMP() {
}
function finishBMP() {
}
static var w = 500;
static var h = 500;
}
Symbol 598 MovieClip [__Packages.com.kaboose.games.worldengine.CollisionTile] Frame 0
class com.kaboose.games.worldengine.CollisionTile
{
var ID, CTYPE, pos, cloud, xw, yw, minx, maxx, miny, maxy, mc;
function CollisionTile ($x, $y, $xw, $yw, $cloud) {
ID = TID_EMPTY;
CTYPE = CTYPE_EMPTY;
pos = {};
pos.x = $x;
pos.y = $y;
cloud = $cloud;
xw = $xw / 2;
yw = $yw / 2;
minx = pos.x;
maxx = pos.x + xw;
miny = pos.y;
maxy = pos.y + yw;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
}
function Draw() {
mc.gotoAndStop(ID + 1);
}
function SetState($ID) {
if ($ID == TID_EMPTY) {
Clear();
} else {
ID = $ID;
UpdateType();
Draw();
}
}
function Clear() {
ID = TID_EMPTY;
UpdateType();
Draw();
}
function UpdateType() {
if (0 < ID) {
if (ID < CTYPE_45DEG) {
CTYPE = CTYPE_FULL;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
} else if (ID < CTYPE_CONCAVE) {
CTYPE = CTYPE_45DEG;
if (ID == TID_45DEGpn) {
signx = 1;
signy = -1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else if (ID == TID_45DEGnn) {
signx = -1;
signy = -1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else if (ID == TID_45DEGnp) {
signx = -1;
signy = 1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else if (ID == TID_45DEGpp) {
signx = 1;
signy = 1;
sx = signx / Math.SQRT2;
sy = signy / Math.SQRT2;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
} else if (ID < CTYPE_CONVEX) {
CTYPE = CTYPE_CONCAVE;
if (ID == TID_CONCAVEpn) {
signx = 1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONCAVEnn) {
signx = -1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONCAVEnp) {
signx = -1;
signy = 1;
sx = 0;
sy = 0;
} else if (ID == TID_CONCAVEpp) {
signx = 1;
signy = 1;
sx = 0;
sy = 0;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
} else if (ID < CTYPE_22DEGs) {
CTYPE = CTYPE_CONVEX;
if (ID == TID_CONVEXpn) {
signx = 1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONVEXnn) {
signx = -1;
signy = -1;
sx = 0;
sy = 0;
} else if (ID == TID_CONVEXnp) {
signx = -1;
signy = 1;
sx = 0;
sy = 0;
} else if (ID == TID_CONVEXpp) {
signx = 1;
signy = 1;
sx = 0;
sy = 0;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
} else if (ID < CTYPE_22DEGb) {
CTYPE = CTYPE_22DEGs;
if (ID == TID_22DEGpnS) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnnS) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnpS) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGppS) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
} else if (ID < CTYPE_67DEGs) {
CTYPE = CTYPE_22DEGb;
if (ID == TID_22DEGpnB) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnnB) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGnpB) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else if (ID == TID_22DEGppB) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 1) / _local2;
sy = (signy * 2) / _local2;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
} else if (ID < CTYPE_67DEGb) {
CTYPE = CTYPE_67DEGs;
if (ID == TID_67DEGpnS) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnnS) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnpS) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGppS) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
} else if (ID < CTYPE_HALF) {
CTYPE = CTYPE_67DEGb;
if (ID == TID_67DEGpnB) {
signx = 1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnnB) {
signx = -1;
signy = -1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGnpB) {
signx = -1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else if (ID == TID_67DEGppB) {
signx = 1;
signy = 1;
var _local2 = 2.23606797749979;
sx = (signx * 2) / _local2;
sy = (signy * 1) / _local2;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
} else {
CTYPE = CTYPE_HALF;
if (ID == TID_HALFd) {
signx = 0;
signy = -1;
sx = signx;
sy = signy;
} else if (ID == TID_HALFu) {
signx = 0;
signy = 1;
sx = signx;
sy = signy;
} else if (ID == TID_HALFl) {
signx = 1;
signy = 0;
sx = signx;
sy = signy;
} else if (ID == TID_HALFr) {
signx = -1;
signy = 0;
sx = signx;
sy = signy;
} else {
trace("BAAAD TILE!!!!!: ID=" + ID);
return(false);
}
}
} else {
CTYPE = CTYPE_EMPTY;
signx = 0;
signy = 0;
sx = 0;
sy = 0;
}
}
var signx = 0;
var signy = 0;
var sx = 0;
var sy = 0;
static var TID_EMPTY = 0;
static var TID_FULL = 1;
static var TID_45DEGpn = 2;
static var TID_45DEGnn = 3;
static var TID_45DEGnp = 4;
static var TID_45DEGpp = 5;
static var TID_CONCAVEpn = 6;
static var TID_CONCAVEnn = 7;
static var TID_CONCAVEnp = 8;
static var TID_CONCAVEpp = 9;
static var TID_CONVEXpn = 10;
static var TID_CONVEXnn = 11;
static var TID_CONVEXnp = 12;
static var TID_CONVEXpp = 13;
static var TID_22DEGpnS = 14;
static var TID_22DEGnnS = 15;
static var TID_22DEGnpS = 16;
static var TID_22DEGppS = 17;
static var TID_22DEGpnB = 18;
static var TID_22DEGnnB = 19;
static var TID_22DEGnpB = 20;
static var TID_22DEGppB = 21;
static var TID_67DEGpnS = 22;
static var TID_67DEGnnS = 23;
static var TID_67DEGnpS = 24;
static var TID_67DEGppS = 25;
static var TID_67DEGpnB = 26;
static var TID_67DEGnnB = 27;
static var TID_67DEGnpB = 28;
static var TID_67DEGppB = 29;
static var TID_HALFd = 30;
static var TID_HALFr = 31;
static var TID_HALFu = 32;
static var TID_HALFl = 33;
static var CTYPE_EMPTY = 0;
static var CTYPE_FULL = 1;
static var CTYPE_45DEG = 2;
static var CTYPE_CONCAVE = 6;
static var CTYPE_CONVEX = 10;
static var CTYPE_22DEGs = 14;
static var CTYPE_22DEGb = 18;
static var CTYPE_67DEGs = 22;
static var CTYPE_67DEGb = 26;
static var CTYPE_HALF = 30;
}
Symbol 599 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);
}
}
Symbol 600 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);
}
}
Symbol 601 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);
}
}
Symbol 602 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);
}
}
Symbol 603 MovieClip [__Packages.com.kaboose.games.dinosoars.FrootLoop] Frame 0
class com.kaboose.games.dinosoars.FrootLoop
{
var xspeed, yspeed, colObj, r, ID, frame, name, mc;
function FrootLoop ($posx, $posy, $r, $name, $bounce, $xspeed, $yspeed, $frame, $ID) {
if ($xspeed != undefined) {
xspeed = $xspeed;
} else {
xspeed = 1;
}
if ($yspeed != undefined) {
yspeed = $yspeed;
} else {
yspeed = 1;
}
colObj = new com.kaboose.games.worldengine.Sphere($posx, $posy, $r, $name, $bounce, this);
r = $r;
ID = $ID;
frame = $frame;
name = $name;
}
function Verlet() {
colObj.Verlet();
}
function ReportCollisionVsWorld(px, py, dx, dy, obj) {
colObj.ReportCollisionVsWorld(px, py, dx, dy, obj);
}
function CollideVsWorldBounds() {
colObj.CollideVsWorldBounds();
}
function CollideVsTile(tile) {
colObj.CollideVsTile(tile);
}
function UpdateMovement() {
xspeed = xspeed * airFriction;
yspeed = yspeed * airFriction;
colObj.pos.x = colObj.pos.x + xspeed;
colObj.pos.y = colObj.pos.y + yspeed;
}
function UpdateClip() {
var _local3 = _root;
var _local5 = _local3.PlayerObj.colObj.pos.x - colObj.pos.x;
var _local4 = _local3.PlayerObj.colObj.pos.y - colObj.pos.y;
mc._y = _local3.PlayerObj.mc._y - _local4;
mc._x = _local3.PlayerObj.mc._x - _local5;
}
function OwnerChange($newOwner) {
owner = $newOwner;
if (($newOwner == 3) || ($newOwner == 5)) {
_root.gfxFrootLoops.DestroyMC(mc);
}
}
function CheckCollision(_object) {
var _local6 = _root.mAbs(_object.colObj.pos.x - colObj.pos.x);
var _local7 = _root.mAbs(_object.colObj.pos.y - colObj.pos.y);
var _local4 = (colObj.r + _object.colObj.r) - 2;
if (_local6 < _local4) {
if (_local7 < _local4) {
if (_object.name == "player") {
OwnerChange(3);
_object.AddLoop(this);
} else if (_object.name == "worm") {
_object.EatLoop(this);
} else {
var _local5 = _root.hitAngle(_object.colObj.oldpos.x, _object.colObj.oldpos.y, _object.colObj.pos.x, _object.colObj.pos.y);
var _local9 = (1 * Math.cos(_local5)) + _object.xspeed;
var _local8 = (1 * Math.sin(_local5)) + _object.yspeed;
xspeed = xspeed + _local9;
yspeed = yspeed + _local8;
OwnerChange(2);
UpdateClip();
}
}
}
}
var airFriction = 0.5;
var groundFriction = 0.8;
var pointValue = 1000;
var owner = 1;
}
Symbol 604 MovieClip [__Packages.com.kaboose.games.worldengine.DynamicCollisionObject] Frame 0
class com.kaboose.games.worldengine.DynamicCollisionObject
{
var pos, oldpos, px, py;
function DynamicCollisionObject () {
}
function Verlet() {
var _local4 = _root.World.DRAG;
var _local8 = _root.World.GRAV;
var _local5 = pos;
var _local3 = oldpos;
var _local7 = _local3.x;
var _local6 = _local3.y;
_local3.x = (px = _local5.x);
_local3.y = (py = _local5.y);
_local5.x = _local5.x + ((_local4 * _local3.x) - (_local4 * _local7));
_local5.y = _local5.y + (((_local4 * _local3.y) - (_local4 * _local6)) + _local8);
}
static var CTYPE_EMPTY = 0;
static var CTYPE_FULL = 1;
static var CTYPE_45DEG = 2;
static var CTYPE_CONCAVE = 6;
static var CTYPE_CONVEX = 10;
static var CTYPE_22DEGs = 14;
static var CTYPE_22DEGb = 18;
static var CTYPE_67DEGs = 22;
static var CTYPE_67DEGb = 26;
static var CTYPE_HALF = 30;
}
Symbol 605 MovieClip [__Packages.com.kaboose.games.worldengine.Sphere] Frame 0
class com.kaboose.games.worldengine.Sphere extends com.kaboose.games.worldengine.DynamicCollisionObject
{
var owner, name, pos, oldpos, r, bounce, slopeN;
function Sphere ($posx, $posy, $r, $name, $bounce, $owner) {
super();
owner = $owner;
name = "Sphere";
pos = {x:$posx, y:$posy};
oldpos = {x:$posx, y:$posy};
r = Math.abs($r);
bounce = $bounce;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_FULL] = ProjCircle_Full;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_45DEG] = ProjCircle_45Deg;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_CONCAVE] = ProjCircle_Concave;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_CONVEX] = ProjCircle_Convex;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_22DEGs] = ProjCircle_22DegS;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_22DEGb] = ProjCircle_22DegB;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_67DEGs] = ProjCircle_67DegS;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_67DEGb] = ProjCircle_67DegB;
Proj_CircleTile[com.kaboose.games.worldengine.DynamicCollisionObject.CTYPE_HALF] = ProjCircle_Half;
}
function ReportCollisionVsWorld(px, py, dx, dy, obj) {
colV = dy;
colH = dx;
slopeN = _root.rad2deg(dx);
var _local3 = pos;
var _local4 = oldpos;
var _local7 = _local3.x - _local4.x;
var _local6 = _local3.y - _local4.y;
var _local5 = (_local7 * dx) + (_local6 * dy);
var _local15 = _local5 * dx;
var _local14 = _local5 * dy;
var _local19 = _local7 - _local15;
var _local17 = _local6 - _local14;
var _local9;
var _local13;
var _local12;
var _local16;
var _local10;
var _local8;
if (_local5 < 0) {
_local16 = _root.World.FRICTION;
_local10 = _local19 * _local16;
_local8 = _local17 * _local16;
_local9 = 1 + bounce;
_local13 = _local15 * _local9;
_local12 = _local14 * _local9;
if (owner.name == "worm") {
if (_local3.x == (_root.World.XMAX - r)) {
owner.dx = -1;
} else if (_local3.x == (_root.World.XMIN + r)) {
owner.dx = 1;
}
}
} else {
_local8 = 0;
_local10 = _local8;
_local12 = _local10;
_local13 = _local12;
}
_local3.x = _local3.x + px;
_local3.y = _local3.y + py;
if (owner.name == "player") {
_root.World.UpdateScreenPos(px, py);
}
_local4.x = _local4.x + ((px + _local13) + _local10);
_local4.y = _local4.y + ((py + _local12) + _local8);
}
function CollideVsWorldBounds() {
var _local5 = pos;
var _local4 = _root.World.XMIN - (_local5.x - r);
if (0 < _local4) {
ReportCollisionVsWorld(_local4, 0, 1, 0, null);
} else {
_local4 = (_local5.x + r) - _root.World.XMAX;
if (0 < _local4) {
ReportCollisionVsWorld(-_local4, 0, -1, 0, null);
}
}
var _local3 = _root.World.YMIN - (_local5.y - r);
if (0 < _local3) {
ReportCollisionVsWorld(0, _local3, 0, 1, null);
} else {
_local3 = (_local5.y + r) - _root.World.YMAX;
if (0 < _local3) {
ReportCollisionVsWorld(0, -_local3, 0, -1, null);
}
}
}
function CollideVsTile(tile) {
var _local10 = pos;
var _local9 = r;
var _local2 = tile;
var _local14 = _local2.pos.x;
var _local13 = _local2.pos.y;
var _local6 = _local2.xw;
var _local5 = _local2.yw;
var _local4 = _local10.x - _local14;
var _local12 = (_local6 + _local9) - Math.abs(_local4);
if (0 < _local12) {
var _local3 = _local10.y - _local13;
var _local11 = (_local5 + _local9) - Math.abs(_local3);
if (0 < _local11) {
var _local7 = 0;
var _local8 = 0;
if (_local4 < (-_local6)) {
_local7 = -1;
} else if (_local6 < _local4) {
_local7 = 1;
}
if (_local3 < (-_local5)) {
_local8 = -1;
} else if (_local5 < _local3) {
_local8 = 1;
}
ResolveCircleTile(_local12, _local11, _local7, _local8, this, _local2);
}
}
}
static function ResolveCircleTile($x, $y, $oH, $oV, $obj, $t) {
if (0 < $t.ID) {
Proj_CircleTile[$t.CTYPE]($x, $y, $oH, $oV, $obj, $t);
}
}
static function ProjCircle_Full(x, y, oH, oV, obj, t) {
if (oH == 0) {
if (oV == 0) {
if (x < y) {
var _local4 = obj.pos.x - t.pos.x;
if (_local4 < 0) {
obj.ReportCollisionVsWorld(-x, 0, -1, 0, t);
} else {
obj.ReportCollisionVsWorld(x, 0, 1, 0, t);
}
} else {
var _local3 = obj.pos.y - t.pos.y;
if (_local3 < 0) {
obj.ReportCollisionVsWorld(0, -y, 0, -1, t);
} else {
obj.ReportCollisionVsWorld(0, y, 0, 1, t);
}
}
} else {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
if (oV == -1) {
}
}
} else if (oV == 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local12 = t.pos.x + (oH * t.xw);
var _local11 = t.pos.y + (oV * t.yw);
var _local4 = obj.pos.x - _local12;
var _local3 = obj.pos.y - _local11;
var _local6 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local7 = obj.r - _local6;
if (0 < _local7) {
if (_local6 == 0) {
_local4 = oH / Math.SQRT2;
_local3 = oV / Math.SQRT2;
} else {
_local4 = _local4 / _local6;
_local3 = _local3 / _local6;
}
obj.ReportCollisionVsWorld(_local4 * _local7, _local3 * _local7, _local4, _local3, t);
}
}
}
static function ProjCircle_Half(x, y, oH, oV, obj, t) {
var _local7 = t.signx;
var _local13 = t.signy;
var _local17 = (oH * _local7) + (oV * _local13);
if (0 < _local17) {
} else if (oH == 0) {
if (oV == 0) {
var _local23 = obj.r;
var _local21 = (obj.pos.x - (_local7 * _local23)) - t.pos.x;
var _local20 = (obj.pos.y - (_local13 * _local23)) - t.pos.y;
var _local9 = _local7;
var _local8 = _local13;
var _local16 = (_local21 * _local9) + (_local20 * _local8);
if (_local16 < 0) {
_local9 = _local9 * (-_local16);
_local8 = _local8 * (-_local16);
var _local22 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local15 = Math.sqrt((x * x) + (y * y));
if (_local15 < _local22) {
obj.ReportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
obj.ReportCollisionVsWorld(_local9, _local8, t.signx, t.signy);
}
return(true);
}
} else if (_local17 == 0) {
var _local23 = obj.r;
var _local6 = obj.pos.x - t.pos.x;
if ((_local6 * _local7) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local5 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = _local7 / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
}
} else if (oV == 0) {
if (_local17 == 0) {
var _local23 = obj.r;
var _local5 = obj.pos.y - t.pos.y;
if ((_local5 * _local13) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local6 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = _local7 / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
}
} else {
var _local19 = t.pos.x + (oH * t.xw);
var _local18 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local19;
var _local5 = obj.pos.y - _local18;
var _local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local10;
if (0 < _local14) {
if (_local10 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local10;
_local5 = _local5 / _local10;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
}
static function ProjCircle_45Deg(x, y, oH, oV, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = (obj.pos.x - (_local15 * obj.r)) - t.pos.x;
var _local3 = (obj.pos.y - (_local14 * obj.r)) - t.pos.y;
var _local21 = (_local4 * _local15) + (_local3 * _local14);
if (_local21 < 0) {
_local15 = _local15 * (-_local21);
_local14 = _local14 * (-_local21);
if (x < y) {
var _local17 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local17 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
var _local22 = Math.sqrt((_local15 * _local15) + (_local14 * _local14));
if (_local17 < _local22) {
obj.ReportCollisionVsWorld(x, y, x / _local17, y / _local17, t);
} else {
obj.ReportCollisionVsWorld(_local15, _local14, t.sx, t.sy, t);
}
}
} else if ((_local11 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local18 = (_local4 * (-_local14)) + (_local3 * _local15);
if (0 < ((_local18 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local16 = obj.r - _local13;
if (0 < _local16) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local16, _local3 * _local16, _local4, _local3, t);
}
} else {
var _local21 = (_local4 * _local15) + (_local3 * _local14);
var _local16 = obj.r - Math.abs(_local21);
if (0 < _local16) {
obj.ReportCollisionVsWorld(_local15 * _local16, _local14 * _local16, _local15, _local14, t);
}
}
}
} else if (oV == 0) {
if ((_local12 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local18 = (_local4 * (-_local14)) + (_local3 * _local15);
if (((_local18 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local16 = obj.r - _local13;
if (0 < _local16) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local16, _local3 * _local16, _local4, _local3, t);
}
} else {
var _local21 = (_local4 * _local15) + (_local3 * _local14);
var _local16 = obj.r - Math.abs(_local21);
if (0 < _local16) {
obj.ReportCollisionVsWorld(_local15 * _local16, _local14 * _local16, _local15, _local14, t);
}
}
}
} else if (0 < ((_local12 * oH) + (_local11 * oV))) {
} else {
var _local20 = t.pos.x + (oH * t.xw);
var _local19 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local20;
var _local6 = obj.pos.y - _local19;
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local16 = obj.r - _local13;
if (0 < _local16) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.ReportCollisionVsWorld(_local7 * _local16, _local6 * _local16, _local7, _local6, t);
}
}
}
static function ProjCircle_Concave(x, y, oH, oV, obj, t) {
var _local13 = t.signx;
var _local12 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local8 = (t.pos.x + (_local13 * t.xw)) - obj.pos.x;
var _local7 = (t.pos.y + (_local12 * t.yw)) - obj.pos.y;
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local11 = Math.sqrt((_local8 * _local8) + (_local7 * _local7));
var _local14 = (_local11 + obj.r) - _local19;
if (0 < _local14) {
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local14) {
obj.ReportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
_local8 = _local8 / _local11;
_local7 = _local7 / _local11;
obj.ReportCollisionVsWorld(_local8 * _local14, _local7 * _local14, _local8, _local7, t);
}
}
} else if ((_local12 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local18 = t.pos.x - (_local13 * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local6 = 0;
_local5 = oV;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else if (oV == 0) {
if ((_local13 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y - (_local12 * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local6 = oH;
_local5 = 0;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
} else if (0 < ((_local13 * oH) + (_local12 * oV))) {
} else {
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local18;
var _local5 = obj.pos.y - _local17;
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local11;
_local5 = _local5 / _local11;
}
obj.ReportCollisionVsWorld(_local6 * _local14, _local5 * _local14, _local6, _local5, t);
}
}
}
static function ProjCircle_Convex(x, y, oH, oV, obj, t) {
var _local7 = t.signx;
var _local6 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local14) {
obj.ReportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
}
} else if ((_local6 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
}
} else if (oV == 0) {
if ((_local7 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
}
} else if (0 < ((_local7 * oH) + (_local6 * oV))) {
var _local9 = obj.pos.x - (t.pos.x - (_local7 * t.xw));
var _local8 = obj.pos.y - (t.pos.y - (_local6 * t.yw));
var _local16 = t.xw * 2;
var _local19 = Math.sqrt((_local16 * _local16) + 0);
var _local13 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local14 = (_local19 + obj.r) - _local13;
if (0 < _local14) {
_local9 = _local9 / _local13;
_local8 = _local8 / _local13;
obj.ReportCollisionVsWorld(_local9 * _local14, _local8 * _local14, _local9, _local8, t);
}
} else {
var _local18 = t.pos.x + (oH * t.xw);
var _local17 = t.pos.y + (oV * t.yw);
var _local4 = obj.pos.x - _local18;
var _local3 = obj.pos.y - _local17;
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local14 = obj.r - _local13;
if (0 < _local14) {
if (_local13 == 0) {
_local4 = oH / Math.SQRT2;
_local3 = oV / Math.SQRT2;
} else {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
}
obj.ReportCollisionVsWorld(_local4 * _local14, _local3 * _local14, _local4, _local3, t);
}
}
}
static function ProjCircle_22DegS(x, y, oH, oV, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
if (0 < (_local11 * oV)) {
} else if (oH == 0) {
if (oV == 0) {
var _local15 = t.sx;
var _local14 = t.sy;
var _local16 = obj.r;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - t.pos.y;
var _local19 = (_local4 * (-_local14)) + (_local3 * _local15);
if (0 < ((_local19 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = _local16 - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
_local4 = _local4 - (_local16 * _local15);
_local3 = _local3 - (_local16 * _local14);
var _local22 = (_local4 * _local15) + (_local3 * _local14);
if (_local22 < 0) {
_local15 = _local15 * (-_local22);
_local14 = _local14 * (-_local22);
var _local23 = Math.sqrt((_local15 * _local15) + (_local14 * _local14));
if (x < y) {
var _local18 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local18 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local18 < _local23) {
obj.ReportCollisionVsWorld(x, y, x / _local18, y / _local18, t);
} else {
obj.ReportCollisionVsWorld(_local15, _local14, t.sx, t.sy, t);
}
}
}
} else {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
}
} else if (oV == 0) {
if ((_local12 * oH) < 0) {
var _local21 = t.pos.x - (_local12 * t.xw);
var _local20 = t.pos.y;
var _local6 = obj.pos.x - _local21;
var _local5 = obj.pos.y - _local20;
if ((_local5 * _local11) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local13 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local13;
_local5 = _local5 / _local13;
}
obj.ReportCollisionVsWorld(_local6 * _local17, _local5 * _local17, _local6, _local5, t);
}
}
} else {
var _local15 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x + (oH * t.xw));
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local19 = (_local4 * (-_local14)) + (_local3 * _local15);
if (((_local19 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = obj.r - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
var _local22 = (_local4 * _local15) + (_local3 * _local14);
var _local17 = obj.r - Math.abs(_local22);
if (0 < _local17) {
obj.ReportCollisionVsWorld(_local15 * _local17, _local14 * _local17, _local15, _local14, t);
}
}
}
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local6 = obj.pos.x - _local21;
var _local5 = obj.pos.y - _local20;
var _local13 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local6 = oH / Math.SQRT2;
_local5 = oV / Math.SQRT2;
} else {
_local6 = _local6 / _local13;
_local5 = _local5 / _local13;
}
obj.ReportCollisionVsWorld(_local6 * _local17, _local5 * _local17, _local6, _local5, t);
}
}
}
static function ProjCircle_22DegB(x, y, oH, oV, obj, t) {
var _local4 = t.signx;
var _local3 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local13 = t.sx;
var _local12 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x - (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y + (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
_local13 = _local13 * (-_local16);
_local12 = _local12 * (-_local16);
var _local24 = Math.sqrt((_local13 * _local13) + (_local12 * _local12));
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local24) {
obj.ReportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
obj.ReportCollisionVsWorld(_local13, _local12, t.sx, t.sy, t);
}
}
} else if ((_local3 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local13 = t.sx;
var _local12 = t.sy;
var _local23 = obj.pos.x - (t.pos.x - (_local4 * t.xw));
var _local22 = obj.pos.y - (t.pos.y + (_local3 * t.yw));
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (0 < ((_local19 * _local4) * _local3)) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.ReportCollisionVsWorld(_local13 * _local14, _local12 * _local14, _local13, _local12, t);
}
}
}
} else if (oV == 0) {
if ((_local4 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local23 = obj.pos.x - (t.pos.x + (_local4 * t.xw));
var _local22 = obj.pos.y - t.pos.y;
if ((_local22 * _local3) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local13 = t.sx;
var _local12 = t.sy;
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (((_local19 * _local4) * _local3) < 0) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.ReportCollisionVsWorld(_local13 * _local14, _local12 * _local14, t.sx, t.sy, t);
}
}
}
}
} else if (0 < ((_local4 * oH) + (_local3 * oV))) {
var _local18 = 2.23606797749979;
var _local13 = (_local4 * 1) / _local18;
var _local12 = (_local3 * 2) / _local18;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x - (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y + (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
obj.ReportCollisionVsWorld((-_local13) * _local16, (-_local12) * _local16, t.sx, t.sy, t);
}
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local11 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local11;
_local6 = _local6 / _local11;
}
obj.ReportCollisionVsWorld(_local7 * _local14, _local6 * _local14, _local7, _local6, t);
}
}
}
static function ProjCircle_67DegS(x, y, oH, oV, obj, t) {
var _local12 = t.signx;
var _local11 = t.signy;
if (0 < (_local12 * oH)) {
} else if (oH == 0) {
if (oV == 0) {
var _local16 = t.sx;
var _local14 = t.sy;
var _local15 = obj.r;
var _local4 = obj.pos.x - t.pos.x;
var _local3 = obj.pos.y - (t.pos.y - (_local11 * t.yw));
var _local19 = (_local4 * (-_local14)) + (_local3 * _local16);
if (((_local19 * _local12) * _local11) < 0) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = _local15 - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
_local4 = _local4 - (_local15 * _local16);
_local3 = _local3 - (_local15 * _local14);
var _local22 = (_local4 * _local16) + (_local3 * _local14);
if (_local22 < 0) {
_local16 = _local16 * (-_local22);
_local14 = _local14 * (-_local22);
var _local23 = Math.sqrt((_local16 * _local16) + (_local14 * _local14));
if (x < y) {
var _local18 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local18 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local18 < _local23) {
obj.ReportCollisionVsWorld(x, y, x / _local18, y / _local18, t);
} else {
obj.ReportCollisionVsWorld(_local16, _local14, t.sx, t.sy, t);
}
}
}
} else if ((_local11 * oV) < 0) {
var _local21 = t.pos.x;
var _local20 = t.pos.y - (_local11 * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
if ((_local7 * _local12) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.ReportCollisionVsWorld(_local7 * _local17, _local6 * _local17, _local7, _local6, t);
}
}
} else {
var _local16 = t.sx;
var _local14 = t.sy;
var _local4 = obj.pos.x - (t.pos.x - (_local12 * t.xw));
var _local3 = obj.pos.y - (t.pos.y + (oV * t.yw));
var _local19 = (_local4 * (-_local14)) + (_local3 * _local16);
if (0 < ((_local19 * _local12) * _local11)) {
var _local13 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local17 = obj.r - _local13;
if (0 < _local17) {
_local4 = _local4 / _local13;
_local3 = _local3 / _local13;
obj.ReportCollisionVsWorld(_local4 * _local17, _local3 * _local17, _local4, _local3, t);
}
} else {
var _local22 = (_local4 * _local16) + (_local3 * _local14);
var _local17 = obj.r - Math.abs(_local22);
if (0 < _local17) {
obj.ReportCollisionVsWorld(_local16 * _local17, _local14 * _local17, t.sx, t.sy, t);
}
}
}
} else if (oV == 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local13 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local17 = obj.r - _local13;
if (0 < _local17) {
if (_local13 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local13;
_local6 = _local6 / _local13;
}
obj.ReportCollisionVsWorld(_local7 * _local17, _local6 * _local17, _local7, _local6, t);
}
}
}
static function ProjCircle_67DegB(x, y, oH, oV, obj, t) {
var _local4 = t.signx;
var _local3 = t.signy;
if (oH == 0) {
if (oV == 0) {
var _local13 = t.sx;
var _local12 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x + (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y - (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
_local13 = _local13 * (-_local16);
_local12 = _local12 * (-_local16);
var _local24 = Math.sqrt((_local13 * _local13) + (_local12 * _local12));
if (x < y) {
var _local15 = x;
y = 0;
if ((obj.pos.x - t.pos.x) < 0) {
x = x * -1;
}
} else {
var _local15 = y;
x = 0;
if ((obj.pos.y - t.pos.y) < 0) {
y = y * -1;
}
}
if (_local15 < _local24) {
obj.ReportCollisionVsWorld(x, y, x / _local15, y / _local15, t);
} else {
obj.ReportCollisionVsWorld(_local13, _local12, t.sx, t.sy, t);
}
}
} else if ((_local3 * oV) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local23 = obj.pos.x - t.pos.x;
var _local22 = obj.pos.y - (t.pos.y + (_local3 * t.yw));
if ((_local23 * _local4) < 0) {
obj.ReportCollisionVsWorld(0, y * oV, 0, oV, t);
} else {
var _local13 = t.sx;
var _local12 = t.sy;
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (0 < ((_local19 * _local4) * _local3)) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.ReportCollisionVsWorld(_local13 * _local14, _local12 * _local14, _local13, _local12, t);
}
}
}
}
} else if (oV == 0) {
if ((_local4 * oH) < 0) {
obj.ReportCollisionVsWorld(x * oH, 0, oH, 0, t);
} else {
var _local18 = 2.23606797749979;
var _local13 = (_local4 * 2) / _local18;
var _local12 = (_local3 * 1) / _local18;
var _local23 = obj.pos.x - (t.pos.x + (_local4 * t.xw));
var _local22 = obj.pos.y - (t.pos.y - (_local3 * t.yw));
var _local19 = (_local23 * (-_local12)) + (_local22 * _local13);
if (((_local19 * _local4) * _local3) < 0) {
var _local11 = Math.sqrt((_local23 * _local23) + (_local22 * _local22));
var _local14 = obj.r - _local11;
if (0 < _local14) {
_local23 = _local23 / _local11;
_local22 = _local22 / _local11;
obj.ReportCollisionVsWorld(_local23 * _local14, _local22 * _local14, _local23, _local22, t);
}
} else {
var _local16 = (_local23 * _local13) + (_local22 * _local12);
var _local14 = obj.r - Math.abs(_local16);
if (0 < _local14) {
obj.ReportCollisionVsWorld(_local13 * _local14, _local12 * _local14, t.sx, t.sy, t);
}
}
}
} else if (0 < ((_local4 * oH) + (_local3 * oV))) {
var _local13 = t.sx;
var _local12 = t.sy;
var _local17 = obj.r;
var _local23 = (obj.pos.x - (_local13 * _local17)) - (t.pos.x + (_local4 * t.xw));
var _local22 = (obj.pos.y - (_local12 * _local17)) - (t.pos.y - (_local3 * t.yw));
var _local16 = (_local23 * _local13) + (_local22 * _local12);
if (_local16 < 0) {
obj.ReportCollisionVsWorld((-_local13) * _local16, (-_local12) * _local16, t.sx, t.sy, t);
}
} else {
var _local21 = t.pos.x + (oH * t.xw);
var _local20 = t.pos.y + (oV * t.yw);
var _local7 = obj.pos.x - _local21;
var _local6 = obj.pos.y - _local20;
var _local11 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local14 = obj.r - _local11;
if (0 < _local14) {
if (_local11 == 0) {
_local7 = oH / Math.SQRT2;
_local6 = oV / Math.SQRT2;
} else {
_local7 = _local7 / _local11;
_local6 = _local6 / _local11;
}
obj.ReportCollisionVsWorld(_local7 * _local14, _local6 * _local14, _local7, _local6, t);
}
}
}
static var OTYPE = 1;
var colV = 0;
var colH = 0;
static var Proj_CircleTile = new Object();
}
Symbol 606 MovieClip [__Packages.com.kaboose.games.dinosoars.GameHUD] Frame 0
class com.kaboose.games.dinosoars.GameHUD
{
var mc;
function GameHUD ($posx, $posy) {
}
function UpdateTime() {
}
function UpdateScore() {
mc.score = _root.formatNumber(_root.Controller.totalScore);
}
function UpdateLoops() {
mc.bowlLoops = _root.Controller.bowlLoops;
mc.lives = _root.Controller.currentLives;
mc.remLoops = _root.Controller.remainingLoops;
mc.invLoops = _root.PlayerObj.totLoops;
var _local3 = (_root.Controller.bowlLoops / _root.Controller.totalLoops) * 100;
mc.marker._yscale = Math.min(_local3, 100);
mc.bowl.gotoAndStop(Math.round(((_local3 / 4) / 5) + 1));
_root.PlayerHQ.mc.bowl.gotoAndStop(Math.round(((_local3 / 4) / 5) + 1));
UpdateScore();
}
function UpdateRadar() {
}
}
Symbol 607 MovieClip [__Packages.com.kaboose.games.dinosoars.PlayerObject] Frame 0
class com.kaboose.games.dinosoars.PlayerObject
{
var alive, name, r, colObj, playerKey, spacePressed, leftPressed, upPressed, downPressed, rightPressed, c, mc, lastAnim, invul_int, stun_int;
function PlayerObject ($posx, $posy, $r, $name, $bounce) {
trace("Creating New PLAYER");
alive = true;
name = $name;
r = $r;
ClearLoops();
colObj = new com.kaboose.games.worldengine.Sphere($posx, $posy, $r, $name, $bounce, this);
playerKey = new Object();
var obj = this;
playerKey.onKeyDown = function () {
if (Key.getCode() == 32) {
if (obj.alive) {
obj.PowerBomb();
}
}
if (Key.getCode() == 80) {
if (obj.alive) {
_root.Controller.TogglePause();
}
}
if (Key.getCode() == 32) {
obj.spacePressed = true;
}
if (Key.getCode() == 37) {
obj.leftPressed = true;
}
if (Key.getCode() == 38) {
obj.upPressed = true;
}
if (Key.getCode() == 40) {
obj.downPressed = true;
}
if (Key.getCode() == 39) {
obj.rightPressed = true;
}
};
playerKey.onKeyUp = function () {
trace("You released a key.");
if (Key.getCode() == 32) {
obj.spacePressed = false;
}
if (Key.getCode() == 37) {
obj.leftPressed = false;
}
if (Key.getCode() == 38) {
obj.upPressed = false;
}
if (Key.getCode() == 40) {
obj.downPressed = false;
}
if (Key.getCode() == 39) {
obj.rightPressed = false;
}
};
Key.addListener(playerKey);
}
function clearInput() {
spacePressed = false;
leftPressed = false;
upPressed = false;
downPressed = false;
rightPressed = false;
}
function Verlet() {
colObj.Verlet();
}
function ReportCollisionVsWorld(px, py, dx, dy, obj) {
colObj.ReportCollisionVsWorld(px, py, dx, dy, obj);
}
function CollideVsWorldBounds() {
colObj.CollideVsWorldBounds();
}
function CollideVsTile(tile) {
colObj.CollideVsTile(tile);
}
function SetColor() {
c = new Color(mc);
c.setRGB(pColor);
}
function ClearLoops() {
inv_frootLoops = Array();
totLoops = 0;
}
function PowerBomb() {
if (!stunned) {
if ((_root.Controller.currentLives > 1) && (totLoops > 0)) {
_root.Phil.StartStun();
var _local5 = _root.Controller.enemies.length;
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
var _local4 = _root.Controller.enemies[_local3];
_local4.StartStun();
_local3++;
}
}
_root.Controller.TakeLife();
_root.HUD.UpdateLoops();
anim = 25;
lockAnimation = false;
SetAnimation();
_root.Controller.CheckRemainingLoops("player");
}
}
}
function SetAnimation() {
if (mc._currentframe != anim) {
lastAnim = mc._currentframe;
if (!lockAnimation) {
if ((((anim == 10) || (anim == 25)) || (anim == 5)) || (anim == 30)) {
lockAnimation = true;
}
mc.gotoAndStop(anim);
}
}
}
function DropLoop() {
var _local7 = inv_frootLoops.length;
if (_local7 > 0) {
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("fl_drop_001");
var _local11 = [4, -4, 8, -8, 12, -12];
var _local12 = [-12, -12, -8, -8, -4, -4];
var _local13 = 6;
var _local10 = ((_local7 < _local13) ? (_local7) : (_local13));
var _local4 = 0;
while (_local4 < _local10) {
var _local9 = _local11[_local4];
var _local8 = _local12[_local4];
var _local3 = inv_frootLoops[_local7 - 1];
_local3.OwnerChange(2);
var _local6 = _local3.colObj.pos;
var _local5 = _local3.colObj.oldpos;
_local6.x = (_local5.x = colObj.pos.x);
_local6.y = (_local5.y = colObj.pos.y);
_local3.mc = _root.gfxFrootLoops.CreateSprite(_local3.name);
_local3.mc.clip.clip.gotoAndStop(_local3.frame);
_local3.UpdateClip();
_local3.xspeed = _local9;
_local3.yspeed = _local8;
inv_frootLoops.splice(_local7 - 1);
totLoops--;
_local7--;
_local4++;
}
CheckFlyCount();
_root.HUD.UpdateLoops();
}
}
function EnemyCollision() {
ToggleStun();
if (totLoops > 0) {
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("fl_drop_002");
DropLoop();
}
_root.Controller.TakeLife();
_root.HUD.UpdateLoops();
}
function AddLoop($loop) {
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("fl_pickup_004");
_root.Controller.extraLifeEggCount = _root.Controller.extraLifeEggCount + 1;
if (_root.Controller.extraLifeEggCount == _root.Controller.extraLifeBonus) {
trace("earned extra life");
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("gameWon");
_root.Controller.addLife();
}
inv_frootLoops.push($loop);
totLoops++;
CheckFlyCount();
_root.HUD.UpdateLoops();
}
function CheckFlyCount() {
var _local8 = Math.floor(totLoops / attractionFactor);
if (totLoops < attractionFactor) {
trace("set flycount to zero");
_local8 = 0;
}
var _local6 = _root.Controller.enemies.length;
var _local19 = _root.Controller.returningEnemies.length;
if (_local6 < _local8) {
var _local17 = 200;
var _local15 = 600;
_local17 = _root.flyHQ.colObj.pos.x;
_local15 = _root.flyHQ.colObj.pos.y;
var _local10 = _root.randomRange(0.2, 0.5);
var _local9 = _root.randomRange(5, 7);
var _local18 = _root.randomRange(0.15, 0.4);
var _local16 = _root.randomRange(0.1, 0.3);
var _local20 = 16;
var _local11 = _local6;
var _local14 = false;
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("flyBuzz");
_root.Controller.enemies.push(new com.kaboose.games.dinosoars.Firefly(_local17, _local15, 16, "firefly", _local11, _local9, _local18, _local16, _local10, _local14));
var _local3 = _root.Controller.enemies[_local6];
_local3.stunned = false;
_local3.mc = _root.gfxEnemies.CreateSprite("firefly");
_local3.SetTarget(this);
var _local13 = colObj.pos.x - _local3.colObj.oldpos.x;
var _local12 = colObj.pos.y - _local3.colObj.oldpos.y;
_local3.mc._x = mc._x - _local13;
_local3.mc._y = mc._y - _local12;
} else {
var _local7 = _local6 - _local8;
trace(("Remove " + _local7) + " Fireflies");
var _local4 = 0;
while (_local4 < _local7) {
var _local5 = (_local6 - 1) - _local4;
var _local3 = _root.Controller.enemies[_local5];
_local3.SetTarget(_root.flyHQ);
_local3.mc.contrastTo(-100, 1, "easeOutSine");
_root.Controller.enemies.splice(_local3.ID);
_root.Controller.returningEnemies.push(_local3);
_local3.rID = _root.Controller.returningEnemies.length - 1;
_local4++;
}
}
}
function InvulOff() {
invul = false;
mc.brightOffsetTo(0, 1);
clearInterval(invul_int);
}
function ToggleStun() {
if (stunned) {
stunned = false;
clearInterval(stun_int);
lockAnimation = false;
SetAnimation();
invul_int = setInterval(this, "InvulOff", invulTime);
invul = true;
mc.brightOffsetTo(30, 0);
} else {
stunned = true;
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("fl_drop_003");
_root.sd_snd.atcPlay("fl_drop_004");
stun_int = setInterval(this, "ToggleStun", stunTime);
if (onGround) {
anim = 30;
lockAnimation = false;
SetAnimation();
} else {
anim = 5;
lockAnimation = false;
SetAnimation();
}
}
}
function CollideVsHQ() {
if (totLoops > 0) {
var _local4 = _root.mAbs(_root.PlayerHQ.colObj.pos.x - colObj.pos.x);
var _local5 = _root.mAbs(_root.PlayerHQ.colObj.pos.y - colObj.pos.y);
var _local3 = (r + _root.PlayerHQ.r) - 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
DepositLoops();
}
}
}
}
function DepositLoops() {
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("fl_deposit_001");
_root.sd_snd.atcPlay("fl_deposit_001b");
for (var _local3 in inv_frootLoops) {
inv_frootLoops[_local3].OwnerChange(4);
_root.Controller.AddPoints(inv_frootLoops[_local3].pointValue);
_root.Controller.bowlLoops++;
totLoops--;
_root.Controller.remainingLoops--;
}
inv_frootLoops = new Array();
CheckFlyCount();
_root.Controller.CheckRemainingLoops();
_root.HUD.UpdateScore();
_root.HUD.UpdateLoops();
}
var anim = 2;
var lockAnimation = false;
var attractionFactor = 3;
var pColor = 16750848;
var accel = 1.2;
var maxSpeed = 15;
var airFriction = 0.9;
var groundFriction = 0.8;
var onGround = false;
var hitAngle = 0;
var active = true;
var gravity = 0.5;
var cGravity = 0;
var invul = false;
var invulTime = 1500;
var stunned = false;
var stunTime = 2000;
var inv_frootLoops = new Array();
var totLoops = 0;
}
Symbol 608 MovieClip [__Packages.com.kaboose.games.dinosoars.Firefly] Frame 0
class com.kaboose.games.dinosoars.Firefly
{
var colObj, ID, maxSpeed, accelX, accelY, r, colTile, name, stunned, c, mc, targ, stun_interval, tx, ty, tr, rID;
function Firefly ($posx, $posy, $r, $name, $ID, $maxSpeed, $accelX, $accelY, $bounce, $colTile) {
colObj = new com.kaboose.games.worldengine.Sphere($posx, $posy, $r, $name, $bounce, this);
ID = $ID;
maxSpeed = $maxSpeed;
accelX = $accelX;
accelY = $accelY;
r = $r;
colTile = $colTile;
name = $name;
stunned = false;
}
function Verlet() {
colObj.Verlet();
}
function ReportCollisionVsWorld(px, py, dx, dy, obj) {
colObj.ReportCollisionVsWorld(px, py, dx, dy, obj);
}
function CollideVsWorldBounds() {
colObj.CollideVsWorldBounds();
}
function CollideVsTile(tile) {
colObj.CollideVsTile(tile);
}
function SetColor($newColor) {
c = new Color(mc);
if (arguments[0] == undefined) {
c.setRGB($newColor);
} else {
c.setRGB(color);
}
}
function SetTarget($target) {
targ = $target;
DefineTarget();
}
function GetPos($p, $t, $d, $c, $v, $f) {
var _local1 = {_d:((($t - $p) / $c) * $v) + ($d * $f), _p:$p + $d};
return(_local1);
}
function Move() {
xspeed = xspeed + (accelX * ((dx < 0) ? -1 : 1));
((Math.abs(xspeed) > maxSpeed) ? ((xspeed = maxSpeed * ((dx < 0) ? -1 : 1))) : 0);
colObj.pos.x = colObj.oldpos.x + xspeed;
var _local3 = targ.colObj.pos.x - colObj.oldpos.x;
dx = _local3;
yspeed = yspeed + (accelY * ((dy < 0) ? -1 : 1));
((Math.abs(yspeed) > maxSpeed) ? ((yspeed = maxSpeed * ((dy < 0) ? -1 : 1))) : 0);
colObj.pos.y = colObj.oldpos.y + yspeed;
var _local2 = targ.colObj.pos.y - colObj.oldpos.y;
dy = _local2;
}
function UpdateClip() {
var _local3 = _root;
var _local5 = _local3.PlayerObj.colObj.pos.x - colObj.pos.x;
var _local4 = _local3.PlayerObj.colObj.pos.y - colObj.pos.y;
mc._y = _local3.PlayerObj.mc._y - _local4;
mc._x = _local3.PlayerObj.mc._x - _local5;
if (xspeed < 0) {
mc._xscale = -100;
} else if (xspeed > 0) {
mc._xscale = 100;
}
}
function StartStun() {
clearInterval(stun_interval);
stunned = true;
stun_interval = setInterval(this, "StunClear", stunTime * 1000);
mc._alpha = 50;
}
function StunClear() {
mc._alpha = 100;
stunned = false;
clearInterval(stun_interval);
}
function DefineTarget() {
tx = targ.colObj.pos.x;
ty = targ.colObj.pos.y;
tr = targ.colObj.r;
}
function SetTargetPos($tx, $ty, $tr) {
tx = $tx;
ty = $ty;
tr = $tr;
}
function CheckTargetCollision() {
var _local4 = _root.mAbs(tx - colObj.pos.x);
var _local5 = _root.mAbs(ty - colObj.pos.y);
var _local3 = (colObj.r + tr) - 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
if (targ.name == "player") {
targ.EnemyCollision();
} else {
_root.gfxEnemies.DestroyMC(mc);
delete _root.Controller.returningEnemies[rID];
}
}
}
}
var stunTime = 3;
var xspeed = 0;
var yspeed = 0;
var defaultColor = 11397764;
var color = 11397764;
var dx = 0;
var dy = 0;
var count = 0;
var delay = true;
var trail = 0;
}
Symbol 609 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);
}
}
Symbol 610 MovieClip [__Packages.com.kaboose.games.dinosoars.Nest] Frame 0
class com.kaboose.games.dinosoars.Nest
{
var name, colObj, r, mc;
function Nest ($posx, $posy, $r, $name) {
trace("Creating New NEST: " + $name);
name = $name;
colObj = new com.kaboose.games.worldengine.Sphere($posx, $posy, $r, $name, 0.1, this);
r = $r;
}
function UpdateClip() {
var _local3 = _root;
var _local5 = _local3.PlayerObj.colObj.pos.x - colObj.pos.x;
var _local4 = _local3.PlayerObj.colObj.pos.y - colObj.pos.y;
mc._y = _local3.PlayerObj.mc._y - _local4;
mc._x = _local3.PlayerObj.mc._x - _local5;
}
}
Symbol 611 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);
}
}
Symbol 612 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);
}
}
Symbol 613 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);
}
}
Symbol 614 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);
}
}
Symbol 615 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 616 MovieClip [__Packages.com.kaboose.games.dinosoars.Worm] Frame 0
class com.kaboose.games.dinosoars.Worm
{
var philSound, colObj, accelX, accelY, r, colTile, mc, stun_interval, stunned;
function Worm ($posx, $posy, $r, $accelX, $accelY, $bounce, $colTile) {
philSound = new Sound();
trace("Creating New WORM");
colObj = new com.kaboose.games.worldengine.Sphere($posx, $posy, $r, "worm", $bounce, this);
accelX = $accelX;
accelY = $accelY;
r = $r;
colTile = $colTile;
}
function Verlet() {
colObj.Verlet();
}
function ReportCollisionVsWorld(px, py, dx, dy, obj) {
colObj.ReportCollisionVsWorld(px, py, dx, dy, obj);
}
function CollideVsWorldBounds() {
colObj.CollideVsWorldBounds();
}
function CollideVsTile(tile) {
colObj.CollideVsTile(tile);
}
function registerOwner() {
mc.owner = this;
}
function playJumpSound() {
if (!_root.Controller.gamePaused) {
var _local4 = SonicDistance();
var _local3 = _local4[0];
var _local5 = _local4[1];
if (_local3 < 1) {
_local3 = 0;
}
philSound = new Sound(mc);
philSound.attachSound("wormWalkSound");
philSound.setVolume(_local3);
philSound.setPan(_local5);
philSound.start();
}
}
function SonicDistance() {
var _local3 = _root.PlayerObj.colObj.pos.x - colObj.pos.x;
var _local4 = _root.PlayerObj.colObj.pos.y - colObj.pos.y;
var _local6 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local5 = 100 - ((Math.abs(_local6) / SONIC_DISTANCE) * 100);
var _local7 = -((_local3 / SONIC_DISTANCE) * 100);
return([_local5, _local7]);
}
function UpdateMovement() {
xspeed = colObj.pos.x - colObj.oldpos.x;
yspeed = colObj.pos.y - colObj.oldpos.y;
var _local4 = _root.mMin(maxSpeed * dx, _root.mMax(maxSpeed * dx, xspeed + accelX));
var _local3 = _root.mMin(maxSpeed, _root.mMax(maxSpeed, yspeed + accelY));
colObj.pos.x = colObj.oldpos.x + _local4;
colObj.pos.y = colObj.oldpos.y + _local3;
}
function CollideVsPlayer() {
var _local4 = _root.mAbs(_root.PlayerObj.colObj.pos.x - colObj.pos.x);
var _local5 = _root.mAbs(_root.PlayerObj.colObj.pos.y - colObj.pos.y);
var _local3 = (colObj.r + _root.PlayerObj.colObj.r) - 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.PlayerObj.EnemyCollision();
}
}
}
function UpdateClip() {
var _local3 = _root;
var _local5 = _local3.PlayerObj.colObj.pos.x - colObj.pos.x;
var _local4 = _local3.PlayerObj.colObj.pos.y - colObj.pos.y;
mc._y = _local3.PlayerObj.mc._y - _local4;
mc._x = _local3.PlayerObj.mc._x - _local5;
if (xspeed < 0) {
mc._xscale = 100;
} else if (xspeed > 0) {
mc._xscale = -100;
}
}
function EatLoop($loop) {
$loop.OwnerChange(5);
mc.gotoAndStop("eat");
_root.Controller.remainingLoops--;
_root.Controller.CheckRemainingLoops("phil");
_root.HUD.UpdateLoops();
}
function StartStun() {
clearInterval(stun_interval);
stunned = true;
stun_interval = setInterval(this, "StunClear", stunTime * 1000);
mc.gotoAndStop("stunned");
}
function StunClear() {
trace("Clearing PHIL Stun");
mc._alpha = 100;
stunned = false;
clearInterval(stun_interval);
}
function UpdateSoundRadar() {
}
var maxSpeed = 8;
var stunTime = 2;
var name = "worm";
var xspeed = 3;
var yspeed = 3;
var dx = 1;
var dy = 0;
var SONIC_DISTANCE = 1200;
var delay = true;
}
Symbol 617 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);
}
}
Symbol 618 MovieClip [__Packages.com.kaboose.games.dinosoars.SpriteManager] Frame 0
class com.kaboose.games.dinosoars.SpriteManager
{
var rootbuffer, front_depth, back_depth, stepsize;
function SpriteManager ($buffer) {
trace("Creating New SpriteManager");
rootbuffer = $buffer;
front_depth = 1000;
back_depth = 1000;
stepsize = 100;
}
function CreateSprite($linkage) {
var _local2 = GetNextDepth_Front();
var _local3 = rootbuffer.attachMovie($linkage, $linkage + _local2, _local2);
return(_local3);
}
function CreateEmptySprite($n) {
var _local3 = GetNextDepth_Front();
var _local2 = rootbuffer.createEmptyMovieClip($n, _local3);
return(_local2);
}
function DestroyMC($mc) {
$mc.swapDepths(1048000);
$mc.removeMovieClip();
}
function DestroyAllSprites() {
for (var _local2 in rootbuffer) {
if (typeof(rootbuffer[_local2]) == "movieclip") {
DestroyMC(rootbuffer[_local2]);
}
}
front_depth = 1000;
}
function GetNextDepth_Front() {
front_depth = front_depth + stepsize;
return(front_depth);
}
function GetNextDepth_Back() {
back_depth = back_depth - stepsize;
return(back_depth);
}
function GetBuffer() {
return(rootbuffer);
}
}
Symbol 619 MovieClip [__Packages.com.kaboose.games.dinosoars.GameManager] Frame 0
class com.kaboose.games.dinosoars.GameManager
{
var trackerVars_send, trackerURL, currentLevel, gameStart, gameOver, gameOn, gameScores, scrMC, targetLoops, curTime, currentScore, totalScore, renderLoop, delayInterval, gameTimer, totalLoops, levelStartTime, remainingLoops, music, currentMusic, gamePaused, currentLives;
function GameManager ($gameID, $trackerURL) {
com.kaboose.base.debug.DebugConsole.initialize(_root, 393939);
trace("New GameManager");
trackerVars_send.gameID = $gameID;
trackerURL = $trackerURL;
}
function NewGame() {
ResetLives();
extraLifeEggCount = 0;
trace("New Game Started");
currentLevel = 1;
gameStart = getTimer();
gameOver = false;
gameOn = true;
ResetScores();
_root.addGamePlay();
gameScores = new Array();
AddScreen("scr_LevelIntro");
}
function AddScreen($scr) {
_quality = "HIGH";
scrMC = _root.attachMovie($scr, "scr", scrLevel);
trace($scr);
var obj = this;
switch ($scr) {
case "scr_LevelIntro" :
if (currentLevel == 1) {
scrMC.tips._visible = true;
} else {
scrMC.tips.gotoAndStop(2);
}
if (currentLevel < 10) {
var _local14 = "text_" + currentLevel;
scrMC.attachMovie(String("text_" + currentLevel), "lvlA", scrMC.getNextHighestDepth());
scrMC.lvlA._x = 400;
scrMC.lvlA._y = 32;
} else {
var _local9 = "text_" + currentLevel.toString().charAt(0);
scrMC.attachMovie(_local9, "lvlA", scrMC.getNextHighestDepth());
scrMC.lvlA._x = 400;
scrMC.lvlA._y = 32;
var _local8 = "text_" + currentLevel.toString().charAt(1);
scrMC.attachMovie(_local8, "lvlB", scrMC.getNextHighestDepth());
scrMC.lvlB._x = 482;
scrMC.lvlB._y = 32;
}
menuKeyListener.onKeyDown = function () {
trace("menuKeyListener keyDown detected");
if (Key.getCode() == 32) {
obj.KillScreen();
_root.gotoAndPlay("Game A - loadMap()");
Key.removeListener(obj.menuKeyListener);
}
};
Key.addListener(menuKeyListener);
scrMC.btn_start.onPress = function () {
trace("wtffff");
obj.KillScreen();
_root.gotoAndPlay("Game A - loadMap()");
};
scrMC.loops = int((((gameScores.length + 1) * 5) + loopStartIndex) * parPercentage);
scrMC.level = "Level " + currentLevel;
break;
case "scr_LevelOverview" :
delayStarted = false;
menuKeyListener.onKeyDown = function () {
if (Key.getCode() == 32) {
Key.removeListener(obj.menuKeyListener);
obj.KillScreen();
if (obj.gameOver) {
obj.AddScreen("scr_GameOver");
} else {
obj.AddScreen("scr_LevelIntro");
}
}
};
Key.addListener(menuKeyListener);
scrMC.btn_start.onPress = function () {
obj.KillScreen();
if (obj.gameOver) {
obj.AddScreen("scr_GameOver");
} else {
obj.AddScreen("scr_LevelIntro");
}
};
scrMC.level = "Level " + (currentLevel - 1);
scrMC.target = ("You needed " + targetLoops) + " Froot Loops to continue";
scrMC.collected = "You collected " + gameScores[currentLevel - 2][2];
scrMC.loops = gameScores[currentLevel - 2][2];
scrMC.loopPointValue = 1000;
scrMC.loopPointsTotal = _root.formatNumber(gameScores[currentLevel - 2][2] * 1000);
if (gameOver == false) {
scrMC.time.gotoAndStop(1);
var _local10 = curTime * 100;
scrMC.time.timeSeconds = curTime;
scrMC.time.timePointValue = 100;
scrMC.time.timePointsTotal = _root.formatNumber(_local10);
} else {
scrMC.time.gotoAndStop(2);
}
scrMC.pointsEarned = _root.formatNumber(gameScores[currentLevel - 2][0]);
break;
case "scr_MainMenu" :
KillMusic();
StartMusic("menu");
var _local13 = new LocalConnection();
var _local7 = _local13.domain();
var _local6 = _local7.indexOf("fun");
_root.domCheck.swapDepths(_root.getNextHighestDepth());
_root.domCheck.dom = (_local7 + ", ") + _local6;
if (_local6 != -1) {
scrMC.btn_scores._visible = false;
scrMC.btn_scores.enabled = false;
scrMC.btn_tell._visible = false;
scrMC.btn_tell.enabled = false;
scrMC.btn_play._x = scrMC.btn_play._x + 160;
scrMC.btn_how._x = scrMC.btn_how._x + 160;
}
scrMC.btn_play.onPress = function () {
obj.NewGame();
};
scrMC.btn_how.onPress = function () {
obj.AddScreen("scr_Instructions");
};
scrMC.btn_scores.onPress = function () {
obj.AddScreen("scr_Highscores");
};
scrMC.btn_tell.onPress = function () {
trace("Tell A Friend");
var _local2 = ("javascript:openTellAFriendWindow('" + _root.tellURL) + "',450,550)";
getURL (_local2);
};
break;
case "scr_Highscores" :
KillMusic();
StartMusic("menu");
scrMC.btn_menu.onPress = function () {
obj.AddScreen("scr_MainMenu");
};
scrMC.btn_register.onPress = function () {
getURL ("http://www.kaboose.com/registration/login.php", "_blank");
};
break;
case "scr_Instructions" :
KillMusic();
StartMusic("menu");
break;
case "scr_GameOverview" :
break;
case "scr_GameOver" :
var _local3 = 0;
var _local4 = 0;
for (var _local5 in gameScores) {
_local3 = _local3 + gameScores[_local5][0];
_local4 = _local4 + gameScores[_local5][2];
}
scrMC.points = ("You scored " + _root.formatNumber(_local3)) + " points!";
scrMC.eggsCollected = "You Collected " + _root.formatNumber(_local4);
_local13 = new LocalConnection();
_local7 = _local13.domain();
_local6 = _local7.indexOf("fun");
_root.domCheck.swapDepths(_root.getNextHighestDepth());
_root.domCheck.dom = _local7;
_local6 = 0;
if (_local6 != -1) {
scrMC.btn_next.onPress = function () {
obj.AddScreen("scr_MainMenu");
};
menuKeyListener.onKeyDown = function () {
if (Key.getCode() == 32) {
Key.removeListener(obj.menuKeyListener);
obj.AddScreen("scr_MainMenu");
}
};
Key.addListener(menuKeyListener);
} else {
menuKeyListener.onKeyDown = function () {
if (Key.getCode() == 32) {
Key.removeListener(obj.menuKeyListener);
obj.AddScreen("scr_HighscoresEndGame");
}
};
Key.addListener(menuKeyListener);
scrMC.btn_next.onPress = function () {
obj.AddScreen("scr_HighscoresEndGame");
};
}
KillMusic();
StartMusic("menu");
break;
case "scr_HighscoresEndGame" :
KillMusic();
StartMusic("menu");
scrMC.btn_play.onPress = function () {
obj.NewGame();
};
scrMC.btn_menu.onPress = function () {
obj.AddScreen("scr_MainMenu");
};
scrMC.btn_register.onPress = function () {
getURL ("http://www.kaboose.com/registration/login.php", "_blank");
};
}
}
function KillScreen() {
Key.removeListener(menuKeyListener);
scrMC.removeMovieClip();
}
function NextLevel() {
}
function ResetScores() {
currentScore = 0;
totalScore = 0;
}
function EndGame() {
gameOn = false;
}
function EndLevel() {
trace("EndLevel");
clearInterval(renderLoop);
clearInterval(delayInterval);
clearInterval(gameTimer);
KillMusic();
_root.PlayerObj.clearInput();
Key.removeListener(_root.PlayerObj.playerKey);
var _local8 = getTimer();
var _local4 = 0;
var _local5 = 0;
for (var _local6 in frootLoops) {
var _local3 = frootLoops[_local6].owner;
if (_local3 == 4) {
_local4++;
}
if (_local3 == 5) {
_local5++;
}
}
if (!gameOver) {
trace("SUCCESS! LEVEL COMPLETE: Player Achieved Loop Requirement");
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("gameWon");
} else {
trace("FAILED! LEVEL COMPLETE: Player Failed Loop Requirements");
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("gameLost");
}
if (!gameOver) {
var _local7 = curTime * 100;
var _local9 = _local7 + currentScore;
gameScores.push([_local9, totalLoops, _local4, _local5, levelStartTime, _local8]);
totalScore = totalScore + _local7;
} else {
gameScores.push([currentScore, totalLoops, _local4, _local5, levelStartTime, _local8]);
}
remainingLoops = 0;
currentScore = 0;
currentLevel++;
delete _root.onEnterFrame;
ClearSprites();
AddScreen("scr_LevelOverview");
}
function ClearSprites() {
_root.worldContainer._visible = false;
for (var _local3 in spriteBuffers) {
spriteBuffers[_local3].DestroyAllSprites();
}
}
function CalculateRemainingLoops() {
var _local3 = 0;
for (var _local4 in frootLoops) {
var _local2 = frootLoops[_local4].owner;
if ((_local2 == 1) || (_local2 == 2)) {
_local3++;
}
}
remainingLoops = _local3;
}
function CheckRemainingLoops($loopEater) {
if (delayStarted == false) {
if (remainingLoops == 0) {
if ($loopEater != undefined) {
if ($loopEater == "player") {
AddAlert("levelComplete");
Delay(4000, "EndLevel");
gameOver = false;
} else if ($loopEater == "phil") {
AddAlert("levelCompletePhil");
Delay(4000, "EndLevel");
gameOver = false;
}
} else {
EndLevel();
}
}
}
}
function StartMusic($music) {
music = new Sound();
switch ($music) {
case "game" :
music.attachSound("gameMusic");
currentMusic = "gameMusic";
break;
case "menu" :
music.attachSound("menuMusic");
currentMusic = "menuMusic";
}
music.start(0, 9999);
}
function KillMusic() {
music.stop(currentMusic);
}
function TogglePause() {
if (gamePaused) {
trace("Unpausing Game");
RemoveAlert();
gamePaused = false;
gameTimer = setInterval(this, "CheckTimer", 1000);
} else {
trace("Pausing Game");
AddAlert("paused");
gamePaused = true;
clearInterval(gameTimer);
}
}
function StartTimer() {
clearInterval(gameTimer);
gameTimer = setInterval(this, "CheckTimer", 1000);
curTime = levelTime;
_root.HUD.mc.time = curTime;
}
function CheckTimer() {
curTime--;
_root.HUD.mc.time = curTime;
if (int(curTime) == 0) {
clearInterval(gameTimer);
if (delayStarted == false) {
AddAlert("gameOverTime");
Delay(4000, "EndLevel");
gameOver = true;
}
}
if (int(curTime) <= 10) {
_root.sd_snd = new Sound();
_root.sd_snd.atcPlay("timerTick");
}
if (int(curTime) == 10) {
AddAlert("time");
}
}
function AddAlert(type) {
if (((((type == "time") || (type == "gameOver")) || (type == "gameOverTime")) || (type == "levelComplete")) || (type == "gameOverLives")) {
var _local4 = 5;
} else if (type == "bomb") {
var _local4 = 3;
} else {
var _local4 = 1;
}
_root.alrts_mc.alrt_mc.stopTween();
_root.alrts_mc.stopTween();
_root.attachMovie("alertContainer", "alrts_mc", 9959);
_root.alrts_mc.gotoAndStop(type);
if (type != "paused") {
_root.alrts_mc.alphaTo(10, 1, "easeInQuad", 2, RemoveAlert);
}
}
function RemoveAlert() {
_root.alrts_mc.removeMovieClip();
}
function Delay(msec, method) {
clearInterval(gameTimer);
_root.PlayerObj.alive = false;
var _local3 = this;
delayInterval = setInterval(_local3, method, msec);
delayStarted = true;
}
function AddPoints($pts) {
trace($pts);
currentScore = currentScore + $pts;
var _local2 = 0;
for (var _local3 in gameScores) {
_local2 = _local2 + gameScores[_local3][0];
}
totalScore = _local2 + currentScore;
trace("total score: " + totalScore);
}
function addLife() {
trace("ADD LIFE!!!");
_root.HUD.mc.lifeIcon_pulse.gotoAndPlay(2);
var _local3 = currentLives + 1;
currentLives = Math.min(_local3, maxLives);
extraLifeEggCount = 0;
}
function ResetLives() {
currentLives = maxLives;
}
function TakeLife() {
_root.HUD.mc.lifeIcon_pulse.gotoAndPlay(2);
currentLives--;
if (currentLives == 0) {
AddAlert("gameOverLives");
Delay(4000, "EndLevel");
gameOver = true;
}
}
function startEngine() {
renderLoop = setInterval(_root.gameLoop, 10);
levelStartTime = getTimer();
StartTimer();
}
var mapLoaded = false;
var extraLifeBonus = 100;
var extraLifeEggCount = 0;
var loopStartIndex = 5;
var levelLoop = 5;
var parPercentage = 0.7;
var secondsPerLoop = 4.5;
var maxLevelTime = 199;
var levelTime = 20;
var maxLives = 10;
var menuKeyListener = new Object();
var delayStarted = false;
var scrLevel = 1;
var spriteBuffers = new Array();
var frootLoops = new Array();
var enemies = new Array();
var remainingEnemies = new Array();
var timeLimit = 60;
}
Symbol 620 MovieClip [__Packages.com.kaboose.base.debug.DebugConsole] Frame 0
class com.kaboose.base.debug.DebugConsole
{
var commands, container, logTF, input;
function DebugConsole (scope, depth) {
if (scope == undefined) {
scope = _root;
depth = 1048575 /* 0x0FFFFF */;
}
commands = new com.kaboose.base.debug.DebugCommands();
container = scope.createEmptyMovieClip("Console", depth || 0);
container.onRollOver = function () {
};
container.useHandCursor = false;
Trace.subscribe(this);
MovieClip.addListener(this);
Key.addListener(this);
}
static function initialize(scope, depth) {
if (_instance == undefined) {
_instance = new com.kaboose.base.debug.DebugConsole(scope, depth);
}
}
static function setCommands(newCommands) {
Trace.out("Using Custom Commands.");
_instance.commands = newCommands;
}
function show() {
if (posH > 0) {
return(undefined);
}
width = Stage.width;
height = Stage.height * 0.75;
Mouse.addListener(this);
Stage.addListener(this);
posH = 1;
container.createTextField("logTF", 1, 0, 0, width, height);
container.createTextField("input", 2, 0, height, width, inputHeight);
logTF = container.logTF;
input = container.input;
input.textColor = 10066329 /* 0x999999 */;
input.type = "input";
input.text = "";
logTF.html = true;
logTF.multiline = true;
logTF.wordWrap = true;
logTF.selectable = false;
logTF.textColor = 10066329 /* 0x999999 */;
logTF.htmlText = logHistory;
var wait = setInterval(function (c) {
c.keepFocus();
clearInterval(wait);
}, 16, this);
redraw();
}
function hide() {
posH = 0;
logHistory = logTF.htmlText;
input.removeTextField();
logTF.removeTextField();
Mouse.removeListener(this);
Stage.removeListener(this);
container.clear();
}
function redraw() {
var _local3 = height * posH;
var _local4 = _local3 - height;
var _local2 = _local3;
logTF._y = _local4;
input._y = _local2;
container.clear();
container.beginFill(3355443, 90);
com.kaboose.base.graphics.VectorGFX.quad(container, 0, _local4, width, height);
container.beginFill(0, 100);
com.kaboose.base.graphics.VectorGFX.quad(container, 0, _local2, width, inputHeight);
container.endFill();
}
function checkInput() {
var _local2 = input.text;
cmds.push(_local2);
input.text = "";
if ((_local2 == "") || (_local2 == ">")) {
return(undefined);
}
var _local4 = _local2.split(" ")[0];
var _local3 = _local4.slice(1, _local4.length);
var _local5 = _local2.slice(_local3.length + 2);
if (_local3 == "clear") {
logHistory = "";
logTF.htmlText = "";
updateLog(logHistory);
return(undefined);
}
commands.exec(_local3, _local5);
}
function onTraceOut(str) {
if (posH > 0) {
updateLog(str);
} else {
logHistory = logHistory + (str + newline);
}
}
function updateLog(txt) {
logTF.htmlText = logTF.htmlText + txt;
logTF.scroll = logTF.maxscroll;
}
function onMouseUp() {
keepFocus();
}
function keepFocus() {
Selection.setFocus(input);
Selection.setSelection(Selection.getEndIndex(), Selection.getEndIndex());
}
function onMouseWheel(delta) {
scrollPage(delta);
}
function scrollPage(delta) {
logTF.scroll = logTF.scroll - delta;
}
function onKeyDown() {
if (Key.getCode() == 38) {
var _local2 = cmds.length;
if (_local2 > 0) {
_local2--;
input.text = cmds[_local2];
}
}
if (Key.getCode() == 40) {
var _local2 = cmds.length;
if (_local2 < (cmds.length - 1)) {
_local2++;
input.text = cmds[_local2];
}
}
switch (Key.getAscii()) {
case 126 :
show();
break;
case 27 :
hide();
break;
case 13 :
checkInput();
}
switch (Key.getCode()) {
case 33 :
scrollPage(1);
break;
case 34 :
scrollPage(-1);
}
}
static var _instance = undefined;
var width = Stage.width;
var height = Stage.height * 0.75;
var posH = new Number();
var inputHeight = 20;
var logHistory = "";
var cmds = [];
}
Symbol 621 MovieClip [__Packages.com.kaboose.base.debug.DebugCommands] Frame 0
class com.kaboose.base.debug.DebugCommands
{
function DebugCommands () {
}
function exec(cmd, args) {
this[cmd](args);
}
function help(args) {
Trace.out("Help Commands : ");
var _local1 = 0;
while (_local1 < cmdList.length) {
var _local2 = com.kaboose.base.debug.DebugLevel.WARN;
_local2.setPrefix = cmdList[_local1].cmd;
Trace.out(" - " + cmdList[_local1].desc, _local2);
_local1++;
}
}
function addCommands(arr) {
var _local2 = arr.length;
var _local1 = 0;
while (_local1 < _local2) {
cmdList.push(arr[_local1]);
_local1++;
}
}
static var cmdList = [{cmd:"exec", desc:"Executes custom commands."}, {cmd:"help", desc:"Outputs available commands."}];
}
Symbol 622 MovieClip [__Packages.Trace] Frame 0
class Trace
{
static var lableStyle, messageStyle, instance;
function Trace () {
AsBroadcaster.initialize(this);
lableStyle = new com.kaboose.utils.strings.styles.FontStyle();
messageStyle = new com.kaboose.utils.strings.styles.FontStyle();
}
static function out(str, level) {
if (level == undefined) {
level = com.kaboose.base.debug.DebugLevel.INFO;
}
str = String(str);
trace(level.label + str);
if (instance == undefined) {
return(undefined);
}
lableStyle.setColor(level.lableColor);
messageStyle.setColor(level.messageColor);
var _local3 = com.kaboose.utils.strings.HTMLFontTag.writeTag(level.label, lableStyle);
_local3 = _local3 + com.kaboose.utils.strings.HTMLFontTag.writeTag(str, messageStyle);
instance.broadcastMessage("onTraceOut", _local3, level);
}
static function subscribe(listener) {
if (instance == undefined) {
instance = new Trace();
}
instance.addListener(listener);
}
static function unsubscribe(listener) {
instance.removeListener(listener);
}
}
Symbol 623 MovieClip [__Packages.com.kaboose.utils.strings.styles.FontStyle] Frame 0
class com.kaboose.utils.strings.styles.FontStyle
{
var FACE, SIZE, COLOR;
function FontStyle () {
setDefaults();
}
function setFace(str) {
FACE = str;
}
function setSize(num) {
SIZE = String(num);
}
function setColor(str) {
COLOR = str;
}
function clone() {
var _local2 = new com.kaboose.utils.strings.styles.FontStyle();
_local2.setFace(FACE);
_local2.setSize(SIZE);
_local2.setColor(COLOR);
return(_local2);
}
function setDefaults() {
FACE = "ARIAL";
SIZE = "9";
COLOR = "#FFFFFF";
}
}
Symbol 624 MovieClip [__Packages.com.kaboose.base.debug.DebugLevel] Frame 0
class com.kaboose.base.debug.DebugLevel
{
function DebugLevel () {
}
static var ASSERT = {label:"ASSERTION : ", labelColor:"#CCFFFF", messageColor:undefined};
static var DEBUG = {label:"DEBUG : ", labelColor:"#00FF00", messageColor:undefined};
static var INFO = {label:"INFO : ", labelColor:"#FF99CC", messageColor:undefined};
static var WARN = {label:"WARNING : ", labelColor:"#FFFF00", messageColor:undefined};
static var ERROR = {label:"ERROR : ", labelColor:"#FF9900", messageColor:undefined};
static var NONE = {label:""};
}
Symbol 625 MovieClip [__Packages.com.kaboose.utils.strings.HTMLFontTag] Frame 0
class com.kaboose.utils.strings.HTMLFontTag
{
function HTMLFontTag () {
}
static function writeTag(str, style) {
var _local2 = "<FONT ";
for (var _local3 in style) {
_local2 = _local2 + (((_local3 + "=\"") + style[_local3]) + "\" ");
}
_local2 = _local2 + ((">" + str) + "</FONT>");
return(_local2);
}
}
Symbol 626 MovieClip [__Packages.com.kaboose.base.graphics.VectorGFX] Frame 0
class com.kaboose.base.graphics.VectorGFX
{
function VectorGFX () {
}
static function quad(mc, x, y, w, h) {
mc.moveTo(x, y);
mc.lineTo(x + w, y);
mc.lineTo(x + w, y + h);
mc.lineTo(x, y + h);
mc.lineTo(x, y);
}
static function line(mc, x, y, ex, ey) {
mc.moveTo(x, y);
mc.lineTo(ex, ey);
}
static function AABB(mc, xpos, ypos, w, h) {
var _local1 = {x:xpos - w, y:ypos - h};
var _local7 = {x:xpos + w, y:ypos - h};
var _local3 = {x:xpos + w, y:ypos + h};
var _local6 = {x:xpos - w, y:ypos + h};
mc.moveTo(_local1.x, _local1.y);
mc.lineTo(_local7.x, _local7.y);
mc.lineTo(_local3.x, _local3.y);
mc.lineTo(_local6.x, _local6.y);
mc.lineTo(_local1.x, _local1.y);
}
static function circle(mc, x, y, r) {
mc.moveTo(x + r, y);
mc.curveTo(r + x, (0.4142 * r) + y, (0.7071 * r) + x, (0.7071 * r) + y);
mc.curveTo((0.4142 * r) + x, r + y, x, r + y);
mc.curveTo((-0.4142 * r) + x, r + y, (-0.7071 * r) + x, (0.7071 * r) + y);
mc.curveTo((-r) + x, (0.4142 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.4142 * r) + y, (-0.7071 * r) + x, (-0.7071 * r) + y);
mc.curveTo((-0.4142 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.4142 * r) + x, (-r) + y, (0.7071 * r) + x, (-0.7071 * r) + y);
mc.curveTo(r + x, (-0.4142 * r) + y, r + x, y);
}
static function cross(mc, x, y, size) {
var _local1 = size || 4;
mc.moveTo(x - _local1, y);
mc.lineTo(x + _local1, y);
mc.moveTo(x, y - _local1);
mc.lineTo(x, y + _local1);
}
static function carret(mc, x, y, size) {
var _local1 = size || 4;
mc.moveTo(x, y);
mc.lineTo(x - (_local1 / 2), y - _local1);
mc.lineTo(x + (_local1 / 2), y - _local1);
mc.lineTo(x, y);
}
}