Frame 1
function Preloader(baseClip, loadedFrame) {
this.loadedFrame = loadedFrame;
this.baseClip = baseClip;
this.clip = this.baseClip.createEmptyMovieClip("preloaderClip", this.baseClip.getNextHighestDepth());
this.clip.preloader = this;
this.frame = 0;
this.fractionLoaded = 0;
this.loadedBytes = 0;
this.totalBytes = 0;
this.percentLoaded = 0;
this.clip.onEnterFrame = this.evtEnterFrame;
}
function setupRightClickMenu(showDeeperbeigeLink) {
var _local2 = new ContextMenu();
_local2.hideBuiltInItems();
if (showDeeperbeigeLink || (showDeeperbeigeLink == undefined)) {
var _local4 = new ContextMenuItem("\u00A92008 deeperbeige.com", function () {
return(undefined);
});
var _local3 = new ContextMenuItem("http://deeperbeige.com", function () {
getURL ("http://deeperbeige.com", "_blank");
});
_local3.separatorBefore = true;
_local2.customItems.push(_local4, _local3);
}
_root.menu = _local2;
}
function siteLockTest(contentID, lockedFrame, successCallback, staticData) {
if (_root._url.substr(0, 5) == "file:") {
return(successCallback());
}
trace(("SiteLock: Testing '" + contentID) + "'");
var _local6 = new LoadVars();
var _local5 = new LoadVars();
_local5.successCallback = successCallback;
_local5.lockedFrame = lockedFrame;
_local5.staticData = staticData;
_local5.onLoad = function (success) {
if (success) {
if (this.allowed == 1) {
trace("SiteLock: Allowed");
this.successCallback();
} else {
trace("SiteLock: Failed");
_root.legalURL = this.legalURL;
_root.gotoAndStop(this.lockedFrame);
}
} else {
trace("SiteLock: Using static data for test");
var _local5 = _root._url;
var _local6 = _local5.indexOf("://");
if (_local6 >= 0) {
_local5 = _local5.substr(_local6 + 3);
}
strDomain = _local5.toLowerCase();
_local6 = strDomain.indexOf("/");
if (_local6 >= 0) {
strDomain = strDomain.substr(0, _local6);
}
var _local3 = 0;
while (_local3 < this.staticData.allowedDomains.length) {
var _local4 = this.staticData.allowedDomains[_local3];
if (_local4 == strDomain) {
trace("SiteLock: Allowed");
return(this.successCallback());
}
_local3++;
}
trace("SiteLock: Failed");
_root.legalURL = this.staticData.legalURL;
_root.gotoAndStop(this.lockedFrame);
}
};
_local6.contentID = contentID;
_local6.hostURL = _root._url;
_local6.r = Math.floor(Math.random() * 10000);
_local6.sendAndLoad("http://deeperbeige.com/sitelock/check.php", _local5, "POST");
}
function siteStaticLockTest(contentID, lockedFrame, successCallback, staticData) {
if (_root._url.substr(0, 5) == "file:") {
return(successCallback());
}
trace(("SiteLock: Statically testing '" + contentID) + "'");
var _local7 = _root._url;
var _local4 = _local7.indexOf("://");
if (_local4 >= 0) {
_local7 = _local7.substr(_local4 + 3);
}
strDomain = _local7.toLowerCase();
_local4 = strDomain.indexOf("/");
if (_local4 >= 0) {
strDomain = strDomain.substr(0, _local4);
}
var _local3 = 0;
while (_local3 < staticData.allowedDomains.length) {
var _local2 = staticData.allowedDomains[_local3];
if (_local2 == strDomain) {
trace("SiteLock: Allowed");
return(successCallback());
}
if (_local2.substr(0, 2) == "*.") {
_local2 = _local2.substr(2);
_local4 = strDomain.indexOf(_local2);
if (_local4 >= 0) {
return(successCallback());
}
}
_local3++;
}
trace("SiteLock: Failed");
_root.legalURL = staticData.legalURL;
_root.gotoAndStop(lockedFrame);
}
function ScreenTrans(contentRoot, screenClip, startFrame, fastTrans) {
this.content = contentRoot;
this.screen = screenClip;
this.curFrame = startFrame;
this.screenFrame = 0;
this.transitioning = false;
this.fastTrans = (fastTrans ? true : false);
this.onceFast = false;
this.debug = false;
if (!this.content) {
trace("ScreenTrans: Content root is undefined");
}
if (!this.screen) {
trace("ScreenTrans: Screen clip is undefined");
}
if (this.debug) {
trace("ScreenTrans: Initialised");
}
}
function ContentTrans(contentRoot, arrClips, startFrame, fastTrans) {
this.content = contentRoot;
this.curFrame = startFrame;
this.transitioning = false;
this.fastTrans = (fastTrans ? true : false);
this.debug = false;
this.contentClips = arrClips;
if (!this.content) {
trace("ContentTrans: Content root is undefined");
}
var _local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
if (!_local3) {
trace(("ContentTrans: Content clip " + _local2) + " is undefined");
}
_local2++;
}
if (this.debug) {
trace("ContentTrans: Initialised");
}
}
stop();
Preloader.prototype.evtEnterFrame = function () {
var _local4 = _root.getBytesLoaded();
var _local3 = _root.getBytesTotal();
this.preloader.frame++;
this.preloader.onUpdate();
if ((_local4 > 10) && (_local3 > 10)) {
this.preloader.totalBytes = _local3;
this.preloader.loadedBytes = _local4;
this.preloader.fractionLoaded = _local4 / _local3;
this.preloader.percentLoaded = Math.floor((_local4 * 100) / _local3);
if (_local4 == _local3) {
this.preloader.onLoaded();
this.onEnterFrame = undefined;
this.removeMovieClip();
}
} else {
this.preloader.percentLoaded = 0;
}
this.preloader.loadingString = ("Loading: " + this.preloader.percentLoaded) + "%";
};
Preloader.prototype.onLoaded = function () {
_root.gotoAndStop(this.loadedFrame);
};
Preloader.prototype.onUpdate = function () {
trace(this.fractionLoaded);
};
ScreenTrans.prototype.goto = function (frame, onTransComplete, instant) {
_root.objSounds.stop("longsounds");
if (this.curFrame == frame) {
if (this.debug) {
trace(("ScreenTrans: Transition to '" + frame) + "' disallowed: Already on this section");
}
return(undefined);
}
if (this.transitioning) {
if (this.debug) {
trace(("ScreenTrans: Transition to '" + frame) + "' disallowed: Already transitioning");
}
return(undefined);
}
if (this.debug) {
trace(("ScreenTrans: Transitioning to '" + frame) + "'");
}
this.goingTo = frame;
this.transitioning = true;
this.onTransComplete = onTransComplete;
if (instant) {
this.onceFast = true;
}
this.content.objTrans = this;
this.screen.objTrans = this;
this.screen.prevFrameNo = this.screen._currentframe;
this.screen.onEnterFrame = function () {
if (this.debug) {
trace(("ScreenTrans: Hiding content (frame " + this._currentframe) + ")");
}
if (((this.prevFrameNo == this._currentframe) || (this.objTrans.fastTrans)) || (this.objTrans.onceFast)) {
this.objTrans.next();
}
this.prevFrameNo = this._currentframe;
};
this.screen.gotoAndPlay("hide");
};
ScreenTrans.prototype.next = function () {
if (this.debug) {
trace(("ScreenTrans: Content hidden. Switching to '" + this.goingTo) + "'");
}
this.curFrame = this.goingTo;
this.goingTo = undefined;
this.screen.prevFrameNo = this.screen._currentframe;
this.screen.onEnterFrame = function () {
if (this.debug) {
trace(("ScreenTrans: Revealing content (frame " + this._currentframe) + ")");
}
if (((this.prevFrameNo == this._currentframe) || (this.objTrans.fastTrans)) || (this.objTrans.onceFast)) {
this.objTrans.transComplete();
}
this.prevFrameNo = this._currentframe;
};
this.content.gotoAndStop(this.curFrame);
this.screen.gotoAndPlay("reveal");
};
ScreenTrans.prototype.transComplete = function () {
this.screen.onEnterFrame = undefined;
this.transitioning = false;
if (this.fastTrans || (this.onceFast)) {
this.screen.gotoAndStop("idle");
}
if (this.onTransComplete != undefined) {
if (this.debug) {
trace("ScreenTrans: Executing callback");
}
this.onTransComplete();
}
this.onceFast = false;
if (this.debug) {
trace("ScreenTrans: Transition complete");
}
};
ContentTrans.prototype.goto = function (frame, onTransComplete) {
if (this.curFrame == frame) {
if (this.debug) {
trace(("ContentTrans: Transition to '" + frame) + "' disallowed: Already on this section");
}
return(undefined);
}
if (this.transitioning) {
if (this.debug) {
trace(("ContentTrans: Transition to '" + frame) + "' disallowed: Already transitioning");
}
return(undefined);
}
if (this.debug) {
trace(("ContentTrans: Transitioning to '" + frame) + "'");
}
this.goingTo = frame;
this.transitioning = true;
this.onTransComplete = onTransComplete;
this.content.objTrans = this;
var _local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.prevFrameNo = -1;
_local2++;
}
this.content.onEnterFrame = function () {
var _local4 = true;
var _local3 = 0;
while (_local3 < this.objTrans.contentClips.length) {
var _local2 = this.objTrans.contentClips[_local3];
if (this.objTrans.fastTrans) {
} else {
if (_local2.prevFrameNo != _local2._currentframe) {
_local4 = false;
}
_local2.prevFrameNo = _local2._currentframe;
}
_local3++;
}
if (_local4) {
this.objTrans.next();
}
};
_local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.gotoAndPlay("out");
_local2++;
}
};
ContentTrans.prototype.next = function () {
if (this.debug) {
trace(("ContentTrans: Content is now out. Switching to '" + this.goingTo) + "'");
}
this.curFrame = this.goingTo;
this.goingTo = undefined;
this.content.objTrans = this;
var _local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.prevFrameNo = -1;
_local2++;
}
this.content.onEnterFrame = function () {
var _local4 = true;
var _local3 = 0;
while (_local3 < this.objTrans.contentClips.length) {
var _local2 = this.objTrans.contentClips[_local3];
if (this.objTrans.fastTrans) {
} else {
if (_local2.prevFrameNo != _local2._currentframe) {
_local4 = false;
}
_local2.prevFrameNo = _local2._currentframe;
}
_local3++;
}
if (_local4) {
this.objTrans.transComplete();
}
};
this.content.gotoAndStop(this.curFrame);
_local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.gotoAndPlay("in");
_local2++;
}
};
ContentTrans.prototype.transComplete = function () {
this.content.onEnterFrame = undefined;
this.transitioning = false;
if (this.onTransComplete != undefined) {
if (this.debug) {
trace("ContentTrans: Executing callback");
}
this.onTransComplete();
}
if (this.debug) {
trace("ContentTrans: Transition complete");
}
};
com.mosesSupposes.fuse.ZigoEngine.simpleSetup(com.mosesSupposes.fuse.Shortcuts, com.mosesSupposes.fuse.PennerEasing);
var objTrans = new ScreenTrans(_root, _root.screen, "preloader", false);
var objPreloader = new Preloader(_root);
objPreloader.onUpdate = function () {
_root.loaded.text = ("LOADED: " + this.percentLoaded) + "%";
};
objPreloader.onLoaded = function () {
_root.gotoAndStop("splash");
};
setupRightClickMenu();
var seeded = true;
var kong = false;
var ng = false;
if (_url.indexOf("addictinggames.com") > 0) {
seeded = false;
}
if (_url.indexOf("kongregate.com") > 0) {
kong = true;
}
if (_url.indexOf("newgrounds.com") > 0) {
ng = true;
}
kong = true;
if (seeded) {
chrome.gotoAndStop("seeded");
}
if (kong) {
chrome.gotoAndStop("kong");
}
if (ng) {
chrome.gotoAndStop("ng");
}
if (kong) {
_global.kongregate.services.connect();
}
_level0.cmuSWF_ID = "HannaInAChoppa2";
Frame 31
function Sounds(clip) {
if (clip == undefined) {
trace("Sounds: Clip not found in constructor");
}
this.clip = clip;
clip.objSounds = this;
this.sounds = [];
this.groups = [];
this.loops = [];
this.muted = false;
clip.onEnterFrame = function () {
this.objSounds.evtEnterFrame();
};
}
function Physics(baseClip, gravityX, gravityY, drag, collidableMasses, attractingMasses, framePaintCallback, defaultPaint) {
this.baseClip = baseClip;
this.gravityX = gravityX;
this.gravityY = gravityY;
this.drag = drag;
this.collidableMasses = (collidableMasses ? true : false);
this.attractingMasses = (attractingMasses ? true : false);
this.attractionScale = 100;
this.masses = [];
this.springs = [];
this.surfaces = [];
this.framePaintCallback = framePaintCallback;
this.defaultPaint = ((defaultPaint == undefined) ? true : (defaultPaint));
this.biggestMassRadius = 0;
this.paused = false;
this.surfacesChanged = true;
this.baseClip.physics = this;
this.baseClip.onEnterFrame = function () {
this.physics.step();
};
}
function massSort(a, b) {
return(a.x > b.x);
}
function collisionSort(a, b) {
if (a.massA.idx == b.massA.idx) {
return(a.massB.idx > b.massB.idx);
}
return(a.massA.idx > b.massA.idx);
}
function surfaceLeftSort(a, b) {
return(a.x1 > b.x1);
}
function surfaceRightSort(a, b) {
return(a.x2 < b.x2);
}
function Mass(x, y, radius, fixed, physics, collisionSet) {
this.x = x;
this.y = y;
this.prevX = x;
this.prevY = y;
this.radius = radius;
this.radiusSquared = radius * radius;
this.fixed = fixed;
this.depth = physics.baseClip.getNextHighestDepth();
this.physics = physics;
this.collisionSet = collisionSet;
this.mass = 1;
this.friction = 0;
this.restitution = 1;
this.attractionMass = 0;
this.attractionMaxForce = 10;
this.extForceX = 0;
this.extForceY = 0;
this.hasHitSurface = false;
this.idx = this.physics.masses.length;
if (radius > physics.biggestMassRadius) {
physics.biggestMassRadius = radius;
}
this.vx = 0;
this.vy = 0;
this.springs = [];
this.physics.masses.push(this);
if (this.physics.defaultPaint) {
this.clipRep = this.physics.baseClip.createEmptyMovieClip("mass" + this.depth, this.depth);
this.clipRep.lineStyle(this.radius * 2, 255, 50);
this.clipRep.moveTo(0, 0);
this.clipRep.lineTo(0, 1);
this.clipRep.owner = this;
}
}
function Spring(mass1, mass2, physics, k, damperK) {
this.mass1 = mass1;
this.mass2 = mass2;
this.k = 0.8;
this.maxForce = 0;
if (k != undefined) {
this.k = k;
}
this.damperK = 0.2;
if (damperK != undefined) {
this.damperK = damperK;
}
this.depth = physics.baseClip.getNextHighestDepth();
this.physics = physics;
this.mass1.springs.push(this);
this.mass2.springs.push(this);
this.physics.springs.push(this);
this.naturalLength = this.currentLength();
if (this.physics.defaultPaint) {
this.clipRep = this.physics.baseClip.createEmptyMovieClip("spring" + this.depth, this.depth);
this.clipRep.owner = this;
}
}
function Surface(x1, y1, x2, y2, physics, restitution, friction) {
if (x1 > x2) {
var _local2;
_local2 = x2;
x2 = x1;
x1 = _local2;
_local2 = y2;
y2 = y1;
y1 = _local2;
}
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.friction = 0.9;
this.restitution = 0.96;
if (friction != undefined) {
this.friction = friction;
}
if (restitution != undefined) {
this.restitution = restitution;
}
this.depth = physics.baseClip.getNextHighestDepth();
this.physics = physics;
this.moving = false;
this.physics.surfaces.push(this);
this.physics.surfacesChanged = true;
if (this.physics.defaultPaint) {
this.clipRep = this.physics.baseClip.createEmptyMovieClip("surface" + this.depth, this.depth);
this.clipRep.owner = this;
this.paint();
}
this.update();
}
function SpringBox(x, y, w, h, vx, vy, cornerRadius, springConstant, mass, collisionSet, physics) {
this.physics = physics;
this.m_tl = new Mass(x - (w / 2), y - (h / 2), cornerRadius, false, physics, collisionSet);
this.m_tr = new Mass(x + (w / 2), y - (h / 2), cornerRadius, false, physics, collisionSet);
this.m_bl = new Mass(x - (w / 2), y + (h / 2), cornerRadius, false, physics, collisionSet);
this.m_br = new Mass(x + (w / 2), y + (h / 2), cornerRadius, false, physics, collisionSet);
this.m_tl.mass = mass;
this.m_tr.mass = mass;
this.m_bl.mass = mass;
this.m_br.mass = mass;
this.m_tl.vx = vx;
this.m_tr.vx = vx;
this.m_bl.vx = vx;
this.m_br.vx = vx;
this.m_tl.vy = vy;
this.m_tr.vy = vy;
this.m_bl.vy = vy;
this.m_br.vy = vy;
this.s1 = new Spring(this.m_tl, this.m_tr, physics, springConstant);
this.s2 = new Spring(this.m_tr, this.m_br, physics, springConstant);
this.s3 = new Spring(this.m_br, this.m_bl, physics, springConstant);
this.s4 = new Spring(this.m_bl, this.m_tl, physics, springConstant);
this.s5 = new Spring(this.m_tl, this.m_br, physics, springConstant);
this.s6 = new Spring(this.m_tr, this.m_bl, physics, springConstant);
this.s1.maxForce = 5;
this.s2.maxForce = 5;
this.s3.maxForce = 5;
this.s4.maxForce = 5;
this.s5.maxForce = 5;
this.s6.maxForce = 5;
this.frontLeft = this.m_tl;
this.frontRight = this.m_tr;
}
function SpringLine(x, y, dx, dy, vx, vy, cornerRadius, springConstant, mass, physics, collisionSet) {
this.physics = physics;
this.m_f = new Mass(x - (dx / 2), y - (dy / 2), cornerRadius, false, physics, collisionSet);
this.m_b = new Mass(x + (dx / 2), y + (dy / 2), cornerRadius, false, physics, collisionSet);
this.m_f.mass = mass;
this.m_b.mass = mass;
this.m_f.springItem = this;
this.m_b.springItem = this;
this.m_f.vx = vx;
this.m_f.vy = vy;
this.m_b.vx = vx;
this.m_b.vy = vy;
this.s1 = new Spring(this.m_f, this.m_b, physics, springConstant);
}
function makeSpringLine(mass_front, mass_back) {
var _local1 = {m_f:mass_front, m_b:mass_back};
_local1.s1 = new Spring(_local1.m_f, _local1.m_b, mass_front.physics, 0.7);
_local1.getPosition = SpringLine.prototype.getPosition;
return(_local1);
}
function addSurfaces(clip, instancePrefix, physics, restitution, friction, moving) {
var _local8 = [];
var _local7 = 0;
var _local2 = clip[instancePrefix + _local7];
while (_local2 != undefined) {
var _local5 = _local2.p1.holderToLocal(physics.baseClip);
var _local4 = _local2.p2.holderToLocal(physics.baseClip);
var _local3 = new Surface(_local5.x, _local5.y, _local4.x, _local4.y, physics, restitution, friction);
_local2._visible = false;
_local3.moving = moving;
if (_local2.explosive) {
_local3.explosive = true;
_local3.collisionCallback = function (objMass, x, y) {
_root.objGame.createExplosion(x, y, 20, 500);
if (objMass.isChoppa) {
_root.objGame.choppaCrashed();
}
};
}
_local8.push(_local3);
_local7++;
_local2 = clip[instancePrefix + _local7];
}
return(_local8);
}
function Scrollbar(scrollbarClip, contentSize, windowSize, callback, callbackScope) {
this.scroller = scrollbarClip;
this.scroller.objScrollbar = this;
this.contentSize = contentSize;
this.windowSize = windowSize;
this.callback = callback;
this.callbackScope = callbackScope;
this.initialise();
}
function gotoSponsor() {
_level0.trackPoint("Link_Sponsor");
getURL ("http://www.addictinggames.com", "_blank");
_root.achieved(41);
}
function gotoAuthor() {
_level0.trackPoint("Link_Deeperbeige");
getURL ("http://deeperbeige.com/games", "_blank");
_root.achieved(41);
}
function gotoWalkthrough() {
_level0.trackPoint("Link_Walkthrough");
getURL ("http://blog.addictinggames.com/2012/04/walkthrough-hanna-in-a-choppa-2/", "_blank");
_root.achieved(41);
}
function downloadPDF(filename) {
_level0.trackPoint("Link_Download_" + filename);
getURL ("http://deeperbeige.com/files/hannainachoppa2/downloads/" + filename, "_blank");
_root.achieved(41);
}
function sendKongStats() {
var _local13 = 0;
var _local10 = 0;
var _local11 = 0;
var _local12 = 0;
var _local8 = 0;
var _local9 = 0;
var _local7 = SharedObject.getLocal("hannainachoppa2");
var _local4 = 0;
while (_local4 < _root.arrLevels.length) {
var _local3 = _root.arrLevels[_local4];
if (_local3.passed) {
_local13++;
}
if (_local3.perfect) {
_local10++;
}
if (_local3.fast) {
_local11++;
}
if (_local3.secret) {
_local8++;
}
_local4++;
}
_local4 = 1;
while (_local4 < _root.arrAchievements.length) {
var _local5 = _root.arrAchievements[_local4];
if (_local5.complete) {
_local12++;
}
_local4++;
}
_local4 = 0;
while (_local4 < _local7.data.arrReferences.length) {
var _local6 = _local7.data.arrReferences[_local4];
if (_local6.correct) {
_local9++;
}
_local4++;
}
_global.kongregate.stats.submit("Loaded", 1);
_global.kongregate.stats.submit("CompletedGame", (_root.arrLevels[31].passed ? 1 : 0));
_global.kongregate.stats.submit("CompletedLevels", _local13);
_global.kongregate.stats.submit("CompletedPerfectLevels", _local10);
_global.kongregate.stats.submit("CompletedFastLevels", _local11);
_global.kongregate.stats.submit("CompletedAchievements", _local12);
_global.kongregate.stats.submit("FoundSecrets", _local8);
_global.kongregate.stats.submit("AnsweredQuizQuestions", _local9);
}
function sendNGStats() {
}
function Classic(game) {
this.objGame = game;
this.vehicleID = "classic";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Lifter(game) {
this.objGame = game;
this.vehicleID = "lifter";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Balloon(game) {
this.objGame = game;
this.vehicleID = "balloon";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Saucer(game) {
this.objGame = game;
this.vehicleID = "saucer";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Jetpack(game) {
this.objGame = game;
this.vehicleID = "jetpack";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Zorb(game) {
this.objGame = game;
this.vehicleID = "zorb";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Biplane(game) {
this.objGame = game;
this.vehicleID = "biplane";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Sam(game) {
this.objGame = game;
this.vehicleID = "sam";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Joust(game) {
this.objGame = game;
this.vehicleID = "joust";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Tardis(game) {
this.objGame = game;
this.vehicleID = "tardis";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Vtol(game) {
this.objGame = game;
this.vehicleID = "vtol";
this.clip = this.objGame.clip;
this.choppa = this.clip.level.choppa;
this.objPhysics = this.objGame.objPhysics;
this.initialise();
}
function Messages() {
this.messages = [];
this.initialise();
}
function initGame() {
if (_root.runOnceDone) {
return(undefined);
}
_root.runOnceDone = true;
initLevelSO();
initAchievementsSO();
initMiscSO();
if (_root.kong) {
sendKongStats();
}
_root.keyListener = new Object();
keyListener.onKeyUp = function () {
if (Key.getCode() == Keys.F12) {
cheats = !cheats;
_root.objMessages.add("text", "Cheats enabled: " + cheats);
}
if ((Key.getCode() == Keys.T) && (_root.objGame.state == "flight")) {
_root.objGame.objPhysics.toggleDebug();
}
if ((cheats && (Key.getCode() == Keys.F)) && (_root.objGame.state == "flight")) {
_root.objGame.levelComplete();
_root.objMessages.add("text", "Cheat: Finish level");
}
if (cheats && (Key.getCode() == Keys.U)) {
var _local4 = SharedObject.getLocal("hannainachoppa2");
var _local3 = 0;
while (_local3 < _local4.data.arrLevels.length) {
var _local2 = _local4.data.arrLevels[_local3];
_local2.available_classic = true;
_local2.available_lifter = true;
_local2.available_balloon = true;
_local2.available_saucer = true;
_local2.available_jetpack = true;
_local2.available_zorb = true;
_local2.available_sam = true;
_local2.available_joust = true;
_local2.available_tardis = true;
_local2.available_vtol = true;
_local2.available_biplane = true;
_local3++;
}
_local4.flush();
_root.objMessages.add("text", "Cheat: Unlocked all levels");
}
if (cheats && (Key.getCode() == Keys.L)) {
traceAchievements();
}
};
Key.addListener(keyListener);
}
function setupLevelIndicators(levelsClip) {
initLevelSO();
initAchievementsSO();
initMiscSO();
_quality = "high";
var _local11 = levelsClip.scrollContent;
_root.levelRefs = [];
var _local16 = 26;
var _local9 = 0;
var _local12 = 0;
var _local10 = 0;
var _local15 = 0;
var _local14 = 0;
var _local13 = 0;
var _local7 = 0;
while (_local7 < _root.arrLevels.length) {
if ((_local7 == 0) || (_local7 == 32)) {
var _local5 = _local11.attachMovieClip("levelTitleRow", 0, _local9);
_local5.gotoAndStop("level" + _local7);
_local5._xscale = 83.6;
_local5._yscale = 83.6;
_local9 = _local9 + ((_local7 == 0) ? 26 : 42);
}
var _local6 = _root.arrLevels[_local7];
var _local5 = _local11.attachMovieClip("levelSelector", 0, _local9);
_local5.id = _local7;
_local5.objLevel = _local6;
_local5._xscale = 83.6;
_local5._yscale = 83.6;
_local5.cacheAsBitmap = true;
_local5.txtOrdinal.text = Maths.formatNum(_local7 + 1, 2);
_local5.txtTitle.text = _local6.title;
_root.levelRefs[_local7] = _local5;
if (_local6.perfect) {
_local5.chkPerfect.gotoAndStop("complete");
_local14++;
}
if (_local6.fast) {
_local5.chkFast.gotoAndStop("complete");
_local13++;
}
if (_local6.secret) {
_local5.chkSecret.gotoAndStop("complete");
_local15++;
}
var _local8 = 0;
while (_local8 < _root.vehicles.length) {
var _local4 = _root.vehicles[_local8];
var _local3 = _local5["chk_" + _local4];
_local3.vehicleID = _local4;
_local3.vehicleIdx = _local8;
_local12++;
if ((_root.workingOnLevelID == _local7) && (_root.workingOnVehicleStr == _local4)) {
_root.workingOnLevel = _local3;
_root.workingOnLevelID = undefined;
_root.workingOnVehicleStr = undefined;
}
if (_local6["available_" + _local4]) {
_local3.gotoAndStop("available");
}
if (_local6["passed_" + _local4]) {
_local3.gotoAndStop("complete");
_local10++;
}
if (_local6["passed_" + _local4] || (_local6["available_" + _local4])) {
_local3.highlight._visible = false;
_local3.onPress = function () {
overCheckbox(this);
};
_local3.onRelease = function () {
overCheckbox(this);
clickCheckbox(this);
};
}
_local8++;
}
_local9 = _local9 + _local16;
_local7++;
}
_root.totalToComplete = _local12 + (3 * _root.arrLevels.length);
_root.totalCompleted = ((_local10 + _local14) + _local13) + _local15;
_root.objScroll = new Scrollbar(levelsClip.vertScroll, _local9, levelsClip.scrollMask._height, evtScroll);
_root.selector.scrollContent.origY = _root.selector.scrollContent._y;
Mouse.removeListener(_root.scrollMgr);
_root.scrollMgr = new Object();
_root.scrollMgr.onMouseWheel = function (delta) {
if (delta == 0) {
return(undefined);
}
_root.objScroll.scrollLine((2 * Math.abs(delta)) / (-delta));
};
Mouse.addListener(_root.scrollMgr);
if (_root.workingOnLevel == undefined) {
_root.workingOnLevel = _root.levelRefs[0].chk_lifter;
}
overCheckbox(_root.workingOnLevel, true);
selectLevel(0, 0);
if (!_root.arrLevels[0].passed) {
_root.clickToStart.gotoAndStop(1);
} else if (!_root.arrLevels[1].passed) {
_root.clickToStart.gotoAndStop(2);
} else if (!_root.arrLevels[2].passed) {
_root.clickToStart.gotoAndStop(3);
} else {
_root.clickToStart.gotoAndStop(4);
}
_local11.onEnterFrame = function () {
_root.delay--;
if (_root.objTrans.transitioning) {
return(undefined);
}
if (Key.isDown(Keys.Enter) && (_root.selectedLevel != undefined)) {
clickCheckbox(_root.selectedLevel);
}
if (Key.isDown(Keys.CursorLeft) || (Key.isDown(Keys.A))) {
selectLevel(-1, 0);
}
if (Key.isDown(Keys.CursorRight) || (Key.isDown(Keys.D))) {
selectLevel(1, 0);
}
if (Key.isDown(Keys.CursorUp) || (Key.isDown(Keys.W))) {
selectLevel(0, -1);
}
if (Key.isDown(Keys.CursorDown) || (Key.isDown(Keys.S))) {
selectLevel(0, 1);
}
};
}
function evtScroll(offset, frac) {
_root.selector.scrollContent._y = _root.selector.scrollContent.origY - offset;
_root.clickToStart._visible = ((frac > 0) ? false : true);
}
function evtQuizScroll(offset, frac) {
_root.quizSelector.scrollContent._y = _root.quizSelector.scrollContent.origY - offset;
}
function evtScrollAchievements(offset, frac) {
_root.achievementList.scrollContent._y = _root.achievementList.scrollContent.origY - offset;
}
function overCheckbox(clip, overrideTransition) {
var _local4 = SharedObject.getLocal("hannainachoppa2");
if (overrideTransition == undefined) {
overrideTransition = false;
}
if ((!overrideTransition) && (_root.objTrans.transitioning)) {
return(undefined);
}
_root.selectedLevel.highlight._visible = false;
clip.highlight._visible = true;
_root.selectedLevel = clip;
_root.workingOnLevel = clip;
_root.curLevelID = clip._parent.objLevel.id;
_root.vehicleID = clip.vehicleID;
if (_local4.data["seen_" + _root.vehicleID]) {
_root.gameStartTarget = "game";
} else {
_root.showHelpID = _root.vehicleID;
_root.gameStartTarget = "vehicles";
}
}
function clickCheckbox(clip) {
if (_root.objTrans.transitioning) {
return(undefined);
}
overCheckbox(clip);
_root.objTrans.goto(_root.gameStartTarget);
}
function selectLevel(dx, dy) {
if (_root.delay > 0) {
return(undefined);
}
_root.delay = 5;
var _local7 = _root.selectedLevel._parent.objLevel;
var _local5 = _root.selectedLevel.vehicleIdx + dx;
if (_local5 < 0) {
_local5 = 0;
}
if (_local5 >= _root.vehicles.length) {
_local5 = _root.vehicles.length - 1;
}
var _local6 = _root.vehicles[_local5];
var _local4 = (_local7.id + dy) - 1;
if (_local4 < 0) {
_local4 = 0;
}
if (_local4 >= _root.arrLevels.length) {
_local4 = _root.arrLevels.length - 1;
}
if (!_root.arrLevels[_local4]["available_" + _local6]) {
return(undefined);
}
var _local3 = _root.levelRefs[_local4]["chk_" + _local6];
overCheckbox(_local3);
var _local2 = true;
while (_local2 && (_local3.holderToLocal(_root.selector.scrollMask).y < 30)) {
_local2 = _root.objScroll.scrollLine(-1);
}
while (_local2 && (_local3.holderToLocal(_root.selector.scrollMask).y > (_root.selector.scrollMask._height - 45))) {
_local2 = _root.objScroll.scrollLine(1);
}
}
function setupNeverPress(clip) {
var _local3 = SharedObject.getLocal("hannainachoppa2");
clip.buttonStage = _local3.data.buttonStage;
switch (clip.buttonStage) {
case "neverPress" :
clip.arrText = _root.arrNeverPress;
break;
case "song" :
clip.arrText = _root.arrNeverPressSong;
break;
case "pokePrep" :
clip.arrText = _root.arrNeverPressPokePrep;
break;
case "poke" :
clip.arrText = _root.arrNeverPressPoke;
achieved(34);
}
clip.item = 0;
clip.btnNeverPress.clip = clip;
clip.btnNeverPress.onRelease = nextNeverPress;
clip.txtNeverPress.text = clip.arrText[0];
}
function nextNeverPress() {
this.clip.item++;
if (this.clip.item >= this.clip.arrText.length) {
switch (this.clip.buttonStage) {
case "neverPress" :
this.clip.arrText = _root.arrNeverPressSong;
this.clip.item = 0;
this.clip.buttonStage = "song";
var _local3 = SharedObject.getLocal("hannainachoppa2");
_local3.data.buttonStage = "song";
_local3.flush();
break;
case "song" :
this.clip.item = 0;
break;
case "pokePrep" :
this.clip.arrText = _root.arrNeverPressPoke;
this.clip.item = 0;
this.clip.buttonStage = "poke";
_local3 = SharedObject.getLocal("hannainachoppa2");
_local3.data.buttonStage = "poke";
_local3.flush();
break;
case "poke" :
this.clip.item = 0;
}
}
this.clip.txtNeverPress.text = this.clip.arrText[this.clip.item];
_root.objSounds.play("buzz");
if (this.clip.buttonStage == "poke") {
this.clip.prod.gotoAndPlay("poke");
_root.achieved(34);
this.enabled = false;
}
}
function setupAchievements() {
var _local7 = 50;
var _local5 = 0;
var _local6 = 0;
var _local3 = 1;
while (_local3 < _root.arrAchievements.length) {
var _local2 = _root.arrAchievements[_local3];
var _local4 = _root.achievementList.scrollContent.attachMovieClip("achievementRowGfx", 0, _local7 * (_local3 - 1));
_local4.txtTitle.text = _local2.title;
_local4.txtDescription.text = _local2.description;
_local4.box.gotoAndStop((_local2.complete ? "on" : "off"));
_local6++;
if (_local2.complete) {
_local5++;
}
_local3++;
}
_root.objScroll = new Scrollbar(_root.achievementList.vertScroll, _local7 * _root.arrAchievements.length, _root.achievementList.scrollMask._height, evtScrollAchievements);
_root.achievementList.scrollContent.origY = _root.achievementList.scrollContent._y;
Mouse.removeListener(_root.scrollMgr);
_root.scrollMgr = new Object();
_root.scrollMgr.onMouseWheel = function (delta) {
if (delta == 0) {
return(undefined);
}
_root.objScroll.scrollLine((2 * Math.abs(delta)) / (-delta));
};
Mouse.addListener(_root.scrollMgr);
var _local8 = (_root.totalCompleted + _local5) / (_root.totalToComplete + _local6);
_local8 = _local8 * 100;
_local8 = Maths.formatNum(_local8, 1, 1);
_root.txtCompletion.text = ((((Maths.formatNum(_local5, 2) + "/") + _local6) + newline) + _local8) + "%";
}
function achieved(id) {
if (_root.arrAchievements[id].complete) {
return(undefined);
}
trace(((("Achievement " + id) + " gained (") + _root.arrAchievements[id].title) + ")");
_root.trackPoint("Achievement_" + _root.arrAchievements[id].title);
_root.arrAchievements[id].complete = true;
var _local5 = SharedObject.getLocal("hannainachoppa2");
_local5.data.arrAchievements = _root.arrAchievements;
_local5.flush();
_root.achievement.gotoAndPlay("anim");
_root.achievement.flag.txtTitle.text = _root.arrAchievements[id].title;
_root.objMessages.add("text", "Achievement get: " + _root.arrAchievements[id].title);
var _local3 = 0;
var _local2 = 1;
while (_local2 < _root.arrAchievements.length) {
if (_root.arrAchievements[_local2].complete) {
_local3++;
}
_local2++;
}
if (_local3 == (_root.arrAchievements.length - 2)) {
achieved(42);
Mouse.show();
_root.objTrans.goto("win_complete");
}
}
function passedLevel(id, perfect, fast, secret, vehicle) {
var _local8 = _root.arrLevels[id - 1];
var _local10 = !_local8.passed;
_local8.passed = true;
_local8["passed_" + vehicleID] = true;
if (perfect) {
_local8.perfect = true;
}
if (fast) {
_local8.fast = true;
}
if (secret) {
_local8.secret = true;
}
var _local3 = 0;
var _local7 = 0;
var _local5 = 0;
while (_local5 < _root.arrLevels.length) {
var _local4 = _root.arrLevels[_local5];
if (_local4.passed) {
_local7 = _local5;
}
var _local2 = _local3;
while (_local2 < _root.vehicles.length) {
if (_local4["passed_" + _root.vehicles[_local2]]) {
_local3 = _local2;
}
_local2++;
}
_local5++;
}
_local5 = 0;
while (_local5 <= _local7) {
var _local2 = 0;
while (_local2 <= _local3) {
_root.arrLevels[_local5]["available_" + _root.vehicles[_local2]] = true;
_local2++;
}
_local5++;
}
if ((_local7 + 1) < _root.arrLevels.length) {
var _local6 = _root.arrLevels[_local7 + 1];
if (!_local6["available_" + _local6.vehicle]) {
_root.workingOnLevelID = _local7 + 1;
_root.workingOnVehicleStr = _local6.vehicle[0];
_local5 = 0;
while (_local5 < _local6.vehicle.length) {
_local6["available_" + _local6.vehicle[_local5]] = true;
_local5++;
}
}
}
var _local9 = SharedObject.getLocal("hannainachoppa2");
_local9.data.arrLevels = _root.arrLevels;
_local9.flush();
if (_root.kong) {
sendKongStats();
}
if (_root.ng) {
sendNGStats();
}
return(_local10);
}
function initLevelSO() {
var _local4 = SharedObject.getLocal("hannainachoppa2");
if (_local4.data.ver != dataVersion) {
_local4.clear();
trace("Initialised SO");
_local4.data.ver = dataVersion;
_local4.data.arrLevels = [{id:1, par:400, title:"Training Wings", vehicle:["lifter"]}, {id:2, par:550, title:"Gatey-Matey", vehicle:["lifter"]}, {id:3, par:500, title:"Uncorkage", vehicle:["lifter"]}, {id:4, par:2500, title:"I am a Mazey", vehicle:["lifter"]}, {id:5, par:1000, title:"Mothership", vehicle:["saucer"]}, {id:6, par:2500, title:"Trial by Rotatey Slidey Things", vehicle:["lifter", "saucer"]}, {id:7, par:2700, title:"The 'Shrooms of Doom", vehicle:["jetpack"]}, {id:8, par:1300, title:"Negative Space", vehicle:["lifter", "jetpack"]}, {id:9, par:4000, title:"Puzzling", vehicle:["classic"]}, {id:10, par:1100, title:"The Vom-o-tron", vehicle:["lifter", "classic"]}, {id:11, par:1800, title:"Spelling Bee", vehicle:["lifter", "classic"]}, {id:12, par:700, title:"Strange Loops", vehicle:["tardis"]}, {id:13, par:600, title:"The Rotumbulator", vehicle:["lifter", "classic"]}, {id:14, par:3000, title:"Catenaries and Dirigibles", vehicle:["balloon"]}, {id:15, par:1500, title:"The Best Joke in the World, Evah", vehicle:["lifter", "classic"]}, {id:16, par:700, title:"Retro", vehicle:["joust"]}, {id:17, par:3000, title:"Spin Ya Later Alligator", vehicle:["lifter", "jetpack"]}, {id:18, par:1200, title:"Ode to the Bridge Builder", vehicle:["vtol"]}, {id:19, par:2200, title:"Them!", vehicle:["lifter", "saucer", "jetpack"]}, {id:20, par:750, title:"The Fantastic Dramatic Spike-o-matic", vehicle:["classic", "vtol", "jetpack", "joust"]}, {id:21, par:750, title:"Harvest", vehicle:["biplane"]}, {id:22, par:550, title:"Trial by Chuck Norris", vehicle:["jetpack", "vtol", "tardis"]}, {id:23, par:2200, title:"The Walking Dead", vehicle:["lifter", "classic", "balloon"]}, {id:24, par:1200, title:"Disgruntled Pheasants", vehicle:["lifter", "classic"]}, {id:25, par:2000, title:"Rotatey-thing Factory", vehicle:["lifter", "classic", "jetpack", "joust"]}, {id:26, par:1500, title:"The Colour of Disco", vehicle:["zorb"]}, {id:27, par:1300, title:"Wacca Wacca Wacca", vehicle:["lifter", "classic", "tardis", "biplane"]}, {id:28, par:1500, title:"Clearing Out the Cobwebs", vehicle:["lifter", "vtol", "saucer"]}, {id:29, par:1500, title:"Biffo's Big Escape", vehicle:["lifter", "saucer"]}, {id:30, par:1000, title:"The End of the World", vehicle:["sam"]}, {id:31, par:1600, title:"Unbeatable OXOBot", vehicle:["lifter", "classic", "balloon"]}, {id:32, par:750, title:"Twisted Firework Starter", vehicle:["lifter", "classic"]}, {id:33, par:200, title:"Learning to Fly", vehicle:["jetpack", "classic"]}, {id:34, par:500, title:"Finesse of Flight", vehicle:["balloon", "classic"]}, {id:35, par:450, title:"A Weighty Problem", vehicle:["vtol", "classic"]}, {id:36, par:200, title:"Blustery Day", vehicle:["sam", "classic"]}, {id:37, par:400, title:"Gone Fishin'", vehicle:["biplane", "classic"]}, {id:38, par:700, title:"Pulling The Plug", vehicle:["jetpack", "classic"]}, {id:39, par:750, title:"Flight of the Bumblebee", vehicle:["balloon", "classic"]}, {id:40, par:400, title:"Fan-tastic", vehicle:["sam", "classic"]}, {id:41, par:1200, title:"Raining Hard on a Tiny Planetoid", vehicle:["tardis", "classic"]}, {id:42, par:700, title:"Cement Mixer", vehicle:["joust", "classic"]}, {id:43, par:250, title:"Yosamite SAM-Site", vehicle:["zorb", "classic"]}, {id:44, par:540, title:"Beat the Lift", vehicle:["biplane", "classic"]}, {id:45, par:650, title:"Magneto Completo", vehicle:["vtol", "classic"]}, {id:46, par:2000, title:"Like Hearding Cats, Erm, But With Sheep", vehicle:["saucer", "classic"]}, {id:47, par:370, title:"Enclosed Box of Goo", vehicle:["sam", "classic"]}, {id:48, par:3500, title:"Rescue at Sea", vehicle:["biplane", "classic"]}, {id:49, par:200, title:"Entrapment", vehicle:["joust", "classic"]}, {id:50, par:2000, title:"Running With Scissors", vehicle:["lifter", "classic"]}, {id:51, par:2000, title:"The Crush-O-Tron", vehicle:["jetpack", "classic"]}, {id:52, par:500, title:"Deja Vu?", vehicle:["biplane", "classic"]}, {id:53, par:4500, title:"The Cake is a Lie", vehicle:["saucer", "classic"]}];
var _local3 = 0;
while (_local3 < _local4.data.arrLevels.length) {
var _local2 = _local4.data.arrLevels[_local3];
_local2.passed = false;
_local2.perfect = false;
_local2.fast = false;
_local2.secret = false;
_local2.passed_classic = false;
_local2.passed_lifter = false;
_local2.passed_balloon = false;
_local2.passed_saucer = false;
_local2.passed_jetpack = false;
_local2.passed_zorb = false;
_local2.passed_sam = false;
_local2.passed_joust = false;
_local2.passed_tardis = false;
_local2.passed_vtol = false;
_local2.passed_biplane = false;
_local2.available_classic = false;
_local2.available_lifter = false;
_local2.available_balloon = false;
_local2.available_saucer = false;
_local2.available_jetpack = false;
_local2.available_zorb = false;
_local2.available_sam = false;
_local2.available_joust = false;
_local2.available_tardis = false;
_local2.available_vtol = false;
_local2.available_biplane = false;
_local3++;
}
_local4.data.arrLevels[0].available_lifter = true;
_local4.data.arrReferences = [{level:1, id:0, answers:["douglas adams", "hitchhikers guide to the galaxy", "hitchhiker's guide to the galaxy", "h2g2"], found:false, correct:false, needsSecret:false}, {level:5, id:0, answers:["futurama"], found:false, correct:false, needsSecret:false, needsDelay:true}, {level:7, id:0, answers:["road to hell", "chris rea"], found:false, correct:false, needsSecret:true}, {level:7, id:1, answers:["monkey island", "guybrush threepwood"], found:false, correct:false, needsSecret:false}, {level:9, id:0, answers:["a friend indeed", "marla hansen"], found:false, correct:false, needsSecret:false, needsDelay:true}, {level:10, id:0, answers:["as i sat sadly by her side", "nick cave"], found:false, correct:false, needsSecret:false}, {level:12, id:0, answers:["hofstadter", "godel escher bach", "eternal golden braid", "geb"], found:false, correct:false, needsSecret:false}, {level:14, id:0, answers:["joanna newsom", "bridges and balloons", "milk eyed mender"], found:false, correct:false, needsSecret:false}, {level:15, id:0, answers:["cannon fodder"], found:false, correct:false, needsSecret:true}, {level:16, id:0, answers:["aperture science", "aperture laboratories", "portal"], found:false, correct:false, needsSecret:false}, {level:16, id:1, answers:["sands of time", "prince of persia"], found:false, correct:false, needsSecret:false}, {level:16, id:2, answers:["half life", "halflife"], found:false, correct:false, needsSecret:false}, {level:16, id:3, answers:["street fighter", "ken", "ryu"], found:false, correct:false, needsSecret:false}, {level:16, id:4, answers:["tetris"], found:false, correct:false, needsSecret:false}, {level:16, id:5, answers:["pac man", "pacman"], found:false, correct:false, needsSecret:false}, {level:16, id:6, answers:["space invaders"], found:false, correct:false, needsSecret:true}, {level:18, id:0, answers:["world of goo", "kyle gabler", "ron carmel"], found:false, correct:false, needsSecret:false}, {level:18, id:1, answers:["dukes of hazzard", "johnny cash", "general lee"], found:false, correct:false, needsSecret:true}, {level:19, id:0, answers:["phase iv"], found:false, correct:false, needsSecret:false, needsDelay:true}, {level:20, id:0, answers:["forrest gump"], found:false, correct:false, needsSecret:false}, {level:21, id:0, answers:["neil young", "harvest moon", "jane birkin"], found:false, correct:false, needsSecret:false}, {level:22, id:0, answers:["wargames"], found:false, correct:false, needsSecret:false}, {level:23, id:0, answers:["jeffrey lewis", "if you shoot the head you kill the ghoul"], found:false, correct:false, needsSecret:true}, {level:24, id:0, answers:["angry birds"], found:false, correct:false, needsSecret:false}, {level:26, id:0, answers:["the beatles", "yellow submarine"], found:false, correct:false, needsSecret:false}, {level:26, id:1, answers:["nick cave", "wonderful life"], found:false, correct:false, needsSecret:false}, {level:26, id:2, answers:["paint it black", "rolling stones"], found:false, correct:false, needsSecret:false}, {level:26, id:3, answers:["the raven", "edgar allan poe"], found:false, correct:false, needsSecret:true}, {level:27, id:0, answers:["pacman", "pac man"], found:false, correct:false, needsSecret:false}, {level:29, id:0, answers:["hanna in a choppa"], found:false, correct:false, needsSecret:false}, {level:31, id:0, answers:["portal", "glados"], found:false, correct:false, needsSecret:false, needsDelay:true}, {level:32, id:0, answers:["prodigy", "firestarter"], found:false, correct:false, needsSecret:false}, {level:32, id:1, answers:["mythbusters", "jamie hyneman"], found:false, correct:false, needsSecret:false}, {level:32, id:2, answers:["sufjan stevens", "casimir pulaski day"], found:false, correct:false, needsSecret:true}, {level:33, id:0, answers:["momentary lapse", "pink floyd"], found:false, correct:false, needsSecret:false}, {level:35, id:0, answers:["alan partridge", "football"], found:false, correct:false, needsSecret:false}, {level:36, id:0, answers:["newtons laws", "laws of motion", "law of motion", "secondlawofmotion"], found:false, correct:false, needsSecret:false}, {level:38, id:0, answers:["star wars", "luke skywalker", "obi wan", "a new hope"], found:false, correct:false, needsSecret:false}, {level:39, id:0, answers:["giant bee", "joel veitch", "something awful"], found:false, correct:false, needsSecret:true}, {level:40, id:0, answers:["dizzy", "vic reeves"], found:false, correct:false, needsSecret:false}, {level:41, id:0, answers:["universal gravity", "universal gravitation"], found:false, correct:false, needsSecret:false}, {level:42, id:0, answers:["theme from rawhide", "rawhide theme", "ned washington", "blues brothers", "frankie laine"], found:false, correct:false, needsSecret:false}, {level:43, id:0, answers:["loonie tunes", "merrie melodies", "merry melodies", "bugs bunny"], found:false, correct:false, needsSecret:false}, {level:43, id:1, answers:["vanishing point", "super soul", "guns n roses", "guns and roses", "breakdown"], found:false, correct:false, needsSecret:true}, {level:46, id:0, answers:["pink floyd", "sheep", "animals"], found:false, correct:false, needsSecret:false}, {level:47, id:0, answers:["world of goo", "tower of goo"], found:false, correct:false, needsSecret:false}, {level:49, id:0, answers:["entrapment"], found:false, correct:false, needsSecret:false}, {level:52, id:0, answers:["dogma", "metatron", "alan rickman"], found:false, correct:false, needsSecret:false}, {level:52, id:1, answers:["6000000 dollar man", "6 million dollar man", "six million dollar man", "steve austin"], found:false, correct:false, needsSecret:false}, {level:53, id:0, answers:["portal", "rat man", "ratman"], found:false, correct:false, needsSecret:false}];
_local4.flush();
}
_root.arrLevels = _local4.data.arrLevels;
}
function initAchievementsSO() {
var _local2 = SharedObject.getLocal("hannainachoppa2");
if (_local2.data.arrAchievements == undefined) {
_local2.data.arrAchievements = [{dummy:true}, {id:1, complete:false, title:"Inverted Choppa", description:"Hover upside down in the heavy lifter for 5 seconds"}, {id:2, complete:false, title:"Precision Barnstorming", description:"Get a perfect rating on any level in the biplane"}, {id:3, complete:false, title:"Flying Without Wings", description:"Use an object to levitate the zorb ball for 10 seconds"}, {id:4, complete:false, title:"Balloon Racing", description:"Get a fast rating on any level in the balloon"}, {id:5, complete:false, title:"Flat Out", description:"Max out the jetpack's speed in a huge dive"}, {id:6, complete:false, title:"Lazy Birds", description:"Complete a level without flapping your wings on the jouster"}, {id:7, complete:false, title:"Crash Landing", description:"Finish a level in the VTOL completely upside-down"}, {id:8, complete:false, title:"Controls are Stuck", description:"Complete a level in the biplane without using the throttle or brake"}, {id:9, complete:false, title:"Failure is Always an Option", description:"Crash the TARDIO hard enough to break it!"}, {id:10, complete:false, title:"Full Throttle", description:"Complete any level with the jetpack flat out, start to finish"}, {id:11, complete:false, title:"Heavy Lifta", description:"Complete every level with the lifter choppa"}, {id:12, complete:false, title:"Got Sauce!", description:"Complete every level with the saucer"}, {id:13, complete:false, title:"Rocket-girl", description:"Complete every level with the jetpack"}, {id:14, complete:false, title:"All the Classics", description:"Complete every level with the classic choppa"}, {id:15, complete:false, title:"Blast From the Future", description:"Complete every level with the TARDIO"}, {id:16, complete:false, title:"Ballonacy", description:"Complete every level with the hot air balloon"}, {id:17, complete:false, title:"Retro Arcade", description:"Complete every level with the jouster"}, {id:18, complete:false, title:"Vertical Master", description:"Complete every level with the VTOL plane"}, {id:19, complete:false, title:"Old Timer", description:"Complete every level with the biplane"}, {id:20, complete:false, title:"Disco-queen", description:"Complete every level with the Zorb ball"}, {id:21, complete:false, title:"Strange Love", description:"Complete every level with the SAM"}, {id:22, complete:false, title:"Easy Peasy", description:"Complete any level"}, {id:23, complete:false, title:"A Little Bit Perfect", description:"Get a perfect rating on any level (don't touch walls)"}, {id:24, complete:false, title:"Kinda Need to Pee", description:"Get a fast rating on any level"}, {id:25, complete:false, title:"Sleuth", description:"Find any secret"}, {id:26, complete:false, title:"A Bit More Perfect", description:"Get a perfect rating on any 15 levels"}, {id:27, complete:false, title:"I Really Need to Pee", description:"Get a fast rating on any 15 level"}, {id:28, complete:false, title:"Super Sleuth", description:"Find any 15 secrets"}, {id:29, complete:false, title:"Travelled a Bit", description:"Complete any 15 levels"}, {id:30, complete:false, title:"Perfectly perfect", description:"Get a perfect rating on every level"}, {id:31, complete:false, title:"Desparate for a Pee", description:"Get a fast rating on every level"}, {id:32, complete:false, title:"Ultra Sleuth", description:"Find every secret"}, {id:33, complete:false, title:"Got the Lot", description:"Complete every level"}, {id:34, complete:false, title:"Button Basher", description:"Get retribution from the grumpy button"}, {id:35, complete:false, title:"I See What You Did There", description:"Answer a \"what's it from\" quiz question correctly"}, {id:36, complete:false, title:"I See What You Did There Too", description:"Answer 15 \"what's it from\" quiz questions correctly"}, {id:37, complete:false, title:"I See What You Did Everywhere", description:"Answer every \"what's it from\" quiz question correctly"}, {id:38, complete:false, title:"Level Mastery", description:"Master any level: Fast, perfect, secret and every vehicle"}, {id:39, complete:false, title:"Vehicular Mastery", description:"Complete every level with a single vehicle"}, {id:40, complete:false, title:"Been There Done That", description:"Complete every level with every vehicle"}, {id:41, complete:false, title:"Cheeky!", description:"Visit the sponsor or view the walkthrough"}, {id:42, complete:false, title:"Uberachiever", description:"Get every other achievement"}];
_local2.flush();
}
_root.arrAchievements = _local2.data.arrAchievements;
}
function initMiscSO() {
var _local1 = SharedObject.getLocal("hannainachoppa2");
if (_local1.data.buttonStage == undefined) {
_local1.data.buttonStage = "neverPress";
_local1.data.seen_lifter = true;
_local1.data.seen_saucer = false;
_local1.data.seen_jetpack = false;
_local1.data.seen_classic = false;
_local1.data.seen_tardis = false;
_local1.data.seen_balloon = false;
_local1.data.seen_joust = false;
_local1.data.seen_vtol = false;
_local1.data.seen_biplane = false;
_local1.data.seen_zorb = false;
_local1.data.seen_sam = false;
}
_local1.flush();
}
function traceAchievements() {
var _local3 = SharedObject.getLocal("hannainachoppa2");
var _local1 = 1;
while (_local1 < _local3.data.arrAchievements.length) {
var _local2 = _local3.data.arrAchievements[_local1];
trace((_local2.complete ? "Got: " : "NEED: ") + _local2.title);
_local1++;
}
}
function foundSecret() {
if (_root.foundLevelSecret) {
return(undefined);
}
if (_root.objGame.state != "flight") {
return(undefined);
}
_root.foundLevelSecret = true;
switch (_root.curLevelID) {
case 6 :
case 8 :
case 14 :
case 33 :
case 36 :
case 38 :
case 44 :
case 49 :
case 50 :
case 53 :
_root.objSounds.play("voice-eric1");
break;
default :
_root.objSounds.play("voice-secret");
}
_root.objGame.clip.level.secretHide._visible = false;
_root.objGame.clip.level.secretAward._visible = true;
_root.objGame.clip.level.secretAward.play();
var _local8 = SharedObject.getLocal("hannainachoppa2");
_local8.data.arrLevels[_root.curLevelID - 1].secret = true;
_local8.flush();
_root.objGame.secretRefBtn._visible = true;
_root.objGame.secretRef._visible = true;
_root.objMessages.add("text", ("Found level " + _root.curLevelID) + "'s secret!");
var _local7 = 0;
var _local2 = 0;
while (_local2 < _root.vehicles.length) {
var _local4 = _root.vehicles[_local2];
if (_root.arrLevels[_root.curLevelID - 1]["passed_" + _local4]) {
_local7++;
}
_local2++;
}
if (((_local7 == _root.vehicles.length) && (_root.arrLevels[_root.curLevelID - 1].perfect)) && (_root.arrLevels[_root.curLevelID - 1].fast)) {
achieved(38);
}
var _local5 = 1;
var _local6 = 0;
var _local3 = 0;
while (_local3 < _root.arrLevels.length) {
_local6++;
if (_root.arrLevels[_local3].secret) {
_local5++;
}
_local3++;
}
if (_local5 == 1) {
_root.achieved(25);
}
if (_local5 == 15) {
_root.achieved(28);
}
if (_local5 == _local6) {
_root.achieved(32);
}
}
function showDelayedRef() {
_root.objGame.secretRefBtn._visible = true;
_root.objGame.delayRef._visible = true;
}
function setupVehicles() {
_root.tips._alpha = 0;
_root.tips._visible = false;
var _local2 = 0;
while (_local2 < _root.vehicles.length) {
var _local4 = _root.vehicles[_local2];
var _local3 = _root.vehicleMenu["btn_" + _local4];
_local3.vehicleID = _local4;
_local3.onRelease = showVehicle;
_local2++;
}
_root.vehicleMenu.btn_fast.vehicleID = "fast";
_root.vehicleMenu.btn_perfect.vehicleID = "perfect";
_root.vehicleMenu.btn_secret.vehicleID = "secret";
_root.vehicleMenu.btn_fast.onRelease = showVehicle;
_root.vehicleMenu.btn_perfect.onRelease = showVehicle;
_root.vehicleMenu.btn_secret.onRelease = showVehicle;
_root.vehicleMenu.onEnterFrame = function () {
if (Key.isDown(Keys.Enter)) {
backFromVehicles();
}
};
if (_root.showHelpID) {
_root.vehicleMenu["btn_" + _root.showHelpID].onRelease();
}
}
function showVehicle() {
var _local3 = this.vehicleID;
var _local4 = SharedObject.getLocal("hannainachoppa2");
_local4.data["seen_" + _local3] = true;
_local4.flush();
if (_root.backToMenu || (_root.gameStartTarget == "vehicles")) {
_root.tips.gotoAndStop(_local3);
_root.tips._visible = true;
_root.vehicleMenu._alpha = 0;
_root.tips._alpha = 100;
_root.tips.btnBack.onRelease = backFromVehicles;
} else {
_root.tips.gotoAndStop(_local3);
_root.tips._visible = true;
_root.vehicleMenu.alphaTo(0, 0.3);
_root.tips.alphaTo(100, 0.3, "linear", 0.3);
_root.tips.btnBack.onRelease = backFromVehicles;
}
}
function backFromVehicles() {
if (_root.gameStartTarget == "vehicles") {
_root.showHelpID = undefined;
_root.backToMenu = undefined;
_root.vehicleMenu.onEnterFrame = undefined;
_root.gameStartTarget = "game";
_root.objTrans.goto("game");
return(undefined);
}
if (_root.backToMenu) {
_root.showHelpID = undefined;
_root.backToMenu = undefined;
_root.objTrans.goto("picklevel");
} else {
_root.vehicleMenu.alphaTo(100, 0.3);
_root.tips._alpha = 0;
_root.tips._visible = false;
}
}
function setupQuiz() {
var _local7 = 26;
var _local6 = SharedObject.getLocal("hannainachoppa2");
var _local3 = 0;
while (_local3 < _local6.data.arrReferences.length) {
var _local4 = _local6.data.arrReferences[_local3];
var _local5 = _root.arrLevels[_local4.level - 1];
var clip = quizSelector.scrollContent.attachMovieClip("refQuizRow", 0, _local7 * _local3);
clip.gotoAndStop("unfound");
if (_local4.found) {
clip.gotoAndStop("found");
}
if (_local4.correct) {
clip.gotoAndStop("solved");
}
clip.id = _local3;
clip.objRef = _local4;
clip.txtOrdinal.text = Maths.formatNum(_local4.level, 2);
clip.txtTitle.text = _local5.title;
clip.btnPlay.onRelease = function () {
_root.vehicleID = clip.lastUsedVehicle;
_root.curLevelID = this._parent.objRef.level;
_root.objTrans.goto("game");
};
if (!_local5.passed) {
clip.btnPlay._visible = false;
}
_local3++;
}
_root.objScroll = new Scrollbar(quizSelector.vertScroll, _local7 * _local6.data.arrReferences.length, quizSelector.scrollMask._height, evtQuizScroll);
quizSelector.scrollContent.origY = quizSelector.scrollContent._y;
Mouse.removeListener(_root.scrollMgr);
_root.scrollMgr = new Object();
_root.scrollMgr.onMouseWheel = function (delta) {
if (delta == 0) {
return(undefined);
}
_root.objScroll.scrollLine((2 * Math.abs(delta)) / (-delta));
};
Mouse.addListener(_root.scrollMgr);
}
function showHelpFor(id) {
_root.backToMenu = true;
_root.showHelpID = id;
_root.objTrans.goto("vehicles");
}
function startMusic(id) {
if (id == "lifter") {
id = "classic";
}
if (id == "vtol") {
id = "jetpack";
}
if (id == _root.curMusicID) {
if ((!_root.musicMuted) && (!_root.objSounds.sounds[id].playing)) {
_root.objSounds.play(id, undefined, true);
}
return(undefined);
}
if (id == undefined) {
if ((!_root.musicMuted) && (!_root.objSounds.sounds[_root.curMusicID].playing)) {
_root.objSounds.play(_root.curMusicID, undefined, true);
}
} else {
_root.curMusicID = id;
_root.objSounds.stop("music");
if (!_root.musicMuted) {
_root.objSounds.play(id, undefined, true);
}
}
}
function addFirework(holder, startClip) {
var _local2 = new Firework(holder, startClip);
_root.objSounds.play("firework-launch");
arrFireworks.push(_local2);
}
function removeFireworks() {
arrFireworks = [];
}
function evtUpdateFireworks() {
if (menuFireworks && (Math.random() > 0.95)) {
addFirework(_root.fireworkHolder, null);
}
var _local2 = 0;
while (_local2 < arrFireworks.length) {
var _local3 = arrFireworks[_local2];
_local3.evtEnterFrame();
if (_local3.dead) {
_local3 = undefined;
arrFireworks.splice(_local2, 1);
_local2--;
}
_local2++;
}
}
function Firework(holder, startClip) {
this.holder = holder;
var _local2 = startClip.holderToLocal(holder);
if (startClip == null) {
_local2 = {x:Maths.randomNum(0, 730), y:540};
}
this.dead = false;
this.x = _local2.x;
this.y = _local2.y;
this.vx = Maths.randomNum(-3, 3);
this.vy = Maths.randomNum(-15, -10);
this.dampY = Maths.randomNum(0.94, 0.98);
this.thrust = Maths.randomNum(-0.5, -0.8);
this.thrustLife = Maths.randomInt(10, 20);
}
function initSounds() {
_root.objSounds = new Sounds(_root.soundHolder);
_root.objSounds.registerSound("blade0");
_root.objSounds.registerSound("blade1");
_root.objSounds.registerSound("blade2");
_root.objSounds.registerSound("blade3");
_root.objSounds.registerSound("blade4");
_root.objSounds.registerSound("blade5");
_root.objSounds.registerSound("blade6");
_root.objSounds.registerSound("blade7");
_root.objSounds.registerSound("blade8");
_root.objSounds.registerSound("blade9");
_root.objSounds.registerSound("blade10");
_root.objSounds.registerSound("blade11");
_root.objSounds.registerSound("blade12");
_root.objSounds.registerSound("blade13");
_root.objSounds.registerSound("blade14");
_root.objSounds.registerSound("blade15");
_root.objSounds.registerSound("blade16");
_root.objSounds.registerSound("blade17");
_root.objSounds.registerSound("blade18");
_root.objSounds.registerSound("blade19");
_root.objSounds.registerSound("blade20");
_root.objSounds.registerGroup("blade", ["blade0", "blade1", "blade2", "blade3", "blade4", "blade5", "blade6", "blade7", "blade8", "blade9", "blade10", "blade11", "blade12", "blade13", "blade14", "blade15", "blade16", "blade17", "blade18", "blade19", "blade20"]);
_root.objSounds.registerSound("bee-buzz");
_root.objSounds.registerSound("bee-squish-1");
_root.objSounds.registerSound("bee-squish-2");
_root.objSounds.registerSound("bee-squish-3");
_root.objSounds.registerSound("bee-squish-4");
_root.objSounds.registerGroup("bee-squish", ["bee-squish-1", "bee-squish-2", "bee-squish-3", "bee-squish-4"]);
_root.objSounds.registerSound("baa1");
_root.objSounds.registerSound("baa2");
_root.objSounds.registerSound("baa3");
_root.objSounds.registerSound("baa4");
_root.objSounds.registerSound("baa5");
_root.objSounds.registerGroup("baa", ["baa1", "baa2", "baa3", "baa4", "baa5"]);
_root.objSounds.registerSound("cry1");
_root.objSounds.registerSound("cry2");
_root.objSounds.registerSound("cry3");
_root.objSounds.registerSound("cry4");
_root.objSounds.registerSound("cry5");
_root.objSounds.registerSound("cry6");
_root.objSounds.registerGroup("cry", ["cry1", "cry2", "cry3", "cry4", "cry5", "cry6"]);
_root.objSounds.registerSound("clink1");
_root.objSounds.registerSound("clink2");
_root.objSounds.registerSound("clink3");
_root.objSounds.registerSound("clink4");
_root.objSounds.registerGroup("clink", ["clink1", "clink2", "clink3", "clink4"]);
_root.objSounds.registerGroup("clunk", ["clink3", "clink4"]);
_root.objSounds.registerSound("buzz", 10);
_root.objSounds.registerSound("achievement", 60);
_root.objSounds.registerSound("cake-mix");
_root.objSounds.registerSound("net-fall");
_root.objSounds.registerSound("rollover-tick");
_root.objSounds.registerSound("rollover-tock");
_root.objSounds.registerSound("sam-hit");
_root.objSounds.registerSound("sam-launch");
_root.objSounds.registerSound("switch");
_root.objSounds.registerSound("wind-loop");
_root.objSounds.registerSound("crushotron-rumble");
_root.objSounds.registerSound("crushotron-bang");
_root.objSounds.registerSound("scissors");
_root.objSounds.registerSound("ratchet-loop");
_root.objSounds.registerSound("winch-deploy");
_root.objSounds.registerSound("winch-attach", 60);
_root.objSounds.registerSound("winch-retract");
_root.objSounds.registerSound("voice-cake");
_root.objSounds.registerSound("voice-butter");
_root.objSounds.registerSound("voice-chocolate");
_root.objSounds.registerSound("voice-eggs");
_root.objSounds.registerSound("voice-flour");
_root.objSounds.registerSound("voice-sugar");
_root.objSounds.registerSound("voice-boom");
_root.objSounds.registerSound("voice-crashed");
_root.objSounds.registerSound("voice-noooo");
_root.objSounds.registerSound("voice-ouch");
_root.objSounds.registerSound("voice-ow");
_root.objSounds.registerSound("voice-watchit");
_root.objSounds.registerGroup("crashed", ["voice-boom", "voice-crashed", "voice-noooo", "voice-ouch", "voice-ow", "voice-watchit"]);
_root.objSounds.registerSound("voice-complete");
_root.objSounds.registerSound("voice-perfect");
_root.objSounds.registerSound("voice-reallyfast");
_root.objSounds.registerSound("voice-title");
_root.objSounds.registerSound("ant-burn");
_root.objSounds.registerSound("biffobark1");
_root.objSounds.registerSound("bleep1");
_root.objSounds.registerSound("bleep2");
_root.objSounds.registerSound("bleep3");
_root.objSounds.registerSound("bleep4");
_root.objSounds.registerSound("bleep5");
_root.objSounds.registerSound("bleep6");
_root.objSounds.registerSound("bleep7");
_root.objSounds.registerSound("bleep8");
_root.objSounds.registerSound("bleep9");
_root.objSounds.registerSound("bleep10");
_root.objSounds.registerSound("bleep11");
_root.objSounds.registerGroup("bleep", ["bleep1", "bleep2", "bleep3", "bleep4", "bleep5", "bleep6", "bleep7", "bleep8", "bleep9", "bleep10", "bleep11"]);
_root.objSounds.registerSound("brains1");
_root.objSounds.registerSound("brains2");
_root.objSounds.registerSound("brains3");
_root.objSounds.registerSound("brains4");
_root.objSounds.registerSound("brains5");
_root.objSounds.registerGroup("brains", ["brains1", "brains2", "brains3", "brains4", "brains5"]);
_root.objSounds.registerSound("cobweb1");
_root.objSounds.registerSound("cobweb2");
_root.objSounds.registerSound("cobweb3");
_root.objSounds.registerGroup("cobweb", ["cobweb1", "cobweb2", "cobweb3"]);
_root.objSounds.registerSound("corncut1");
_root.objSounds.registerSound("corncut2");
_root.objSounds.registerSound("corncut3");
_root.objSounds.registerSound("corncut4");
_root.objSounds.registerSound("corncut5");
_root.objSounds.registerSound("corncut6");
_root.objSounds.registerGroup("corncut", ["corncut1", "corncut2", "corncut3", "corncut4", "corncut5", "corncut6"]);
_root.objSounds.registerSound("end-balloon");
_root.objSounds.registerSound("end-jetpack");
_root.objSounds.registerSound("firework-launch1");
_root.objSounds.registerSound("firework-launch2");
_root.objSounds.registerSound("firework-launch3");
_root.objSounds.registerSound("firework-launch4");
_root.objSounds.registerSound("firework-launch5");
_root.objSounds.registerGroup("firework-launch", ["firework-launch1", "firework-launch2", "firework-launch3", "firework-launch4", "firework-launch5"]);
_root.objSounds.registerSound("gate-unlock");
_root.objSounds.registerSound("grabber-deploy", 70);
_root.objSounds.registerSound("grabber-grab", 70);
_root.objSounds.registerSound("grabber-retract", 70);
_root.objSounds.registerSound("joust-flap1", 70);
_root.objSounds.registerSound("joust-flap2", 70);
_root.objSounds.registerSound("joust-flap3", 70);
_root.objSounds.registerSound("joust-flap4", 70);
_root.objSounds.registerSound("joust-flap5", 70);
_root.objSounds.registerSound("joust-flap6", 70);
_root.objSounds.registerGroup("joust-flap", ["joust-flap1", "joust-flap2", "joust-flap3", "joust-flap4", "joust-flap5", "joust-flap6"]);
_root.objSounds.registerSound("joust-egg");
_root.objSounds.registerSound("joust-reflect");
_root.objSounds.registerSound("joust-skid", 80);
_root.objSounds.registerSound("lifterblade1");
_root.objSounds.registerSound("lifterblade2");
_root.objSounds.registerSound("lifterblade3");
_root.objSounds.registerSound("lifterblade4");
_root.objSounds.registerSound("lifterblade5");
_root.objSounds.registerSound("lifterblade6");
_root.objSounds.registerSound("lifterblade7");
_root.objSounds.registerSound("lifterblade8");
_root.objSounds.registerGroup("lifterblade", ["lifterblade1", "lifterblade2", "lifterblade3", "lifterblade4", "lifterblade5", "lifterblade6", "lifterblade7", "lifterblade8"]);
_root.objSounds.registerSound("loop-balloon");
_root.objSounds.registerSound("loop-countdown");
_root.objSounds.registerSound("loop-jetpack");
_root.objSounds.registerSound("loop-sam");
_root.objSounds.registerSound("loop-saucer");
_root.objSounds.registerSound("moo-distress");
_root.objSounds.registerSound("moo1");
_root.objSounds.registerSound("moo2");
_root.objSounds.registerSound("moo3");
_root.objSounds.registerSound("moo4");
_root.objSounds.registerGroup("moo", ["moo1", "moo2", "moo3", "moo4"]);
_root.objSounds.registerSound("oxo-lose");
_root.objSounds.registerSound("oxo-reset");
_root.objSounds.registerSound("oxo-win");
_root.objSounds.registerSound("oxo1");
_root.objSounds.registerSound("oxo2");
_root.objSounds.registerSound("oxo3");
_root.objSounds.registerSound("oxo4");
_root.objSounds.registerSound("oxo5");
_root.objSounds.registerGroup("oxo", ["oxo1", "oxo2", "oxo3", "oxo4", "oxo5"]);
_root.objSounds.registerSound("paintsplat1");
_root.objSounds.registerSound("paintsplat2");
_root.objSounds.registerSound("paintsplat3");
_root.objSounds.registerGroup("paintsplat", ["paintsplat1", "paintsplat2", "paintsplat3"]);
_root.objSounds.registerSound("punch1");
_root.objSounds.registerSound("punch2");
_root.objSounds.registerGroup("punch", ["punch1", "punch2"]);
_root.objSounds.registerSound("puzzle-snap");
_root.objSounds.registerSound("sam-brake");
_root.objSounds.registerSound("sam-end");
_root.objSounds.registerSound("sam-fall");
_root.objSounds.registerSound("sam-start");
_root.objSounds.registerSound("saucer-beam");
_root.objSounds.registerSound("servo1");
_root.objSounds.registerSound("servo2");
_root.objSounds.registerSound("servo3");
_root.objSounds.registerSound("servo4");
_root.objSounds.registerSound("servo5");
_root.objSounds.registerSound("servo6");
_root.objSounds.registerGroup("servo", ["servo1", "servo2", "servo3", "servo4", "servo5", "servo6"]);
_root.objSounds.registerSound("start-balloon");
_root.objSounds.registerSound("start-jetpack");
_root.objSounds.registerSound("strangeloop1");
_root.objSounds.registerSound("strangeloop2");
_root.objSounds.registerSound("strangeloop3");
_root.objSounds.registerSound("strangeloop4");
_root.objSounds.registerGroup("strangeloop", ["strangeloop1", "strangeloop2", "strangeloop3", "strangeloop4"]);
_root.objSounds.registerSound("voice-eric1");
_root.objSounds.registerSound("voice-flag1");
_root.objSounds.registerSound("voice-flag2");
_root.objSounds.registerGroup("voice-flag", ["voice-flag1", "voice-flag2"]);
_root.objSounds.registerSound("voice-ref-found1");
_root.objSounds.registerSound("voice-ref-found2");
_root.objSounds.registerGroup("voice-ref-found", ["voice-ref-found1", "voice-ref-found2"]);
_root.objSounds.registerSound("voice-ref-right1");
_root.objSounds.registerSound("voice-ref-right2");
_root.objSounds.registerSound("voice-ref-right3");
_root.objSounds.registerSound("voice-ref-right4");
_root.objSounds.registerSound("voice-ref-right5");
_root.objSounds.registerGroup("voice-ref-right", ["voice-ref-right1", "voice-ref-right2", "voice-ref-right3", "voice-ref-right4", "voice-ref-right5"]);
_root.objSounds.registerSound("voice-ref-wrong1");
_root.objSounds.registerSound("voice-ref-wrong2");
_root.objSounds.registerSound("voice-ref-wrong3");
_root.objSounds.registerSound("voice-ref-wrong4");
_root.objSounds.registerSound("voice-ref-wrong5");
_root.objSounds.registerSound("voice-ref-wrong6");
_root.objSounds.registerGroup("voice-ref-wrong", ["voice-ref-wrong1", "voice-ref-wrong2", "voice-ref-wrong3", "voice-ref-wrong4", "voice-ref-wrong5", "voice-ref-wrong6"]);
_root.objSounds.registerSound("voice-sam-grenade1");
_root.objSounds.registerSound("voice-sam-grenade2");
_root.objSounds.registerGroup("voice-sam-grenade", ["voice-sam-grenade1", "voice-sam-grenade2"]);
_root.objSounds.registerSound("voice-secret1");
_root.objSounds.registerSound("voice-secret2");
_root.objSounds.registerSound("voice-secret3");
_root.objSounds.registerGroup("voice-secret", ["voice-secret1", "voice-secret2", "voice-secret3"]);
_root.objSounds.registerSound("zorb-beam");
_root.objSounds.registerSound("zorb-brake");
_root.objSounds.registerSound("zorb-bounce1");
_root.objSounds.registerSound("zorb-bounce2");
_root.objSounds.registerSound("zorb-bounce3");
_root.objSounds.registerSound("zorb-bounce4");
_root.objSounds.registerSound("zorb-bounce5");
_root.objSounds.registerSound("zorb-bounce6");
_root.objSounds.registerGroup("zorb-bounce", ["zorb-bounce1", "zorb-bounce2", "zorb-bounce3", "zorb-bounce4", "zorb-bounce5", "zorb-bounce6"]);
_root.objSounds.registerSound("bang1");
_root.objSounds.registerSound("bang3");
_root.objSounds.registerSound("bang4");
_root.objSounds.registerSound("bang5");
_root.objSounds.registerGroup("bang", ["bang1", "bang3", "bang4", "bang5"]);
_root.objSounds.registerSound("biplane-backfire");
_root.objSounds.registerSound("cannon");
_root.objSounds.registerSound("firework1");
_root.objSounds.registerSound("firework2");
_root.objSounds.registerSound("firework3");
_root.objSounds.registerGroup("firework", ["firework1", "firework2", "firework3"]);
_root.objSounds.registerSound("fuse");
_root.objSounds.registerSound("ghostdie");
_root.objSounds.registerSound("loop-biplane-high");
_root.objSounds.registerSound("loop-biplane-low");
_root.objSounds.registerSound("loop-biplane-mid");
_root.objSounds.registerSound("loop-machine");
_root.objSounds.registerSound("loop-powerpill");
_root.objSounds.registerSound("pac-dot");
_root.objSounds.registerSound("notfast");
_root.objSounds.registerSound("notperfect");
_root.objSounds.registerSound("targetbreak");
_root.objSounds.registerSound("tardio1");
_root.objSounds.registerSound("tardio2");
_root.objSounds.registerSound("tardio3");
_root.objSounds.registerSound("tardio4");
_root.objSounds.registerSound("tardio5");
_root.objSounds.registerSound("tardio6");
_root.objSounds.registerGroup("tardio", ["tardio1", "tardio2", "tardio3", "tardio4", "tardio5", "tardio6"]);
_root.objSounds.registerSound("zorb", 40);
_root.objSounds.registerSound("balloon", 40);
_root.objSounds.registerSound("biplane", 40);
_root.objSounds.registerSound("classic", 40);
_root.objSounds.registerSound("jetpack", 40);
_root.objSounds.registerSound("joust", 40);
_root.objSounds.registerSound("sam", 40);
_root.objSounds.registerSound("saucer", 40);
_root.objSounds.registerSound("tardis", 40);
_root.objSounds.registerGroup("music", ["zorb", "balloon", "biplane", "classic", "jetpack", "joust", "sam", "saucer", "tardis"]);
_root.objSounds.registerGroup("vehiclelongsounds", ["sam-fall", "wind-loop", "ratchet-loop", "loop-powerpill", "loop-biplane-high", "loop-biplane-low", "loop-biplane-mid", "loop-machine", "loop-balloon", "loop-countdown", "loop-jetpack", "loop-sam", "loop-saucer", "wind-loop"]);
_root.objSounds.registerGroup("longsounds", ["sam-fall", "wind-loop", "ratchet-loop", "loop-powerpill", "loop-biplane-high", "loop-biplane-low", "loop-biplane-mid", "loop-machine", "crushotron-rumble", "crushotron-bang", "loop-balloon", "loop-countdown", "loop-jetpack", "loop-sam", "loop-saucer", "wind-loop"]);
}
function ChoppaGame(clip) {
this.clip = clip;
this.clip.objGame = this;
this.initialise();
}
stop();
_root.objSounds.stop("music");
var Maths = new Object();
Maths.randomNum = function (minNum, maxNum) {
return((Math.random() * (maxNum - minNum)) + minNum);
};
Maths.randomInt = function (minNum, maxNum) {
return(Math.round((Math.random() * (maxNum - minNum)) + minNum));
};
Maths.vectorLength = function (dx, dy) {
return(Math.sqrt((dx * dx) + (dy * dy)));
};
Maths.distance = function (x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
return(Maths.vectorLength(_local2, _local1));
};
Maths.vectorLengthSquared = function (dx, dy) {
return((dx * dx) + (dy * dy));
};
Maths.distanceSquared = function (x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
return(Maths.vectorLengthSquared(_local2, _local1));
};
Maths.angleBetween = function (x1, y1, x2, y2) {
var _local2 = (x1 * x2) + (y1 * y2);
var _local1 = Maths.vectorLength(x1, y1) * Maths.vectorLength(x2, y2);
if (_local1 == 0) {
return(0);
}
return(Math.acos(_local2 / _local1));
};
Maths.dotProduct = function (ax, ay, bx, by) {
return((ax * bx) + (ay * by));
};
Maths.vectorIntersect = function (v1, v2) {
var _local3 = {dx:v2.x - v1.x, dy:v2.y - v1.y};
v1.len = Maths.vectorLength(v1.dx, v1.dy);
v2.len = Maths.vectorLength(v2.dx, v2.dy);
v1.nx = v1.dx / v1.len;
v1.ny = v1.dy / v1.len;
v2.nx = v2.dx / v2.len;
v2.ny = v2.dy / v2.len;
var _local4 = Maths.vectorPerp(_local3, v2) / Maths.vectorPerp(v1, v2);
if (((v1.nx == v2.nx) && (v1.ny == v2.ny)) || ((v1.nx == (-v2.nx)) && (v1.ny == (-v2.ny)))) {
_local4 = 1000000 /* 0x0F4240 */;
}
return({x:v1.x + (v1.dx * _local4), y:v1.y + (v1.dy * _local4), t:_local4});
};
Maths.vectorPerp = function (v1, v2) {
return(((-v1.dy) * v2.dx) + (v1.dx * v2.dy));
};
Maths.vectorProject = function (v1, v2) {
var _local2 = Maths.vectorLength(v2.dx, v2.dy);
var _local4 = v2.dx / _local2;
var _local3 = v2.dy / _local2;
var _local5 = Maths.dotProduct(v1.dx, v1.dy, _local4, _local3);
return({x:v2.x, y:v2.y, dx:_local4 * _local5, dy:_local3 * _local5});
};
Maths.formatNum = function (num, leadingDigits, decimalDigits) {
var _local2 = "" + Math.floor(num);
while (_local2.length < leadingDigits) {
_local2 = "0" + _local2;
}
if (decimalDigits != undefined) {
var _local1 = Math.abs(num) - Math.floor(Math.abs(num));
_local1 = _local1 * Math.pow(10, decimalDigits);
_local1 = Math.floor(_local1);
_local1 = "" + _local1;
while (_local1.length < decimalDigits) {
_local1 = _local1 + "0";
}
_local2 = (_local2 + ".") + _local1;
}
return(_local2);
};
Maths.degToRad = function (degs) {
return(degs * (Math.PI/180));
};
Maths.radToDeg = function (rads) {
return(rads * 57.2957795130823);
};
MovieClip.prototype.drawCross = function (x, y, colour) {
if (colour != undefined) {
this.lineStyle(1, colour, 100);
} else {
this.lineStyle(1, 16711935, 100);
}
var _local2 = 7;
this.moveTo(x - _local2, y);
this.lineTo(x + _local2, y);
this.moveTo(x, y - _local2);
this.lineTo(x, y + _local2);
};
MovieClip.prototype.drawVector = function (v, scale, colour) {
if (colour != undefined) {
this.lineStyle(1, colour, 100);
} else {
this.lineStyle(1, 65280, 100);
}
if (scale == undefined) {
scale = 1;
}
this.moveTo(v.x, v.y);
this.lineTo(v.x + (v.dx * scale), v.y + (v.dy * scale));
};
MovieClip.prototype.curvedRectangle = function (p_nX1, p_nY1, p_nX2, p_nY2, p_nR) {
var _local2 = ((p_nR == undefined) ? 0 : (p_nR));
var _local7 = _local2 * 2;
var _local10 = Math.abs(p_nX2 - p_nX1) - _local7;
var _local8 = Math.abs(p_nY2 - p_nY1) - _local7;
this.moveTo(p_nX1 + _local2, p_nY1);
this.lineTo(p_nX2 - _local2, p_nY1);
this.curveTo(p_nX2, p_nY1, p_nX2, p_nY1 + _local2);
this.lineTo(p_nX2, p_nY2 - _local2);
this.curveTo(p_nX2, p_nY2, p_nX2 - _local2, p_nY2);
this.lineTo(p_nX1 + _local2, p_nY2);
this.curveTo(p_nX1, p_nY2, p_nX1, p_nY2 - _local2);
this.lineTo(p_nX1, p_nY1 + _local2);
this.curveTo(p_nX1, p_nY1, p_nX1 + _local2, p_nY1);
};
MovieClip.prototype.drawSquare = function (x, y, w, h) {
this.moveTo(x, y);
this.lineTo(x + w, y);
this.lineTo(x + w, y + h);
this.lineTo(x, y + h);
this.lineTo(x, y);
};
MovieClip.prototype.drawFilledSquare = function (x, y, w, h, colour, alpha) {
this.beginFill(colour, alpha);
this.drawSquare(x, y, w, h);
this.endFill();
};
MovieClip.prototype.drawCircle = function (x, y, r) {
var _local6 = r * 0.414213562373095;
var _local5 = (r * Math.SQRT2) / 2;
this.moveTo(x + r, y);
this.curveTo(x + r, y + _local6, x + _local5, y + _local5);
this.curveTo(x + _local6, y + r, x, y + r);
this.curveTo(x - _local6, y + r, x - _local5, y + _local5);
this.curveTo(x - r, y + _local6, x - r, y);
this.curveTo(x - r, y - _local6, x - _local5, y - _local5);
this.curveTo(x - _local6, y - r, x, y - r);
this.curveTo(x + _local6, y - r, x + _local5, y - _local5);
this.curveTo(x + r, y - _local6, x + r, y);
};
MovieClip.prototype.drawFilledCircle = function (x, y, r, colour, alpha) {
this.beginFill(colour, alpha);
this.drawCircle(x, y, r);
this.endFill();
};
MovieClip.prototype.drawCircleSegment = function (x, y, r, startAngle, endAngle, stepAngle) {
degToRad = (Math.PI/180);
while (endAngle < startAngle) {
endAngle = endAngle + 360;
}
this.moveTo(x, y);
this.lineTo(x + (r * Math.cos(startAngle * degToRad)), x + (r * Math.sin(startAngle * degToRad)));
var _local2 = startAngle + stepAngle;
while (_local2 < (endAngle - stepAngle)) {
var _local3 = _local2 * degToRad;
this.lineTo(x + (r * Math.cos(_local3)), x + (r * Math.sin(_local3)));
_local2 = _local2 + stepAngle;
}
this.lineTo(x + (r * Math.cos(endAngle * degToRad)), x + (r * Math.sin(endAngle * degToRad)));
this.lineTo(x, y);
};
MovieClip.prototype.drawFilledCircleSegment = function (x, y, r, startAngle, endAngle, stepAngle, colour, alpha) {
this.beginFill(colour, alpha);
this.drawCircleSegment(x, y, r, startAngle, endAngle, stepAngle);
this.endFill();
};
MovieClip.prototype.drawSmoothCurveThroughPoints = function (wibbleFactor, startAngle, points) {
this.moveTo(points[0].x, points[0].y);
var _local13 = points[0].x - Math.cos((Math.PI * startAngle) / 180);
var _local12 = points[0].y - Math.sin((Math.PI * startAngle) / 180);
var _local2 = 1;
while (_local2 < points.length) {
var _local5 = points[_local2 - 1].x - _local13;
var _local4 = points[_local2 - 1].y - _local12;
var _local8 = Maths.vectorLength(_local5, _local4);
var _local10 = points[_local2 - 1].x - points[_local2].x;
var _local9 = points[_local2 - 1].y - points[_local2].y;
var _local11 = Maths.vectorLength(_local10, _local9);
cScale = 0;
if (_local8 != 0) {
cScale = ((0.5 + wibbleFactor) * _local11) / _local8;
}
var _local7 = points[_local2 - 1].x + (_local5 * cScale);
var _local6 = points[_local2 - 1].y + (_local4 * cScale);
this.curveTo(_local7, _local6, points[_local2].x, points[_local2].y);
_local13 = _local7;
_local12 = _local6;
_local2++;
}
};
MovieClip.prototype.hitTestShape = function (clip, alphaTolerance) {
if (alphaTolerance == undefined) {
alphaTolerance = 255;
}
var _local5 = this.getBounds(_root);
var _local4 = clip.getBounds(_root);
if (((_local5.xMax < _local4.xMin) || (_local4.xMax < _local5.xMin)) || ((_local5.yMax < _local4.yMin) || (_local4.yMax < _local5.yMin))) {
return(undefined);
}
var _local3 = {};
_local3.xMin = Math.max(_local5.xMin, _local4.xMin);
_local3.xMax = Math.min(_local5.xMax, _local4.xMax);
_local3.yMin = Math.max(_local5.yMin, _local4.yMin);
_local3.yMax = Math.min(_local5.yMax, _local4.yMax);
var _local8 = new flash.display.BitmapData(_local3.xMax - _local3.xMin, _local3.yMax - _local3.yMin, false);
var _local6 = this.transform.concatenatedMatrix;
_local6.tx = _local6.tx - _local3.xMin;
_local6.ty = _local6.ty - _local3.yMin;
_local8.draw(this, _local6, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, alphaTolerance));
_local6 = clip.transform.concatenatedMatrix;
_local6.tx = _local6.tx - _local3.xMin;
_local6.ty = _local6.ty - _local3.yMin;
_local8.draw(clip, _local6, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, alphaTolerance), "difference");
var _local7 = _local8.getColorBoundsRect(4294967295, 4278255615);
if (_local7.width == 0) {
return(undefined);
}
_local7.x = _local7.x + _local3.xMin;
_local7.y = _local7.y + _local3.yMin;
return(_local7);
};
MovieClip.prototype.localToLocal = function (clip, x, y) {
var _local2 = {x:x, y:y};
clip.localToGlobal(_local2);
this.globalToLocal(_local2);
return(_local2);
};
MovieClip.prototype.holderToLocal = function (clip) {
var _local2 = {x:0, y:0};
this.localToGlobal(_local2);
clip.globalToLocal(_local2);
return(_local2);
};
MovieClip.prototype.holderToGlobal = function () {
var _local2 = {x:0, y:0};
this.localToGlobal(_local2);
return(_local2);
};
MovieClip.prototype.makeSound = function (soundLinkage, depth) {
var _local2 = this.createEmptyMovieClip((((("soundClip_" + soundLinkage) + "_") + depth) + "_") + Math.floor(Maths.randomNum(1000000, 9000000)), depth);
_local2.sound = new Sound(_local2);
_local2.sound.attachSound(soundLinkage);
_local2.sound.sourceClip = _local2;
return(_local2.sound);
};
MovieClip.prototype.addHolder = function (x, y) {
var _local3 = this.getNextHighestDepth();
var _local2 = this.createEmptyMovieClip("holder_" + _local3, _local3);
_local2._x = x;
_local2._y = y;
return(_local2);
};
MovieClip.prototype.attachMovieClip = function (linkage, x, y) {
if (x == undefined) {
x = 0;
}
if (y == undefined) {
y = 0;
}
var _local3 = this.getNextHighestDepth();
this.attachMovie(linkage, (linkage + "_") + _local3, _local3);
var _local2 = this[(linkage + "_") + _local3];
_local2._x = x;
_local2._y = y;
return(_local2);
};
var Keys = new Object();
Keys.LeftMouse = 1;
Keys._mouseDown = false;
Keys.onMouseDown = function () {
this._mouseDown = true;
};
Keys.onMouseUp = function () {
this._mouseDown = false;
};
Mouse.addListener(Keys);
Keys.mouseDown = function () {
return(this._mouseDown);
};
Keys.CursorLeft = 37;
Keys.CursorRight = 39;
Keys.CursorUp = 38;
Keys.CursorDown = 40;
Keys.Escape = 27;
Keys.Backspace = 8;
Keys.Tab = 9;
Keys.Enter = 13;
Keys.Shift = 16;
Keys.Control = 17;
Keys.Alt = 18;
Keys.CapsLock = 20;
Keys.Spacebar = 32;
Keys.PageUp = 33;
Keys.PageDown = 34;
Keys.End = 35;
Keys.Home = 36;
Keys.PrintScr = 44;
Keys.ScrollLock = 145;
Keys.Pause = 19;
Keys.Insert = 45;
Keys.Delete = 46;
Keys.NumLock = 144;
Keys.Semicolon = 186;
Keys.Equals = 187;
Keys.Minus = 189;
Keys.Slash = 191;
Keys.Apostrophe = 192;
Keys.BackTick = 223;
Keys.BackSlash = 220;
Keys.Hash = 222;
Keys.Comma = 188;
Keys.Period = 190;
Keys.SquareOpen = 219;
Keys.SquareClose = 221;
Keys.F1 = 112;
Keys.F2 = 113;
Keys.F3 = 114;
Keys.F4 = 115;
Keys.F5 = 116;
Keys.F6 = 117;
Keys.F7 = 118;
Keys.F8 = 119;
Keys.F9 = 120;
Keys.F10 = undefined;
Keys.F11 = 122;
Keys.F12 = 123;
Keys.Num0 = 96;
Keys.Num1 = 97;
Keys.Num2 = 98;
Keys.Num3 = 99;
Keys.Num4 = 100;
Keys.Num5 = 101;
Keys.Num6 = 102;
Keys.Num7 = 103;
Keys.Num8 = 104;
Keys.Num9 = 105;
Keys.NumMultiply = 106;
Keys.NumAdd = 107;
Keys.NumEnter = 13;
Keys.NumMinus = 109;
Keys.NumPeriod = 110;
Keys.NumDivide = 111;
Keys.A = 65;
Keys.B = 66;
Keys.C = 67;
Keys.D = 68;
Keys.E = 69;
Keys.F = 70;
Keys.G = 71;
Keys.H = 72;
Keys.I = 73;
Keys.J = 74;
Keys.K = 75;
Keys.L = 76;
Keys.M = 77;
Keys.N = 78;
Keys.O = 79;
Keys.P = 80;
Keys.Q = 81;
Keys.R = 82;
Keys.S = 83;
Keys.T = 84;
Keys.U = 85;
Keys.V = 86;
Keys.W = 87;
Keys.X = 88;
Keys.Y = 89;
Keys.Z = 90;
Keys.Key0 = 48;
Keys.Key1 = 49;
Keys.Key2 = 50;
Keys.Key3 = 51;
Keys.Key4 = 52;
Keys.Key5 = 53;
Keys.Key6 = 54;
Keys.Key7 = 55;
Keys.Key8 = 56;
Keys.Key9 = 57;
Sounds.prototype.registerSound = function (linkage, defaultVolume) {
if (defaultVolume == undefined) {
defaultVolume = 100;
}
var _local4 = this.clip.getNextHighestDepth();
var _local2 = this.clip.createEmptyMovieClip((linkage + "_") + _local4, _local4);
_local2.sound = new Sound(_local2);
_local2.sound.defaultVolume = defaultVolume;
_local2.sound.clip = _local2;
_local2.sound.attachSound(linkage);
_local2.sound.setVolume(defaultVolume);
this.sounds[linkage] = _local2.sound;
this.sounds[linkage].looping = false;
this.sounds[linkage].playing = false;
this.sounds[linkage].onSoundComplete = function () {
if (this.looping) {
this.start();
} else {
this.playing = false;
}
};
return(_local2.sound);
};
Sounds.prototype.registerGroup = function (groupID, arrGroupIDs) {
var _local2 = 0;
while (_local2 < arrGroupIDs.length) {
if (this.sounds[arrGroupIDs[_local2]] == undefined) {
trace(((("Sounds: Group '" + groupID) + "' contains non-registered sound ID '") + arrGroupIDs[_local2]) + "'");
}
_local2++;
}
this.groups[groupID] = arrGroupIDs;
};
Sounds.prototype.play = function (id, volume, loop, soundPosition) {
if (this.muted) {
return(undefined);
}
if (loop != undefined) {
this.sounds[id].looping = loop;
}
if (soundPosition == undefined) {
soundPosition = 0;
}
if (this.groups[id] != undefined) {
id = this.groups[id][Maths.randomInt(0, this.groups[id].length - 1)];
}
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to play unregistered sound '" + id) + "'");
}
if (volume != undefined) {
this.sounds[id].setVolume(volume);
}
this.sounds[id].start(soundPosition);
this.sounds[id].playing = true;
};
Sounds.prototype.stop = function (id) {
if (this.groups[id] != undefined) {
var _local2 = 0;
while (_local2 < this.groups[id].length) {
this.stop(this.groups[id][_local2]);
_local2++;
}
} else {
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to stop unregistered sound '" + id) + "'");
}
this.sounds[id].looping = false;
this.sounds[id].stop();
this.sounds[id].playing = false;
}
};
Sounds.prototype.volume = function (id, volume) {
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to set volume of unregistered sound '" + id) + "'");
}
this.sounds[id].setVolume(volume);
};
Sounds.prototype.fadeTo = function (id, volume, dVol) {
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to fade volume of unregistered sound '" + id) + "'");
}
if (dVol == undefined) {
dVol = 1;
}
this.sounds[id].dVol = Math.ceil(Math.abs(dVol));
this.sounds[id].targetVol = volume;
};
Sounds.prototype.stopAllSounds = function () {
for (id in this.sounds) {
this.stop(id);
}
};
Sounds.prototype.fadeOutAllSounds = function (dVol) {
for (id in this.sounds) {
this.fadeTo(id, 0, dVol);
}
};
Sounds.prototype.setMute = function (muted) {
this.muted = muted;
if (this.muted) {
this.stopAllSounds();
}
};
Sounds.prototype.registerSources = function (listenerClip, arrSourceClips, id, maxAudibleRange) {
var _local2 = {};
_local2.listener = listenerClip;
_local2.sources = arrSourceClips;
_local2.sound = this.sounds[id];
_local2.maxRange = maxAudibleRange;
this.play(id, 0, true);
this.loops.push(_local2);
return(_local2.sources);
};
Sounds.prototype.removeAllSources = function () {
var _local2 = 0;
while (_local2 < this.loops.length) {
var _local3 = this.loops[_local2];
_local3.sound.stop();
_local2++;
}
this.loops = [];
};
Sounds.prototype.evtEnterFrame = function () {
var _local10 = 0;
while (_local10 < this.loops.length) {
var _local3 = this.loops[_local10];
var _local7 = _local3.maxRange;
var _local8 = _local3.listener.holderToGlobal();
var _local2 = 0;
while (_local2 < _local3.sources.length) {
var _local4 = _local3.sources[_local2];
if ((_local4 == undefined) || (_local4.notSoundSource == true)) {
_local3.sources.splice(_local2, 1);
_local2--;
} else {
var _local5 = _local4.holderToGlobal();
var _local6 = Maths.distance(_local8.x, _local8.y, _local5.x, _local5.y);
if (_local6 < _local7) {
_local7 = _local6;
}
}
_local2++;
}
_local3.sound.setVolume(Math.floor((100 * (_local3.maxRange - _local7)) / _local3.maxRange));
_local10++;
}
for (id in this.sounds) {
if (this.sounds[id].targetVol != undefined) {
var _local9 = this.sounds[id].getVolume();
var _local11 = _local9 - this.sounds[id].targetVol;
if (Math.abs(_local11) < this.sounds[id].dVol) {
this.sounds[id].setVolume(this.sounds[id].targetVol);
this.sounds[id].targetVol = undefined;
} else {
this.sounds[id].setVolume(((_local11 > 0) ? (_local9 - this.sounds[id].dVol) : (_local9 + this.sounds[id].dVol)));
}
}
}
};
Physics.prototype.toggleDebug = function () {
this.baseClip._visible = !this.baseClip._visible;
};
Physics.prototype.step = function () {
if (this.paused == true) {
return(undefined);
}
com.deeperbeige.utils.Profiler.label("Phx: Start");
var _local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
_local15.hasHitSurface = false;
if (!_local15.fixed) {
_local15.prevX = _local15.x;
_local15.prevY = _local15.y;
var _local8 = _local15.sumSpringForces();
_local8.x = _local8.x + (this.gravityX * _local15.mass);
_local8.y = _local8.y + (this.gravityY * _local15.mass);
_local8.x = _local8.x + _local15.extForceX;
_local8.y = _local8.y + _local15.extForceY;
_local15.extForceX = 0;
_local15.extForceY = 0;
_local15.vx = _local15.vx + (_local8.x / _local15.mass);
_local15.vy = _local15.vy + (_local8.y / _local15.mass);
}
_local16++;
}
if (this.attractingMasses) {
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
if (_local15.attractionMass != 0) {
_local15.applyAttractionForces();
}
_local16++;
}
}
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
if (!_local15.fixed) {
if (_local15.vx > _local15.friction) {
_local15.vx = _local15.vx - _local15.friction;
} else if (_local15.vx < (-_local15.friction)) {
_local15.vx = _local15.vx + _local15.friction;
} else {
_local15.vx = 0;
}
if (_local15.vy > _local15.friction) {
_local15.vy = _local15.vy - _local15.friction;
} else if (_local15.vy < (-_local15.friction)) {
_local15.vy = _local15.vy + _local15.friction;
} else {
_local15.vy = 0;
}
_local15.vx = _local15.vx * this.drag;
_local15.vy = _local15.vy * this.drag;
}
_local16++;
}
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
_local15.x = _local15.x + _local15.vx;
_local15.y = _local15.y + _local15.vy;
_local16++;
}
this.masses.sort(massSort, Array.NUMERIC);
_local16 = 0;
while (_local16 < this.masses.length) {
this.masses[_local16].testedSet = [];
_local16++;
}
var _local10 = [];
if (this.collidableMasses) {
_local16 = 0;
while (_local16 < this.masses.length) {
var _local12 = this.masses[_local16];
var _local20 = (this.biggestMassRadius + _local12.radius) + 1;
var _local17 = _local12.x + _local20;
_local12.hasHitMass = false;
var _local2 = _local16 + 1;
while (_local2 < this.masses.length) {
var _local11 = this.masses[_local2];
if (_local11.x > _local17) {
_local2 = this.masses.length;
} else if ((((((_local12 != undefined) && (_local11 != undefined)) && (_local12.testedSet[_local2] == undefined)) && (_local12.collisionSet != undefined)) && (_local11.collisionSet != undefined)) && (_local12.collisionSet != _local11.collisionSet)) {
var _local7 = _local12.x - _local11.x;
var _local6 = _local12.y - _local11.y;
var _local14 = (_local7 * _local7) + (_local6 * _local6);
var _local13 = (_local12.radius + _local11.radius) * (_local12.radius + _local11.radius);
if (_local14 < _local13) {
_local10.push({massA:_local12, massB:_local11});
}
_local12.testedSet[_local2] = true;
_local11.testedSet[_local16] = true;
}
_local2++;
}
_local17 = _local12.x - _local20;
_local2 = _local16 - 1;
while (_local2 >= 0) {
var _local11 = this.masses[_local2];
if (_local11.x < _local17) {
_local2 = -1;
} else if ((((((_local12 != undefined) && (_local11 != undefined)) && (_local12.testedSet[_local2] == undefined)) && (_local12.collisionSet != undefined)) && (_local11.collisionSet != undefined)) && (_local12.collisionSet != _local11.collisionSet)) {
var _local7 = _local12.x - _local11.x;
var _local6 = _local12.y - _local11.y;
var _local14 = (_local7 * _local7) + (_local6 * _local6);
var _local13 = _local12.radiusSquared + _local11.radiusSquared;
if (_local14 < _local13) {
_local10.push({massA:_local12, massB:_local11});
}
_local12.testedSet[_local2] = true;
_local11.testedSet[_local16] = true;
}
_local2--;
}
_local16++;
}
}
_local10.sort(collisionSort);
_local16 = 0;
while (_local16 < _local10.length) {
var _local15 = _local10[_local16].massA;
_local15.hasHitMass = true;
_local15.resolveCollision(_local10[_local16].massB);
_local16++;
}
com.deeperbeige.utils.Profiler.label("Phx: Collide surfaces");
this.sortSurfaces();
_local16 = 0;
while (_local16 < this.masses.length) {
var _local5 = this.masses[_local16];
var _local3 = [];
var _local19 = _local5.x - _local5.radius;
var _local18 = _local5.x + _local5.radius;
if (_local5.fixed) {
} else {
var _local2 = 0;
while (_local2 < this.surfacesOrdered.length) {
var _local9 = this.surfacesOrdered[_local2];
if (_local9.x1 <= _local18) {
_local3.push(_local9);
} else {
_local2 = this.surfacesOrdered.length;
}
_local2++;
}
_local3.sort(surfaceRightSort, Array.NUMERIC);
_local2 = 0;
while (_local2 < _local3.length) {
var _local9 = _local3[_local2];
if (_local9.x2 >= _local19) {
_local9.handleCollision(_local5);
} else {
_local2 = _local3.length;
}
_local2++;
}
}
_local16++;
}
com.deeperbeige.utils.Profiler.label("Phx: Surfaces finished");
if (this.framePaintCallback) {
this.framePaintCallback();
}
if (this.defaultPaint) {
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
_local15.clipRep._x = _local15.x;
_local15.clipRep._y = _local15.y;
_local16++;
}
_local16 = 0;
while (_local16 < this.springs.length) {
var _local4 = this.springs[_local16];
_local4.clipRep.clear();
_local4.clipRep.lineStyle(1, 16711680, 100);
_local4.clipRep.moveTo(_local4.mass1.x, _local4.mass1.y);
_local4.clipRep.lineTo(_local4.mass2.x, _local4.mass2.y);
_local16++;
}
}
com.deeperbeige.utils.Profiler.label("Phx: Finished");
};
Physics.prototype.sortSurfaces = function () {
if (!this.surfacesChanged) {
return(undefined);
}
this.surfacesChanged = false;
this.surfacesOrdered = [];
var _local2 = 0;
while (_local2 < this.surfaces.length) {
this.surfacesOrdered.push(this.surfaces[_local2]);
_local2++;
}
this.surfacesOrdered.sort(surfaceLeftSort, Array.NUMERIC);
};
Mass.prototype.setRadius = function (r) {
this.radius = r;
this.radiusSquared = this.radius * this.radius;
this.clipRep.clear();
this.clipRep.lineStyle(this.radius * 2, 255, 50);
this.clipRep.moveTo(0, 0);
this.clipRep.lineTo(0, 1);
};
Mass.prototype.removeMass = function () {
var _local2 = 0;
while (_local2 < this.springs.length) {
this.springs[_local2].removeSpring();
_local2--;
_local2++;
}
_local2 = 0;
while (_local2 < this.physics.masses.length) {
if (this == this.physics.masses[_local2]) {
this.physics.masses.splice(_local2, 1);
_local2 = this.physics.masses.length;
}
_local2++;
}
if (this.physics.defaultPaint) {
this.clipRep.removeMovieClip();
}
this.removed = true;
};
Mass.prototype.sumSpringForces = function () {
if (this.fixed) {
return({x:0, y:0});
}
var _local5 = {x:0, y:0};
var _local3 = 0;
while (_local3 < this.springs.length) {
var _local2;
var _local4 = this.springs[_local3];
if (this == _local4.mass1) {
_local2 = _local4.forceOnMass1();
} else {
_local2 = _local4.forceOnMass2();
}
_local5.x = _local5.x + _local2.x;
_local5.y = _local5.y + _local2.y;
_local3++;
}
return(_local5);
};
Mass.prototype.applyAttractionForces = function () {
var _local3 = 0;
while (_local3 < this.physics.masses.length) {
var _local2 = this.physics.masses[_local3];
if ((_local2.attractionMass && (this != _local2)) && (!_local2.fixed)) {
var _local4 = this.attractionForce(_local2);
_local2.vx = _local2.vx + (_local4.x / _local2.mass);
_local2.vy = _local2.vy + (_local4.y / _local2.mass);
}
_local3++;
}
};
Mass.prototype.attractionForce = function (otherMass) {
var _local5 = this.x - otherMass.x;
var _local4 = this.y - otherMass.y;
var _local3 = Maths.vectorLength(_local5, _local4);
_local5 = _local5 / _local3;
_local4 = _local4 / _local3;
var _local2 = (this.attractionMass * this.physics.attractionScale) / (_local3 * _local3);
if (Math.abs(_local2) > this.attractionMaxForce) {
_local2 = ((_local2 > 0) ? (this.attractionMaxForce) : (-this.attractionMaxForce));
}
return({x:_local5 * _local2, y:_local4 * _local2});
};
Mass.prototype.resolveCollision = function (otherMass) {
if ((this.collisionSet == undefined) || (this.collisionSet == otherMass.collisionSet)) {
return(undefined);
}
if (otherMass == undefined) {
return(undefined);
}
var _local9 = Maths.distance(this.x, this.y, otherMass.x, otherMass.y);
var _local3 = this.radius + otherMass.radius;
if (_local9 < _local3) {
var _local5 = (this.x + otherMass.x) / 2;
var _local4 = (this.y + otherMass.y) / 2;
var _local7 = this.x - _local5;
var _local6 = this.y - _local4;
var _local8 = Maths.vectorLength(_local7, _local6);
_local7 = _local7 / _local8;
_local6 = _local6 / _local8;
if ((!this.fixed) && (!otherMass.fixed)) {
this.x = _local5 + ((_local7 * _local3) / 2);
this.y = _local4 + ((_local6 * _local3) / 2);
otherMass.x = _local5 + ((_local7 * (-_local3)) / 2);
otherMass.y = _local4 + ((_local6 * (-_local3)) / 2);
} else {
if (this.fixed && (otherMass.fixed)) {
return(undefined);
}
if (!this.fixed) {
this.x = _local5 + ((_local7 * _local3) / 2);
this.y = _local4 + ((_local6 * _local3) / 2);
}
if (!otherMass.fixed) {
otherMass.x = _local5 + ((_local7 * (-_local3)) / 2);
otherMass.y = _local4 + ((_local6 * (-_local3)) / 2);
}
}
this.collisionX = _local5;
this.collisionY = _local4;
otherMass.collisionX = _local5;
otherMass.collisionY = _local4;
this.respondToCollision(otherMass);
this.collisionCallback(otherMass);
otherMass.collisionCallback(this);
}
};
Mass.prototype.respondToCollision = function (otherMass) {
var _local7 = Math.atan2(this.y - otherMass.y, this.x - otherMass.x);
var _local4 = Math.cos(_local7);
var _local3 = Math.sin(_local7);
var _local6 = (this.vx * _local4) + (this.vy * _local3);
var _local9 = (this.vy * _local4) - (this.vx * _local3);
var _local5 = (otherMass.vx * _local4) + (otherMass.vy * _local3);
var _local8 = (otherMass.vy * _local4) - (otherMass.vx * _local3);
var _local12 = (this.mass * _local6) + (otherMass.mass * _local5);
var _local13 = _local6 - _local5;
var _local10 = (_local12 + (this.mass * _local13)) / (this.mass + otherMass.mass);
var _local11 = (_local10 - _local6) + _local5;
_local6 = _local11;
_local5 = _local10;
if (!this.fixed) {
this.vx = ((otherMass.restitution * _local6) * _local4) - ((otherMass.restitution * _local9) * _local3);
this.vy = ((otherMass.restitution * _local9) * _local4) + ((otherMass.restitution * _local6) * _local3);
}
if (!otherMass.fixed) {
otherMass.vx = ((this.restitution * _local5) * _local4) - ((this.restitution * _local8) * _local3);
otherMass.vy = ((this.restitution * _local8) * _local4) + ((this.restitution * _local5) * _local3);
}
};
Spring.prototype.removeSpring = function () {
this.clipRep.removeMovieClip();
var _local2 = 0;
while (_local2 < this.mass1.springs.length) {
if (this == this.mass1.springs[_local2]) {
this.mass1.springs.splice(_local2, 1);
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < this.mass2.springs.length) {
if (this == this.mass2.springs[_local2]) {
this.mass2.springs.splice(_local2, 1);
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < this.physics.springs.length) {
if (this == this.physics.springs[_local2]) {
this.physics.springs.splice(_local2, 1);
return(undefined);
}
_local2++;
}
};
Spring.prototype.currentLength = function () {
var _local5 = this.mass1.x;
var _local3 = this.mass1.y;
var _local4 = this.mass2.x;
var _local2 = this.mass2.y;
return(Maths.distance(_local5, _local3, _local4, _local2));
};
Spring.prototype.currentExtension = function () {
return(this.currentLength() - this.naturalLength);
};
Spring.prototype.forceOnMass1 = function () {
var _local9 = this.mass1.x;
var _local7 = this.mass1.y;
var _local8 = this.mass2.x;
var _local6 = this.mass2.y;
var _local5 = _local8 - _local9;
var _local4 = _local6 - _local7;
var _local3 = Maths.vectorLength(_local5, _local4);
var _local11 = _local5 / _local3;
var _local10 = _local4 / _local3;
var _local12 = this.currentExtension() * this.k;
var _local14 = this.mass2.vx - this.mass1.vx;
var _local13 = this.mass2.vy - this.mass1.vy;
var _local15 = (this.damperK * Maths.dotProduct(_local14, _local13, _local5, _local4)) / _local3;
var _local2 = _local15 + _local12;
if (this.maxForce > 0) {
if (_local2 > this.maxForce) {
_local2 = this.maxForce;
}
if (_local2 < (-this.maxForce)) {
_local2 = -this.maxForce;
}
}
return({x:_local11 * _local2, y:_local10 * _local2});
};
Spring.prototype.forceOnMass2 = function () {
var _local2 = this.forceOnMass1();
return({x:-_local2.x, y:-_local2.y});
};
Surface.prototype.update = function () {
this.len = this.currentLength();
this.x = this.x1;
this.y = this.y1;
this.dx = this.x2 - this.x1;
this.dy = this.y2 - this.y1;
this.nx = this.dx / this.len;
this.ny = this.dy / this.len;
this.normX = -this.ny;
this.normY = this.nx;
this.paint();
this.physics.surfacesChanged = true;
};
Surface.prototype.paint = function () {
this.clipRep.clear();
this.clipRep.lineStyle(1, 65535, 100);
this.clipRep.moveTo(this.x1, this.y1);
this.clipRep.lineTo(this.x2, this.y2);
};
Surface.prototype.currentLength = function () {
return(Maths.vectorLength(this.x1, this.y1, this.x2, this.y2));
};
Surface.prototype.removeSurface = function () {
this.clipRep.removeMovieClip();
var _local2 = 0;
while (_local2 < this.physics.surfaces.length) {
if (this == this.physics.surfaces[_local2]) {
this.physics.surfaces.splice(_local2, 1);
this.physics.surfacesChanged = true;
return(undefined);
}
_local2++;
}
};
Surface.prototype.handleCollision = function (objMass) {
if (this.collisionSet && (this.collisionSet == objMass.collisionSet)) {
return(undefined);
}
var _local4 = {};
_local4.dx = objMass.x - this.x1;
_local4.dy = objMass.y - this.y1;
var _local13 = Maths.dotProduct(_local4.dx, _local4.dy, this.dx, this.dy);
var _local2 = {x:this.x1, y:this.y1, dx:_local4.dx, dy:_local4.dy};
if (_local13 >= 0) {
var _local5 = {};
_local5.dx = objMass.x - this.x2;
_local5.dy = objMass.y - this.y2;
_local13 = Maths.dotProduct(_local5.dx, _local5.dy, this.dx, this.dy);
_local2 = {x:this.x2, y:this.y2, dx:_local5.dx, dy:_local5.dy};
if (_local13 <= 0) {
var _local11 = {dx:this.normX, dy:this.normY};
_local2 = Maths.vectorProject(_local4, _local11);
_local2.x = objMass.x - _local2.dx;
_local2.y = objMass.y - _local2.dy;
}
}
var _local8 = Maths.vectorLength(_local2.dx, _local2.dy);
var _local6 = objMass.radius - _local8;
if (_local6 >= 0) {
objMass.hasHitSurface = true;
if (this.moving) {
_local6 = _local6 * 2;
_local6 = _local6 + 1;
}
_local2.nx = _local2.dx / _local8;
_local2.ny = _local2.dy / _local8;
objMass.x = objMass.x + (_local6 * _local2.nx);
objMass.y = objMass.y + (_local6 * _local2.ny);
var _local12 = {dx:_local2.dy, dy:-_local2.dx};
var _local10 = {dx:objMass.vx, dy:objMass.vy};
var _local7 = Maths.vectorProject(_local10, _local2);
var _local9 = Maths.vectorProject(_local10, _local12);
objMass.collisionNormal = {x:_local7.dx, y:_local7.dy};
objMass.vx = ((-this.restitution) * _local7.dx) + (this.friction * _local9.dx);
objMass.vy = ((-this.restitution) * _local7.dy) + (this.friction * _local9.dy);
this.collisionCallback(objMass, _local2.x, _local2.y);
}
};
SpringBox.prototype.getPosition = function () {
pos = {x:0, y:0, rRad:0, rDeg:0};
pos.x = (((this.m_tl.x + this.m_tr.x) + this.m_bl.x) + this.m_br.x) / 4;
pos.y = (((this.m_tl.y + this.m_tr.y) + this.m_bl.y) + this.m_br.y) / 4;
var _local3 = (this.frontLeft.x + this.frontRight.x) / 2;
var _local2 = (this.frontLeft.y + this.frontRight.y) / 2;
var _local5 = _local3 - pos.x;
var _local4 = _local2 - pos.y;
pos.rRad = Math.atan2(_local4, _local5);
pos.rDeg = Maths.radToDeg(pos.rRad);
return(pos);
};
SpringLine.prototype.getPosition = function () {
pos = {x:0, y:0, rRad:0, rDeg:0};
pos.x = (this.m_b.x + this.m_f.x) / 2;
pos.y = (this.m_b.y + this.m_f.y) / 2;
var _local3 = this.m_f.x;
var _local2 = this.m_f.y;
var _local5 = _local3 - pos.x;
var _local4 = _local2 - pos.y;
pos.rRad = Math.atan2(_local4, _local5);
pos.rDeg = Maths.radToDeg(pos.rRad);
return(pos);
};
Scrollbar.prototype.scrollToFraction = function (offsetFraction) {
this.sliderOffsetFrac = offsetFraction;
if (this.sliderOffsetFrac < 0) {
this.sliderOffsetFrac = 0;
}
if (this.sliderOffsetFrac > 1) {
this.sliderOffsetFrac = 1;
}
this.updateGfx();
};
Scrollbar.prototype.scrollToOffset = function (offsetPixels) {
var _local2 = offsetPixels / (this.contentSize - this.windowSize);
this.scrollToFraction(_local2);
};
Scrollbar.prototype.updateDimensions = function (contentSize) {
this.contentSize = contentSize;
this.updateVars();
this.updateGfx();
};
Scrollbar.prototype.scrollPage = function (pages) {
this.scrollAmount = pages * this.windowSize;
this.scrollJump();
};
Scrollbar.prototype.scrollLine = function (lines) {
var _local2 = this.sliderOffsetFrac;
this.scrollAmount = lines * this.lineSize;
this.scrollJump();
return(((_local2 == this.sliderOffsetFrac) ? false : true));
};
Scrollbar.prototype.scrollJump = function () {
var _local2 = this.sliderOffsetFrac * (this.contentSize - this.windowSize);
this.scrollToOffset(_local2 + this.scrollAmount);
};
Scrollbar.prototype.updateVars = function () {
this.minPos = this.scroller.minPos._y;
this.maxPos = this.scroller.maxPos._y - this.sliderSize;
this.range = this.maxPos - this.minPos;
this.sliderOffsetFrac = (this.scroller.slider._y - this.minPos) / this.range;
if (this.range == 0) {
this.sliderOffsetFrac = 0;
}
this.visibleFrac = this.windowSize / this.contentSize;
if (this.contentSize == 0) {
this.visibleFrac = 1;
}
if (this.visibleFrac > 1) {
this.visibleFrac = 1;
}
this.sliderSize = this.visibleFrac * (this.scroller.maxPos._y - this.scroller.minPos._y);
this.minPos = this.scroller.minPos._y;
this.maxPos = this.scroller.maxPos._y - this.sliderSize;
this.range = this.maxPos - this.minPos;
this.scrollToFraction(this.sliderOffsetFrac);
};
Scrollbar.prototype.updateGfx = function () {
this.scroller.slider._yscale = this.sliderSize;
this.scroller.slider._y = this.minPos + (this.range * this.sliderOffsetFrac);
this.doCallback();
};
Scrollbar.prototype.doCallback = function () {
var _local2 = this.sliderOffsetFrac * (this.contentSize - this.windowSize);
if (_local2 < 0) {
_local2 = 0;
}
if (this.callbackScope != undefined) {
this.callbackScope[this.callback](_local2, this.sliderOffsetFrac);
} else {
this.callback(_local2, this.sliderOffsetFrac);
}
};
Scrollbar.prototype.initialise = function () {
this.easeFunc = "easeInOutQuad";
this.easeTimeQuick = 0.2;
this.easeTimeSlow = 1;
this.frame = 0;
this.state = "idle";
this.sliderSize = 100;
this.lineSize = 20;
this.scrollRepeatSpeed = 1;
this.scroller.onEnterFrame = function () {
this.objScrollbar.evtEnterFrame();
};
this.scroller.onMouseDown = function () {
this.objScrollbar.evtMouseDown();
};
this.scroller.onMouseUp = function () {
this.objScrollbar.evtMouseUp();
};
this.scroller.btnUp.onPress = function () {
this._parent.objScrollbar.scrollAmount = -this._parent.objScrollbar.lineSize;
this._parent.objScrollbar.setState("scrolljump");
};
this.scroller.btnDown.onPress = function () {
this._parent.objScrollbar.scrollAmount = this._parent.objScrollbar.lineSize;
this._parent.objScrollbar.setState("scrolljump");
};
this.scroller.minPos._visible = false;
this.scroller.maxPos._visible = false;
if (this.scroller.slider._y < this.scroller.minPos._y) {
this.scroller.slider._y = this.scroller.minPos._y;
}
if ((this.scroller.slider._y + this.scroller.slider._height) > this.scroller.maxPos._y) {
this.scroller.slider._y = this.scroller.maxPos._y - this.scroller.slider._height;
}
this.updateVars();
this.updateGfx();
};
Scrollbar.prototype.evtEnterFrame = function () {
this.frame++;
switch (this.state) {
case "idle" :
break;
case "dragging" :
this.scroller.slider._y = this.scroller._ymouse + this.mouseOffset;
if (this.scroller.slider._y < this.minPos) {
this.scroller.slider._y = this.minPos;
}
if (this.scroller.slider._y > this.maxPos) {
this.scroller.slider._y = this.maxPos;
}
this.sliderOffsetFrac = (this.scroller.slider._y - this.minPos) / this.range;
this.doCallback();
break;
case "scrolljump" :
this.scrollRepeatFrames--;
if (this.scrollRepeatFrames <= 0) {
this.scrollJump();
this.scrollRepeatFrames = this.scrollRepeatSpeed;
}
break;
default :
trace(("Scrollbar: evtEnterFrame(" + this.state) + "): Unhandled");
}
};
Scrollbar.prototype.evtMouseDown = function () {
switch (this.state) {
case "idle" :
if (this.scroller.slider.hitTest(_root._xmouse, _root._ymouse, true)) {
this.setState("dragging");
} else if (this.scroller.bg.hitTest(_root._xmouse, _root._ymouse, true)) {
if (this.scroller._ymouse > this.scroller.slider._y) {
this.scrollAmount = this.windowSize;
} else {
this.scrollAmount = -this.windowSize;
}
this.setState("scrolljump");
}
break;
case "dragging" :
break;
case "scrolljump" :
break;
default :
trace(("Scrollbar: evtMouseDown(" + this.state) + "): Unhandled");
}
};
Scrollbar.prototype.evtMouseUp = function () {
switch (this.state) {
case "idle" :
break;
case "dragging" :
this.setState("idle");
break;
case "scrolljump" :
this.setState("idle");
break;
default :
trace(("Scrollbar: evtMouseUp(" + this.state) + "): Unhandled");
}
};
Scrollbar.prototype.setState = function (newState) {
var _local3 = this.state;
this.state = newState;
switch (newState) {
case "idle" :
break;
case "dragging" :
this.mouseOffset = this.scroller.slider._y - this.scroller._ymouse;
break;
case "scrolljump" :
this.scrollJump();
this.scrollRepeatFrames = 15;
break;
default :
trace(("Scrollbar: setState(" + newState) + "): Unhandled");
}
};
Scrollbar.prototype.evt = function () {
};
ChoppaGame.prototype.initialiseItems = function () {
this.webCount = 0;
this.antCount = 0;
this.ghosts = 0;
this.dots = 0;
this.cogs = 0;
this.targetHitCount = 0;
this.secretDiscoverable = true;
this.powerPillFrames = 0;
this.zombies = 0;
this.paintedItems = 0;
this.fireworks = 0;
this.clip.level.flag.origX = this.clip.level.flag._x;
this.clip.level.flag.origY = this.clip.level.flag._y;
var _local3 = 0;
var clip = this.clip.level["b" + _local3];
while (clip != undefined) {
if (clip.oneton) {
clip.item = "oneton";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local5 = new SpringBox(_local13.x, _local13.y, 40, 40, 0, 0, 20, 0.7, 1.2, _local3, this.objPhysics);
clip.objBox = _local5;
_local5.m_tl.oneton = true;
_local5.m_tr.oneton = true;
_local5.m_bl.oneton = true;
_local5.m_br.oneton = true;
_local5.m_tl.collisionSound = "clunk";
_local5.m_tr.collisionSound = "clunk";
_local5.m_bl.collisionSound = "clunk";
_local5.m_br.collisionSound = "clunk";
_local5.m_tl.collisionCallback = function (otherMass) {
if (!otherMass.owner.zombie) {
return(undefined);
}
speed = Maths.vectorLength(this.vx, this.vy);
if (speed > 3) {
otherMass.owner.die();
}
};
_local5.m_tr.collisionCallback = _local5.m_tl.collisionCallback;
_local5.m_bl.collisionCallback = _local5.m_tl.collisionCallback;
_local5.m_br.collisionCallback = _local5.m_tl.collisionCallback;
}
if (clip.magnet) {
clip.item = "magnet";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local4 = new SpringLine(_local13.x, _local13.y, 30, 0, 0, 0, 18, 0.8, 1, this.objPhysics, _local3);
clip.objLine = _local4;
this.objPhysics.attractingMasses = true;
_local4.m_f.attractionMass = 25;
_local4.m_f.clip = clip;
_local4.m_b.clip = clip;
_local4.m_f.collisionSound = "clink3";
_local4.m_b.collisionSound = "clink3";
}
if (clip.cork) {
clip.item = "cork";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 62, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 55, false, this.objPhysics, _local3);
clip.m_f.mass = 1.3;
clip.m_b.mass = 1.3;
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
}
if (clip.duster) {
clip.item = "duster";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 22, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 11, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
clip.m_f.isNotWinchable = true;
}
if (clip.cagedoor) {
clip.item = "cagedoor";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 24, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 24, true, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
clip.m_b.isNotWinchable = true;
clip.m_f.clip = clip;
clip.m_b.clip = clip;
}
if (clip.zombie) {
this.zombies++;
this.clip.level.flag._y = this.clip.level.flag.origY + 1000;
this.clip.level.txtZombies.text = ("DE-ANIMATE " + (this.zombies - 5)) + " MORE ZOMBIES FOR FLAG";
clip.item = "zombie";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 18, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 18, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
clip.dir = ((Math.random() > 0.5) ? 1 : -1);
clip.alive = true;
clip.m_b.owner = clip;
clip.m_b.collisionCallback = function (otherMass) {
if (otherMass.isChoppa) {
if (_root.objGame.vehicle.vehicleID != "zorb") {
_root.objGame.choppaCrashed();
}
_root.objGame.createExplosion(this.owner._x, this.owner._y, 25, 250);
this.owner.die();
}
};
clip.die = function () {
if (!this.alive) {
return(undefined);
}
this.alive = false;
this.gotoAndPlay("death");
if (this.m_f.springs.length > 1) {
_root.objGame.toggleWinch();
}
if (this.m_b.springs.length > 1) {
_root.objGame.toggleWinch();
}
this.m_f.removeMass();
this.m_b.removeMass();
_root.objGame.zombies--;
_root.objGame.clip.level.txtZombies.text = ("DE-ANIMATE " + (_root.objGame.zombies - 5)) + " MORE ZOMBIES FOR FLAG";
if (_root.objGame.zombies <= 5) {
_root.objGame.flagAppeared();
_root.objGame.clip.level.flag._y = _root.objGame.clip.level.flag.origY;
_root.objGame.clip.level.txtZombies.text = "";
}
if (_root.objGame.zombies <= 0) {
_root.foundSecret();
_root.objGame.clip.level.txtZombies.text = "UNDEAD INFESTATION ERADICATED";
}
};
}
if (clip.chip) {
clip.item = "chip";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 34, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 34, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
this.consecutiveWins = Maths.randomInt(1000, 100000);
this.clip.level.txtWins.text = "CONSECUTIVE WINS: " + Maths.formatNum(this.consecutiveWins, 6);
this.clip.level.flag._y = this.clip.level.flag._y + 130;
}
if (clip.sponge) {
clip.item = "sponge";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 25, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 25, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
clip.gotoAndStop("empty");
clip.painting = false;
clip.m_f.owner = clip;
clip.m_b.owner = clip;
this.clip.level.flag._y = this.clip.level.flag._y + 130;
}
if (clip.spanner) {
clip.item = "spanner";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 26, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 31, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
clip.m_f.isSpanner = true;
clip.m_b.isSpanner = true;
this.clip.level.flag._y = this.clip.level.flag._y + 130;
}
if (clip.word) {
clip.item = "word";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 32, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 32, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
}
if (clip.web) {
clip.item = "web";
clip.hit._visible = false;
this.webCount++;
}
if (clip.eye) {
clip.item = "eye";
}
if (clip.cannon) {
clip.item = "cannon";
clip.idleFrames = 0;
clip.fired = 0;
}
if (clip.powerpill) {
clip.item = "powerpill";
this.dots++;
}
if (clip.dot) {
clip.item = "dot";
this.dots++;
}
if (clip.ghost) {
clip.item = "ghost";
clip.dead = false;
clip.ghost.prevX = clip.ghost._x;
clip.ghost.prevY = clip.ghost._y;
this.ghosts++;
this.clip.level.flag._y = 3000;
}
if (clip.harvester) {
clip.item = "harvester";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 56.5, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 35, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
this.corn = [];
var _local6 = 0;
var _local8 = this.clip.level["c" + _local3];
while (_local8 != undefined) {
this.corn.push(_local8);
_local3++;
_local8 = this.clip.level["c" + _local3];
}
this.corn.sort(sortOnX, Array.NUMERIC);
this.clip.level.flag._y = this.clip.level.flag._y + 130;
}
if (clip.scissors) {
clip.item = "scissors";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 21, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 34, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
clip.m_f.isScissorHandle = true;
clip.m_b.isScissorBlade = true;
}
if (clip.hair) {
clip.item = "hair";
clip.cut = 0;
this.clip.level.flag._y = this.clip.level.flag._y + 500;
this.clip.level.b9._x = this.clip.level.b9._x - 500;
}
if (clip.ball) {
clip.item = "ball";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 19, false, this.objPhysics, _local3);
_local17.mass = 1.5;
_local17.clip = clip;
clip.objMass = _local17;
_local17.collisionSound = "clink";
}
if (clip.firework) {
clip.item = "firework";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 19, false, this.objPhysics, _local3);
_local17.mass = 1.1;
_local17.clip = clip;
clip.objMass = _local17;
this.fireworks++;
}
if (clip.fuse) {
clip.item = "fuse";
}
if (clip.fixedball) {
clip.item = "fixedball";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 19, true, this.objPhysics, _local3);
_local17.collisionSet = -1;
}
if (clip.biffo) {
clip.item = "biffo";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 27, false, this.objPhysics, _local3);
_local17.mass = 1;
_local17.clip = clip;
clip.objMass = _local17;
_local17.collisionSet = -1;
this.clip.level.flag._y = this.clip.level.flag._y + 130;
this.includesBiffo = true;
this.biffoCalm = false;
_root.objSounds.play("biffobark1");
}
if (clip.bridgepart) {
clip.item = "bridgepart";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 70, false, this.objPhysics, _local3);
_local17.mass = 3;
_local17.clip = clip;
clip.objMass = _local17;
}
if (clip.van) {
clip.item = "van";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 46, false, this.objPhysics, _local3);
_local17.mass = 1.4;
_local17.isVan = true;
_local17.clip = clip;
clip.objMass = _local17;
_local17.isNotWinchable = true;
}
if ((clip.mushroom1 || (clip.mushroom2)) || (clip.mushroom3)) {
var _local11;
if (clip.mushroom1) {
_local11 = 46;
}
if (clip.mushroom2) {
_local11 = 66;
}
if (clip.mushroom3) {
_local11 = 54;
}
clip.item = "mushroom";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, _local11, true, this.objPhysics, _local3);
_local17.isNotWinchable = true;
_local17.hitCount = 0;
_local17.idx = _local3;
_local17.clip = clip;
clip.objMass = _local17;
_local17.collisionCallback = function (otherMass) {
_root.objGame.createExplosion(this.x, this.y, 20, 250);
this.hitCount++;
if ((this.idx == 6) && (this.hitCount == 3)) {
_root.foundSecret();
}
};
_local17.collisionSound = "mushroom";
}
if (clip.cog) {
this.cogs++;
clip.item = "cog";
clip.attached = true;
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local9;
switch (_local3) {
case 0 :
_local9 = 60;
clip.speed = 4;
break;
case 1 :
_local9 = 65;
clip.speed = 3;
break;
case 2 :
_local9 = 41;
clip.speed = 5;
break;
case 3 :
_local9 = 77;
clip.speed = 2;
break;
case 4 :
_local9 = 85;
clip.speed = 1;
}
var _local17 = new Mass(_local13.x, _local13.y, _local9, true, this.objPhysics, _local3);
_local17.mass = 1.8;
_local17.isNotWinchable = true;
_local17.clip = clip;
_local17.collisionSet = -351;
clip.objMass = _local17;
this.explosionsBreakCogs = true;
_local17.collisionSound = "clink";
_local17.collisionCallback = function (otherMass) {
if (this.clip.attached && (otherMass.isSpanner)) {
this.clip.attached = false;
this.fixed = false;
_root.objSounds.play("cogbreak");
_root.objGame.explosionsBreakCogs = false;
_root.objGame.createExplosion(_root.objGame.clip.level.doomsdayMachine._x, _root.objGame.clip.level.doomsdayMachine._y, 12, 250);
_root.objGame.explosionsBreakCogs = true;
_root.objGame.cogs--;
if (_root.objGame.cogs == 0) {
_root.objGame.stopDoomsday();
}
}
};
}
if (clip.donkey) {
clip.item = "donkey";
clip.dead = false;
clip.thisOne = false;
clip.id = _local3;
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 35, false, this.objPhysics, _local3);
if (_local3 == 0) {
clip.gotoAndStop("wonky");
clip.thisOne = true;
}
_local17.mass = 1.3;
_local17.clip = clip;
clip.objMass = _local17;
this.clip.level.flag._y = 3000;
}
if (clip.cow) {
clip.item = "cow";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 37, false, this.objPhysics, _local3);
_local17.mass = 1.8;
_local17.clip = clip;
clip.objMass = _local17;
_local17.collisionSound = "moo";
this.clip.level.flag._x = this.clip.level.flag._x - 1000;
}
if (clip.puzzlepiece) {
clip.item = "puzzlepiece";
clip.id = _local3;
clip.template = this.clip.level["piece" + _local3];
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 35, false, this.objPhysics, _local3);
_local17.mass = 1.3;
_local17.clip = clip;
clip.objMass = _local17;
this.placedPieces = 0;
this.clip.level.flag._y = this.clip.level.flag._y + 130;
this.clip.level.b6._y = this.clip.level.b6._y + 130;
}
if (clip.caravel) {
clip.item = "caravel";
var _local21 = clip.f.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.b.holderToLocal(this.objPhysics.baseClip);
clip.m_f = new Mass(_local21.x, _local21.y, 45, false, this.objPhysics, _local3);
clip.m_b = new Mass(_local19.x, _local19.y, 45, false, this.objPhysics, _local3);
clip.objLine = makeSpringLine(clip.m_f, clip.m_b);
clip.m_f.isNotWinchable = true;
clip.m_b.isNotWinchable = true;
clip.m_f.mass = 2;
clip.m_b.mass = 2;
clip.m_f.collisionSet = -1;
clip.m_b.collisionSet = -1;
clip.m_f.isCaravel = true;
clip.m_b.isCaravel = true;
this.clip.level.flag._y = this.clip.level.flag._y + 1000;
}
if (clip.sailor) {
clip.item = "sailor";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 31, false, this.objPhysics, _local3);
_local17.mass = 1.2;
_local17.isSailor = true;
_local17.clip = clip;
clip.objMass = _local17;
}
if (clip.hitchecker) {
clip.item = "hitchecker";
}
if (clip.secretzone) {
clip.item = "secretzone";
clip._visible = false;
}
if (clip.boat) {
clip.item = "boat";
this.clip.level.flag._y = this.clip.level.flag._y + 1000;
clip.p0._visible = false;
clip.p1._visible = false;
clip.p2._visible = false;
clip.p3._visible = false;
clip.p4._visible = false;
clip.p5._visible = false;
clip.p6._visible = false;
var _local10 = clip.p0.holderToLocal(this.objPhysics.baseClip);
var _local21 = clip.p1.holderToLocal(this.objPhysics.baseClip);
var _local19 = clip.p2.holderToLocal(this.objPhysics.baseClip);
var _local18 = clip.p3.holderToLocal(this.objPhysics.baseClip);
var _local16 = clip.p4.holderToLocal(this.objPhysics.baseClip);
var _local15 = clip.p5.holderToLocal(this.objPhysics.baseClip);
var _local14 = clip.p6.holderToLocal(this.objPhysics.baseClip);
clip.m0 = new Mass(_local10.x, _local10.y, 25, false, this.objPhysics, _local3);
clip.m1 = new Mass(_local21.x, _local21.y, 25, false, this.objPhysics, _local3);
clip.m2 = new Mass(_local19.x, _local19.y, 25, false, this.objPhysics, _local3);
clip.m3 = new Mass(_local18.x, _local18.y, 25, false, this.objPhysics, _local3);
clip.m4 = new Mass(_local16.x, _local16.y, 25, false, this.objPhysics, _local3);
clip.m5 = new Mass(_local15.x, _local15.y, 25, false, this.objPhysics, _local3);
clip.m6 = new Mass(_local14.x, _local14.y, 25, false, this.objPhysics, _local3);
clip.m0.mass = 1.2;
clip.m1.mass = 1.2;
clip.m2.mass = 1.2;
clip.m3.mass = 1.2;
clip.m4.mass = 1.2;
clip.m5.mass = 1.2;
clip.m6.mass = 1.2;
clip.m0.isBoatFront = true;
clip.m3.isBoatRear = true;
clip.plaque = makeSpringLine(clip.m0, clip.m1);
var _local23 = new Spring(clip.m1, clip.m2);
_local23 = new Spring(clip.m2, clip.m3);
_local23 = new Spring(clip.m3, clip.m4);
_local23 = new Spring(clip.m4, clip.m5);
_local23 = new Spring(clip.m5, clip.m6);
_local23 = new Spring(clip.m6, clip.m0);
_local23 = new Spring(clip.m6, clip.m1, 0.1, 0.3);
_local23 = new Spring(clip.m1, clip.m5, 0.1, 0.3);
_local23 = new Spring(clip.m5, clip.m2, 0.1, 0.3);
_local23 = new Spring(clip.m2, clip.m4, 0.1, 0.3);
}
if (clip.sheep) {
clip.item = "sheep";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 25, false, this.objPhysics, _local3);
_local17.mass = 1;
_local17.isSheep = true;
clip.objMass = _local17;
clip.dir = Maths.randomNum(-0.3, 0.3);
clip.dirFrames = Maths.randomInt(30, 100);
_local17.collisionSound = "baa";
}
if (clip.ant) {
clip.item = "ant";
clip.gotoAndPlay(Maths.randomInt(1, clip._totalframes - 1));
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 30, false, this.objPhysics, _local3);
_local17.mass = 1.3;
_local17.isAnt = true;
clip.objMass = _local17;
clip.dir = 1;
this.clip.level.flag._y = this.clip.level.flag._y + 150;
this.antCount++;
this.secretDiscoverable = false;
}
if (clip.pheasant) {
clip.item = "pheasant";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 29, false, this.objPhysics, _local3);
_local17.mass = 1;
_local17.isPheasant = true;
_local17.collisionSet = -300;
clip.objMass = _local17;
clip.flying = 0;
this.targetHitCount++;
this.objPhysics.surfaces[9].collisionSet = -300;
}
if (clip.sheeppen) {
clip.item = "sheeppen";
}
if (clip.platform) {
clip.item = "platform";
}
if (clip.hover) {
clip.item = "hover";
}
if (clip.net) {
clip.item = "net";
clip.state = "untriggered";
clip.masses = [];
var _local10 = clip.p0.holderToLocal(this.objPhysics.baseClip);
var _local21 = clip.p1.holderToLocal(this.objPhysics.baseClip);
var _local22 = _local21.x - _local10.x;
var _local20 = Math.floor(_local22 / 40);
var _local6 = 0;
while (_local6 < _local20) {
var _local7 = new Mass(_local10.x + (40 * _local6), _local10.y, 12, true, this.objPhysics, _local6 + 20);
if (_local6 > 0) {
_local7.netSpring = new Spring(_local7, clip.masses[_local6 - 1]);
}
clip.masses.push(_local7);
_local6++;
}
}
if (clip.bee) {
clip.item = "bee";
if (this.arrBees == undefined) {
this.arrBees = _root.objSounds.registerSources(this.clip.level.choppa, [], "bee-buzz", 300);
}
this.arrBees.push(clip);
this.deadBees = 0;
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
clip.targetX = _local13.x;
clip.targetY = _local13.y;
clip.targetR = Maths.randomNum(0, (Math.PI*2));
clip.targetDR = Maths.randomNum(-0.05, -0.2);
clip.targetRadius = Maths.randomNum(20, 50);
var _local17 = new Mass(_local13.x, _local13.y, 22, false, this.objPhysics, _local3);
_local17.mass = 0.75;
_local17.clip = clip;
_local17.objGame = this;
clip.objMass = _local17;
_local17.collisionCallback = function (otherMass) {
if (otherMass.oneton) {
this.objGame.deadBees++;
if (this.objGame.deadBees == 6) {
_root.achieved(2);
}
_root.objSounds.play("bee-squish");
this.clip.gotoAndPlay("death");
this.clip.notSoundSource = true;
this.removeMass();
}
};
}
if (clip.gootower) {
clip.item = "gootower";
this.makeGooTower(clip, 5, 100, 0.1, 0.2);
}
if (clip.stronggootower) {
clip.item = "gootower";
this.makeGooTower(clip, 7, 78, 0.5, 0.5);
}
if (clip.sam) {
this.hitBySam = false;
clip.item = "sam";
clip.hit._visible = false;
clip.rocketAway = false;
clip.rocketID = _local3 + 1;
this.rocketAirFrames = 0;
this.rocketsLoose = 0;
}
if (clip.rocket) {
clip.item = "rocket";
clip._visible = false;
clip.active = false;
clip.samID = _local3 - 1;
clip.samClip = this.clip.level["b" + clip.samID];
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local4 = new SpringLine(_local13.x, _local13.y, 68, 0, 0, 0, 18, 0.8, 1, this.objPhysics, _local3);
_local4.m_f.idleX = _local4.m_f.x;
_local4.m_f.idleY = _local4.m_f.y;
_local4.m_b.idleX = _local4.m_b.x;
_local4.m_b.idleY = _local4.m_b.y;
_local4.m_f.objGame = this;
_local4.m_f.rocketClip = clip;
_local4.m_f.isRocket = true;
_local4.m_b.isRocket = true;
_local4.m_f.isNotWinchable = true;
_local4.m_b.isNotWinchable = true;
clip.objLine = _local4;
_local4.m_f.collisionSound = "clink1";
_local4.m_b.collisionSound = "clink1";
_local4.m_f.collisionCallback = function (otherMass) {
if (otherMass.isChoppa) {
_root.objSounds.play("sam-hit");
this.rocketClip.active = false;
this.rocketClip._visible = false;
this.rocketClip.samClip.rocketAway = false;
this.objGame.createExplosion(this.x, this.y, 20, 500);
this.objGame.hitBySam = true;
this.objGame.rocketAirFrames = 0;
this.objGame.rocketsLoose--;
}
};
}
if (clip.gravitywell) {
clip.item = "gravitywell";
this.objPhysics.gravityX = 0;
this.objPhysics.gravityY = 0;
this.gravityCentreX = clip._x;
this.gravityCentreY = clip._y;
var _local6 = 0;
while (_local6 < 10) {
clip["g" + _local6].gotoAndPlay(Maths.randomInt(1, clip["g" + _local6]._totalframes));
_local6++;
}
}
if (clip.fan) {
clip.item = "fan";
clip.hit._visible = false;
if (this.arrFans == undefined) {
this.arrFans = _root.objSounds.registerSources(this.clip.level.choppa, [], "wind-loop", 270);
}
this.arrFans.push(clip.n0);
this.arrFans.push(clip.n1);
this.arrFans.push(clip.n2);
if (clip.mobileFan) {
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local17 = new Mass(_local13.x, _local13.y, 18, false, this.objPhysics, _local3);
_local17.mass = 1.2;
clip.objMass = _local17;
}
}
if (clip.mixer) {
clip.item = "mixer";
clip.dr = 0.1;
clip.surfaces = addSurfaces(clip, "s", this.objPhysics, 0.9, 0.95, true);
}
if (clip.crushotron) {
clip.item = "crushotron";
clip.lSurfaces = addSurfaces(clip.l, "s", this.objPhysics, 0.9, 0.95, true);
clip.rSurfaces = addSurfaces(clip.r, "s", this.objPhysics, 0.9, 0.95, true);
}
if (clip.movingSurface) {
clip.item = "movingsurface";
clip.playingBackwards = false;
clip.stopped = false;
clip.surfaces = addSurfaces(clip.hub, "s", this.objPhysics, 0.9, 0.95, true);
if (clip.hub.flag) {
this.clip.level.flag = clip.hub.flag;
}
}
if (clip.mazehub) {
clip.item = "mazehub";
clip.surfaces = addSurfaces(clip.hub, "s", this.objPhysics, 0.9, 0.95, true);
}
if (clip.button) {
clip.item = "button";
clip.state = "off";
clip.disabled = false;
clip.idx = _local3;
clip.hit._visible = false;
}
if (clip.lift) {
clip.item = "lift";
clip.surfaces = addSurfaces(clip.lift, "s", this.objPhysics, 0.9, 0.95, true);
_root.objSounds.registerSources(this.clip.level.choppa, [clip.lift], "ratchet-loop", 700);
}
if (clip.handle) {
clip.item = "handle";
var _local13 = clip.holderToLocal(this.objPhysics.baseClip);
var _local12 = clip.arm.handle.holderToLocal(this.objPhysics.baseClip);
clip.prevAngle = clip.arm._rotation;
clip.mHub = new Mass(_local13.x, _local13.y, 10, true, this.objPhysics, _local3);
clip.mHandle = new Mass(_local12.x, _local12.y, 15, false, this.objPhysics, _local3);
clip.sArm = new Spring(clip.mHub, clip.mHandle);
clip.mHub.isNotWinchable = true;
_root.objSounds.play("ratchet-loop", 0, true);
this.handleClip = clip;
}
if (clip.oven) {
clip.item = "oven";
this.handleClip._y = this.handleClip._y + 340;
this.handleClip.mHub.y = this.handleClip.mHub.y + 340;
this.handleClip.mHandle.y = this.handleClip.mHandle.y + 340;
this.handleClip._visible = false;
this.clip.level.flag._y = this.clip.level.flag._y + 100;
}
if (clip.wave) {
clip.item = "wave";
clip.gotoAndPlay(Maths.randomInt(1, clip._totalframes));
}
_local3++;
clip = this.clip.level["b" + _local3];
}
};
ChoppaGame.prototype.objectsEnterFrame = function () {
if (this.includesBiffo) {
this.doorLeftClosed = false;
this.doorRightClosed = false;
this.biffoInCage = false;
}
this.powerPillFrames--;
if (this.powerPillFrames <= 0) {
this.clip.level.choppa._visible = true;
_root.objSounds.stop("loop-powerpill");
} else if (this.powerPillFrames > 45) {
this.clip.level.choppa._visible = (((this.frame % 10) > 5) ? true : false);
} else {
this.clip.level.choppa._visible = (((this.frame % 4) > 2) ? true : false);
}
var _local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
_local3.inWater = false;
if (_local3.soundFrames > 0) {
_local3.soundFrames--;
if (_local3.soundFrames <= 0) {
_local3.soundFrames = undefined;
}
}
if (((_local3.collisionSound && (_local3.hasHitSurface)) && (_local3.soundFrames == undefined)) && ((_local3.collisionNormal.x > 1) || (_local3.collisionNormal.y > 1))) {
var _local25 = Maths.vectorLength(_local3.collisionNormal.x, _local3.collisionNormal.y);
_root.objSounds.play(_local3.collisionSound, Math.min(100, _local25 * 5));
_local3.soundFrames = 10;
}
_local8++;
}
var _local27 = 0;
var clip = this.clip.level["b" + _local27];
while (clip != undefined) {
switch (clip.item) {
case "harvester" :
var _local12 = clip.harvester.holderToGlobal();
if (this.clip.level.cornHit.hitTest(_local12.x, _local12.y, true)) {
_local8 = 0;
while (_local8 < this.corn.length) {
if (_local12.x > this.corn[_local8].x) {
_local8 = this.corn.length;
} else if (this.corn[_local8].hitTest(_local12.x, _local12.y, false)) {
this.corn[_local8].gotoAndStop("cut");
this.corn.splice(_local8, 1);
_local8--;
_root.objSounds.play("corncut");
if (this.corn.length == 25) {
this.clip.level.flag.slideTo("0", "-130", 1.5, "easeInOutSine");
this.flagAppeared();
}
if (this.corn.length == 0) {
_root.foundSecret();
}
}
_local8++;
}
}
break;
case "eye" :
clip.iris._rotation = Maths.radToDeg(Math.atan2(this.clip.level.choppa._y - clip._y, this.clip.level.choppa._x - clip._x));
break;
case "powerpill" :
if ((!clip.dead) && (this.state == "flight")) {
if (clip.hitTest(this.clip.level.choppa.gfx.main)) {
clip.dead = true;
clip._visible = false;
this.dots--;
this.powerPillFrames = 240;
_root.objSounds.stop("loop-powerpill");
_root.objSounds.play("loop-powerpill", 60, true);
if (this.dots == 0) {
this.clip.level.flag._x = this.clip.level.flag.origX;
this.clip.level.flag._y = this.clip.level.flag.origY;
_root.objGame.flagAppeared();
}
}
}
break;
case "dot" :
if ((!clip.dead) && (this.state == "flight")) {
if (clip.hitTest(this.clip.level.choppa.gfx.main)) {
_root.objSounds.play("pac-dot");
clip.dead = true;
clip._visible = false;
this.dots--;
if (this.dots == 0) {
this.clip.level.flag._x = this.clip.level.flag.origX;
this.clip.level.flag._y = this.clip.level.flag.origY;
_root.objGame.flagAppeared();
}
}
}
break;
case "ghost" :
if (!clip.dead) {
var _local15 = clip.ghost._x - clip.ghost.prevX;
var _local14 = clip.ghost._y - clip.ghost.prevY;
if (_local14 < 0) {
clip.ghost.gotoAndStop("u");
}
if (_local14 > 0) {
clip.ghost.gotoAndStop("d");
}
if (_local15 < 0) {
clip.ghost.gotoAndStop("l");
}
if (_local15 > 0) {
clip.ghost.gotoAndStop("r");
}
clip.ghost.prevX = clip.ghost._x;
clip.ghost.prevY = clip.ghost._Y;
_local12 = this.clip.level.choppa.holderToGlobal();
if (clip.hitTest(_local12.x, _local12.y, true)) {
if (this.powerPillFrames > 0) {
this.ghosts--;
clip.dead = true;
clip.stop();
clip.ghost.gotoAndPlay("dead");
if (this.ghosts == 0) {
this.clip.level.flag._x = this.clip.level.flag.origX;
this.clip.level.flag._y = this.clip.level.flag.origY;
_root.objGame.flagAppeared();
}
} else if (this.state == "flight") {
_local12 = clip.ghost.holderToLocal(this.objPhysics.baseClip);
this.createExplosion(_local12.x, _local12.y, 20, 500);
this.choppaCrashed();
}
}
}
break;
case "cow" :
_local12 = clip.holderToGlobal();
if (this.clip.level.probulator.hit.hitTest(_local12.x, _local12.y, true)) {
clip.inCount++;
} else {
clip.inCount = 0;
}
if (clip.inCount > 45) {
if (clip.objMass.springs.length > 0) {
this.toggleWinch();
}
clip.objMass.removeMass();
this.clip.level.probulator.play();
this.clip.level.flag._x = this.clip.level.flag._x + 1000;
this.flagAppeared();
}
_local12 = this.clip.level.choppa.holderToGlobal();
if (this.clip.level.probulator.hit.hitTest(_local12.x, _local12.y, true)) {
this.clip.level.errorNote._visible = true;
this.clip.level.choppa.inCount++;
} else {
this.clip.level.errorNote._visible = false;
this.clip.level.choppa.inCount = 0;
}
if (this.clip.level.choppa.inCount > 900) {
_root.foundSecret();
}
break;
case "scissors" :
_local12 = clip.f.holderToGlobal();
_local8 = 0;
var _local4 = this.clip.level["b" + _local8];
while (_local4 != undefined) {
if (_local4.item == "hair") {
if ((_local4.cut < 4) && (_local4.hitTest(_local12.x, _local12.y, true))) {
_local4.cut++;
_local4.gotoAndStop("cut" + _local4.cut);
if (_local4.cut >= 4) {
this.clip.level.flag._y = this.clip.level.flag._y - 500;
this.clip.level.b9._x = this.clip.level.b9._x + 500;
this.clip.level.b9._visible = true;
}
}
}
_local8++;
_local4 = this.clip.level["b" + _local8];
}
break;
case "cork" :
_local12 = clip.holderToGlobal();
if (this.clip.level.secretHit.hitTest(_local12.x, _local12.y, true)) {
_root.foundSecret();
}
break;
case "fan" :
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
_local12 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local12);
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
var _local9 = Maths.distance(clip._x, clip._y, _local3.x, _local3.y);
if (_local9 > clip.hit._width) {
_local9 = clip.hit._width;
}
var _local11 = (clip.hit._width - _local9) / clip.hit._width;
_local3.extForceX = _local3.extForceX + ((_local11 * clip.fanStrength) * Math.cos(Maths.degToRad(clip._rotation)));
_local3.extForceY = _local3.extForceY + ((_local11 * clip.fanStrength) * Math.sin(Maths.degToRad(clip._rotation)));
}
_local8++;
}
break;
case "wave" :
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
_local12 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local12);
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
_local3.extForceY = _local3.extForceY - (this.gravity + (0.01 * _local3.radius));
_local3.vx = _local3.vx * 0.95;
_local3.vy = _local3.vy * 0.95;
_local3.inWater = true;
}
_local8++;
}
break;
case "hitchecker" :
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
_local12 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local12);
if (clip.hitTest(_local12.x, _local12.y, true)) {
clip.massTouching(_local3);
}
_local8++;
}
break;
case "secretzone" :
if (this.secretDiscoverable) {
_local12 = this.clip.level.choppa.holderToGlobal();
if (clip.hitTest(_local12.x, _local12.y, true)) {
clip.gotoAndStop("discovered");
this.clip.level.secretAward._visible = true;
_root.foundSecret();
clip.evtTriggered();
}
}
break;
case "button" :
if (((clip.state == "off") && (clip._visible)) && (!clip.disabled)) {
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
_local12 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local12);
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
_root.objSounds.play("switch");
clip.evtTriggered(_local3);
clip.state = "on";
clip.gotoAndStop("on");
}
_local8++;
}
}
break;
case "cannon" :
clip.idleFrames--;
if (clip.idleFrames <= 0) {
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
if (_local3.isChoppa) {
} else if (_local3.isWinch) {
} else {
_local12 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local12);
if (clip.cannon.hitTest(_local12.x, _local12.y, true)) {
_root.objSounds.play("cannon");
clip.cannon.gotoAndPlay("fire");
clip.idleFrames = 45;
_local12 = clip.cannon.launchPoint.holderToLocal(this.objPhysics.baseClip);
_local3.x = _local12.x;
_local3.y = _local12.y;
_local3.vx = 20 * Math.cos(Maths.degToRad(clip.cannon._rotation));
_local3.vy = 20 * Math.sin(Maths.degToRad(clip.cannon._rotation));
if (_local3.springs.length > 0) {
this.toggleWinch();
}
clip.fired++;
this.shake = 30;
}
}
_local8++;
}
}
break;
case "boat" :
if (this.menSaved && (this.boatPositioned >= 2)) {
_root.objGame.flagAppeared();
this.menSaved = false;
this.clip.level.flag._y = this.clip.level.flag._y - 1000;
this.clip.level.flag._alpha = 0;
this.clip.level.flag.fadeIn(0.5);
this.clip.level.sign.gotoAndPlay("done");
}
this.boatPositioned = 0;
break;
case "sheep" :
clip.dirFrames--;
if (clip.dirFrames <= 0) {
clip.dir = Maths.randomNum(-0.3, 0.3);
clip.dirFrames = Maths.randomInt(30, 100);
}
if (clip.objMass.hasHitSurface) {
clip.objMass.extForceX = clip.dir;
}
break;
case "sheeppen" :
var _local16 = 0;
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
if (_local3.isSheep) {
_local12 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local12);
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
_local16++;
}
}
_local8++;
}
clip.sheepDeposited(_local16);
break;
case "platform" :
var _local13 = 0;
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
if (_local3.isSailor) {
_local12 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local12);
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
_local13++;
}
}
_local8++;
}
clip.sailorsDeposited(_local13);
break;
case "hover" :
_local12 = this.clip.level.choppa.holderToGlobal();
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
clip.gotoAndStop("hover");
} else {
clip.gotoAndStop("idle");
}
break;
case "net" :
if (clip.state == "untriggered") {
_local12 = this.clip.level.choppa.holderToGlobal();
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
clip.state = "triggered";
_root.objSounds.play("net-fall");
var _local7 = 0;
while (_local7 < clip.masses.length) {
clip.masses[_local7].fixed = false;
_local7++;
}
}
}
break;
case "bee" :
clip.targetR = clip.targetR + clip.targetDR;
var _local26 = clip.targetX + (clip.targetRadius * Math.cos(clip.targetR));
var _local23 = clip.targetY + (clip.targetRadius * Math.sin(clip.targetR));
var _local15 = clip.objMass.x - _local26;
var _local14 = clip.objMass.y - _local23;
var _local24 = (-_local15) / 70;
var _local22 = (-_local14) / 70;
clip.objMass.extForceX = clip.objMass.extForceX + _local24;
clip.objMass.extForceY = clip.objMass.extForceY + _local22;
break;
case "gravitywell" :
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local6 = this.objPhysics.masses[_local8];
_local15 = _local6.x - clip._x;
_local14 = _local6.y - clip._y;
var _local17 = Maths.vectorLength(_local15, _local14);
_local15 = _local15 / _local17;
_local14 = _local14 / _local17;
_local15 = _local15 * this.gravity;
_local14 = _local14 * this.gravity;
_local6.extForceX = _local6.extForceX - _local15;
_local6.extForceY = _local6.extForceY - _local14;
_local8++;
}
break;
case "mixer" :
if ((this.mRotor.hasHitSurface || (this.mTail.hasHitSurface)) || (this.mCockpit.hasHitSurface)) {
clip.dr = clip.dr - 0.005;
} else {
clip.dr = clip.dr + 0.005;
}
if (clip.dr < 0.1) {
clip.dr = 0.1;
}
if (clip.dr > 0.5) {
clip.dr = 0.5;
}
clip._rotation = clip._rotation + clip.dr;
_local8 = 0;
while (_local8 < clip.surfaces.length) {
clip.surfaces[_local8].removeSurface();
_local8++;
}
clip.surfaces = addSurfaces(clip, "s", this.objPhysics, 0.9, 0.95, true);
break;
case "crushotron" :
_local8 = 0;
while (_local8 < clip.lSurfaces.length) {
clip.lSurfaces[_local8].removeSurface();
_local8++;
}
_local8 = 0;
while (_local8 < clip.rSurfaces.length) {
clip.rSurfaces[_local8].removeSurface();
_local8++;
}
clip.lSurfaces = addSurfaces(clip.l, "s", this.objPhysics, 0.9, 0.95, false);
clip.rSurfaces = addSurfaces(clip.r, "s", this.objPhysics, 0.9, 0.95, false);
break;
case "movingsurface" :
if (clip.stopped) {
clip.stop();
} else {
if (clip.playingBackwards) {
if (clip._currentframe == 1) {
clip.gotoAndStop(clip._totalframes);
} else {
clip.gotoAndStop(clip._currentframe - 1);
}
} else {
clip.play();
}
_local8 = 0;
while (_local8 < clip.surfaces.length) {
clip.surfaces[_local8].removeSurface();
_local8++;
}
clip.surfaces = addSurfaces(clip.hub, "s", this.objPhysics, 0.9, 0.95, true);
}
break;
case "mazehub" :
if (clip._currentframe != clip.lastFrame) {
clip.lastFrame = clip._currentframe;
_local8 = 0;
while (_local8 < clip.surfaces.length) {
clip.surfaces[_local8].removeSurface();
_local8++;
}
clip.surfaces = addSurfaces(clip.hub, "s", this.objPhysics, 0.9, 0.95, false);
}
break;
case "lift" :
_local8 = 0;
while (_local8 < clip.surfaces.length) {
clip.surfaces[_local8].removeSurface();
_local8++;
}
clip.surfaces = addSurfaces(clip.lift, "s", this.objPhysics, 0.9, 0.95, false);
break;
case "sam" :
if (!clip.rocketAway) {
_local12 = this.clip.level.choppa.holderToGlobal();
if (clip.hit.hitTest(_local12.x, _local12.y, true)) {
_root.objSounds.play("sam-launch");
var _local5 = this.clip.level["b" + clip.rocketID];
var _local21 = clip.sam.holderToLocal(this.clip.level.physics);
var _local18 = clip.holderToLocal(this.clip.level.physics);
_local5.objLine.m_f.x = _local21.x;
_local5.objLine.m_f.y = _local21.y;
_local5.objLine.m_b.x = _local18.x;
_local5.objLine.m_b.y = _local18.y;
_local5.objLine.m_f.vx = 0;
_local5.objLine.m_f.vy = 0;
_local5.objLine.m_b.vx = 0;
_local5.objLine.m_b.vy = 0;
_local5.active = true;
_local5._visible = true;
clip.rocketAway = true;
this.rocketsLoose++;
this.rocketAirFrames = 0;
}
}
break;
case "rocket" :
if (clip.active) {
clip.objLine.m_f.extForceY = clip.objLine.m_f.extForceY - this.gravity;
clip.objLine.m_b.extForceY = clip.objLine.m_b.extForceY - this.gravity;
_local15 = clip.objLine.m_f.x - clip.objLine.m_b.x;
_local14 = clip.objLine.m_f.y - clip.objLine.m_b.y;
var _local17 = Maths.vectorLength(_local15, _local14);
_local15 = _local15 / _local17;
_local14 = _local14 / _local17;
clip.objLine.m_f.extForceX = clip.objLine.m_f.extForceX + (_local15 / 6);
clip.objLine.m_f.extForceY = clip.objLine.m_f.extForceY + (_local14 / 6);
clip.objLine.m_b.extForceX = clip.objLine.m_b.extForceX + (_local15 / 4);
clip.objLine.m_b.extForceY = clip.objLine.m_b.extForceY + (_local14 / 4);
_local15 = clip.objLine.m_f.x - this.clip.level.choppa._x;
_local14 = clip.objLine.m_f.y - this.clip.level.choppa._y;
_local17 = Maths.vectorLength(_local15, _local14);
_local15 = _local15 / _local17;
_local14 = _local14 / _local17;
clip.objLine.m_f.extForceX = clip.objLine.m_f.extForceX - (_local15 / 6);
clip.objLine.m_f.extForceY = clip.objLine.m_f.extForceY - (_local14 / 6);
if (this.rocketsLoose == 2) {
this.rocketAirFrames++;
} else {
this.clip.level.clock.gotoAndPlay(1);
}
if ((this.rocketAirFrames == 1800) && (this.state == "flight")) {
_root.foundSecret();
this.clip.level.secret._visible = true;
}
} else {
clip.objLine.m_f.x = clip.objLine.m_f.idleX;
clip.objLine.m_f.y = clip.objLine.m_f.idleY;
clip.objLine.m_b.x = clip.objLine.m_b.idleX;
clip.objLine.m_b.y = clip.objLine.m_b.idleY;
this.clip.level.clock.gotoAndPlay(1);
}
break;
case "duster" :
_local12 = clip.f.holderToGlobal();
_local8 = 0;
_local4 = this.clip.level["b" + _local8];
while (_local4 != undefined) {
if ((_local4.item == "web") && (_local4.hit.hitTest(_local12.x, _local12.y, true))) {
this.cleanWeb(_local4);
}
_local8++;
_local4 = this.clip.level["b" + _local8];
}
break;
case "zombie" :
if (clip.alive) {
if (clip.m_f.hasHitSurface) {
clip.m_b.extForceY = -0.3;
clip.m_b.extForceX = clip.dir * 0.07;
clip.m_f.extForceX = clip.dir * 0.07;
if (Math.random() > 0.99) {
clip.dir = -clip.dir;
}
clip._xscale = 100 * (-clip.dir);
}
if (Math.random() > 0.998) {
_root.objSounds.play("brains", Maths.randomInt(10, 50));
}
if (clip._y > 400) {
clip.die();
}
}
break;
case "ant" :
if (!clip.dead) {
if (clip._x < (this.clip.level.flag._x - 20)) {
clip.dir = 0.4;
}
if (clip._x > (this.clip.level.flag._x + 20)) {
clip.dir = -0.4;
}
if (clip.objMass.hasHitSurface) {
clip.objMass.extForceX = clip.dir;
}
}
_local12 = clip.holderToGlobal();
if ((!clip.dead) && (this.clip.level.fire.hitTest(_local12.x, _local12.y, true))) {
if (clip.objMass.springs.length > 0) {
this.toggleWinch();
}
clip.dead = true;
clip.fadeOut(0.3);
clip.objMass.removeMass();
this.clip.level.flag._y = this.clip.level.flag._y - 150;
this.antCount--;
_root.objSounds.play("ant-burn");
this.clip.level.kill_it.nextFrame();
if (this.antCount == 0) {
this.clip.level.ruined.gotoAndPlay("saved");
this.clip.level.b6._visible = true;
this.flagAppeared();
this.secretDiscoverable = true;
_root.showDelayedRef();
}
}
break;
case "pheasant" :
if (!clip.dead) {
if ((clip.objMass.springs.length > 0) || (clip.objMass.hasHitSurface)) {
clip.flying = 0;
} else {
clip.flying++;
}
clip.gotoAndStop(((clip.flying > 15) ? "flying" : "idle"));
_local12 = clip.holderToGlobal();
if ((clip.objMass.vx > 7) && (this.clip.level.birdTarget.hit.hitTest(_local12.x, _local12.y, true))) {
clip.dead = true;
clip.objMass.removeMass();
clip.fadeOut(0.3);
this.clip.level.birdTarget.nextFrame();
this.targetHitCount--;
if (this.targetHitCount == 0) {
this.objPhysics.surfaces[9].removeSurface();
this.clip.level.noFly.fadeOut(0.7);
if (this.clip.level.b1.fired == 0) {
_root.foundSecret();
}
}
}
}
break;
case "puzzlepiece" :
if (!clip.dead) {
if (Maths.distance(clip._x, clip._y, clip.template._x, clip.template._y) < 25) {
if (clip.objMass.springs.length > 0) {
this.toggleWinch();
}
clip.objMass.removeMass();
clip.template.fadeOut(0.3);
clip.slideTo(clip.template._x, clip.template._y, 0.3, "easeInOutSine");
_root.objSounds.play("puzzle-snap");
this.placedPieces++;
this.clip.level.flag._y = this.clip.level.flag._y - 130;
this.clip.level.b6._y = this.clip.level.b6._y - 130;
this.clip.level.b6._visible = true;
if (this.placedPieces == 6) {
this.flagAppeared();
_root.showDelayedRef();
}
clip.swapDepths(clip.template.getDepth());
clip.dead = true;
}
}
break;
case "word" :
if (!this.clip.level.divider.gone) {
var _local10 = true;
if (!this.massIsTouching(this.clip.level.b0.m_b, this.clip.level.h1)) {
_local10 = false;
}
if (!this.massIsTouching(this.clip.level.b0.m_f, this.clip.level.h2)) {
_local10 = false;
}
if (!this.massIsTouching(this.clip.level.b1.m_b, this.clip.level.h3)) {
_local10 = false;
}
if (!this.massIsTouching(this.clip.level.b1.m_f, this.clip.level.h4)) {
_local10 = false;
}
if (!this.massIsTouching(this.clip.level.b2.m_b, this.clip.level.h5)) {
_local10 = false;
}
if (!this.massIsTouching(this.clip.level.b2.m_f, this.clip.level.h6)) {
_local10 = false;
}
if (_local10) {
_root.objSounds.play("gate-unlock");
this.clip.level.divider.gone = true;
this.clip.level.divider.fadeOut();
this.objPhysics.surfaces[15].removeSurface();
}
}
break;
case "spanner" :
if (this.isDoomsday) {
if (Math.random() > 0.7) {
this.createExplosion(this.clip.level.choppa._x + Maths.randomNum(-300, 300), this.clip.level.choppa._y + Maths.randomNum(-250, 250), 10, 250);
}
}
break;
case "fuse" :
if (!clip.idle) {
_local12 = clip.spark.holderToGlobal();
_local8 = 0;
while (_local8 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local8];
if (((_local3.clip.item == "firework") && (!_local3.clip.spent)) && (_local3.clip.hitTest(_local12.x, _local12.y, true))) {
_local3.clip.gotoAndStop("spent");
_local3.clip.spent = true;
_root.addFirework(this.clip.level.drawing, _local3.clip.firework);
this.fireworks--;
this.noMoreFuses = true;
this.clip.level.flag.slideTo(this.clip.level.flag.origX, this.clip.level.flag.origY, 1.5, "easeInOutSine", 2);
_root.objGame.flagAppeared();
if (this.fireworks == 0) {
_root.foundSecret();
}
}
_local8++;
}
}
break;
case "biffo" :
if (clip.idle && (!this.biffoCalm)) {
if (Math.random() > 0.995) {
_root.objSounds.play("biffobark1");
}
if ((clip._y < this.clip.level.choppa._y) || (clip._y > 170)) {
clip.objMass.extForceY = -5;
clip.objMass.extForceX = ((clip._x > this.clip.level.choppa._x) ? 3 : -3);
if (clip._x < -130) {
clip.objMass.extForceX = 3;
}
if (clip._x > 960) {
clip.objMass.extForceX = -3;
}
if (clip._y < -430) {
clip.objMass.extForceY = 0;
}
clip._xscale = ((clip.objMass.vx > 0) ? 100 : -100);
clip.gotoAndPlay("flap");
} else {
clip.objMass.extForceX = ((clip._x > this.clip.level.choppa._x) ? 0.2 : -0.2);
if (clip._x < -130) {
clip.objMass.extForceX = 0.2;
}
if (clip._x > 960) {
clip.objMass.extForceX = -0.2;
}
clip._xscale = ((clip.objMass.vx > 0) ? 100 : -100);
}
}
clip.objMass.vx = clip.objMass.vx * 0.94;
clip.objMass.vy = clip.objMass.vy * 0.94;
}
_local27++;
clip = this.clip.level["b" + _local27];
}
if (this.includesBiffo) {
this.clip.level.flag._y = this.clip.level.flag.origY + 130;
if (this.biffoInCage) {
this.clip.level.flag._y = this.clip.level.flag._y - 130;
this.flagAppeared();
if (this.doorLeftClosed && (this.doorRightClosed)) {
this.biffoCalm = true;
_root.foundSecret();
}
}
}
};
ChoppaGame.prototype.paintItems = function () {
var _local18 = 0;
var _local3 = this.clip.level["b" + _local18];
while (_local3 != undefined) {
switch (_local3.item) {
case "oneton" :
var _local10 = _local3.objBox.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg + 90;
break;
case "magnet" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg + 180;
break;
case "cork" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg + 90;
break;
case "duster" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
break;
case "cagedoor" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
break;
case "zombie" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg - 90;
break;
case "chip" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
break;
case "sponge" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
break;
case "word" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
break;
case "spanner" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
break;
case "harvester" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg + 13;
break;
case "caravel" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
break;
case "scissors" :
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
_local3.gotoAndStop("chopping");
break;
case "ball" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "firework" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "biffo" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "van" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "bridgepart" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "fan" :
if (_local3.mobileFan) {
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
}
break;
case "cog" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
if (_local3.attached) {
_local3._rotation = _local3._rotation + _local3.speed;
}
break;
case "donkey" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "cow" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "puzzlepiece" :
if (!_local3.dead) {
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
}
break;
case "sailor" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "sheep" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
_local3._xscale = ((_local3.dir >= 0) ? -100 : 100);
break;
case "ant" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
_local3._xscale = ((_local3.dir >= 0) ? 100 : -100);
break;
case "pheasant" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "bee" :
_local3._x = _local3.objMass.x;
_local3._y = _local3.objMass.y;
break;
case "rocket" :
if (_local3.active) {
_local10 = _local3.objLine.getPosition();
_local3._x = _local10.x;
_local3._y = _local10.y;
_local3._rotation = _local10.rDeg;
}
break;
case "net" :
this.clip.level.drawing.lineStyle(12, 16737792, 100);
this.clip.level.drawing.moveTo(_local3.masses[0].x, _local3.masses[0].y);
var _local7 = 1;
while (_local7 < _local3.masses.length) {
this.clip.level.drawing.lineTo(_local3.masses[_local7].x, _local3.masses[_local7].y);
_local7++;
}
break;
case "gootower" :
var _local11 = 0;
while (_local11 < _local3.masses.length) {
var _local9 = _local3.masses[_local11];
_local9.gooClip._x = _local9.x;
_local9.gooClip._y = _local9.y;
var _local4 = 0;
while (_local4 < _local9.springs.length) {
var _local6 = _local9.springs[_local4].mass1;
var _local5 = _local9.springs[_local4].mass2;
if ((!_local6.isGoo) || (!_local5.isGoo)) {
} else {
this.clip.level.drawing.lineStyle(9, 16737792, 100);
this.clip.level.drawing.moveTo(_local6.x, _local6.y);
this.clip.level.drawing.lineTo(_local5.x, _local5.y);
}
_local4++;
}
_local11++;
}
break;
case "boat" :
this.clip.level.drawing.lineStyle(9, 0, 100);
this.clip.level.drawing.beginFill(16737792, 100);
this.clip.level.drawing.moveTo(_local3.m0.x, _local3.m0.y);
this.clip.level.drawing.lineTo(_local3.m1.x, _local3.m1.y);
this.clip.level.drawing.lineTo(_local3.m2.x, _local3.m2.y);
this.clip.level.drawing.lineTo(_local3.m3.x, _local3.m3.y);
this.clip.level.drawing.lineTo(_local3.m4.x, _local3.m4.y);
this.clip.level.drawing.lineTo(_local3.m5.x, _local3.m5.y);
this.clip.level.drawing.lineTo(_local3.m6.x, _local3.m6.y);
this.clip.level.drawing.lineTo(_local3.m0.x, _local3.m0.y);
this.clip.level.drawing.endFill();
_local10 = _local3.plaque.getPosition();
this.clip.level.hmsFragile._x = _local10.x;
this.clip.level.hmsFragile._y = _local10.y;
this.clip.level.hmsFragile._rotation = _local10.rDeg + 180;
break;
case "handle" :
var _local16 = _local3.mHandle.x - _local3.mHub.x;
var _local15 = _local3.mHandle.y - _local3.mHub.y;
var _local17 = Math.atan2(_local15, _local16) - (Math.PI/2);
var _local12 = Maths.radToDeg(_local17);
_local3.arm._rotation = _local12;
_local3.arm.handle._rotation = -_local12;
var _local8 = _local3.prevAngle - _local3.arm._rotation;
if (_local8 < -100) {
_local8 = 0;
}
if (_local8 < -5) {
_local8 = -5;
}
if (_local8 > 100) {
_local8 = 0;
}
if (_local8 > 5) {
_local8 = 5;
}
_root.objSounds.volume("ratchet-loop", Math.abs(20 * _local8));
_local3.angleChanged(_local8);
_local3.prevAngle = _local3.arm._rotation;
break;
case "oven" :
_local11 = 0;
for(;;){
if (_local11 >= this.objPhysics.masses.length) {
break;
}
var _local9 = this.objPhysics.masses[_local11];
if (_local9.clip.ingredient == undefined) {
} else {
_local10 = {x:_local9.x, y:_local9.y};
this.clip.level.physics.localToGlobal(_local10);
if (_local3.hit.hitTest(_local10.x, _local10.y, true)) {
_local3.hit.evtItemHit(_local9.clip);
}
}
_local11++;
};
}
_local18++;
_local3 = this.clip.level["b" + _local18];
}
};
ChoppaGame.prototype.pauseObjects = function () {
var _local3 = 0;
var _local2 = this.clip.level["b" + _local3];
while (_local2 != undefined) {
switch (_local2.item) {
case "ghost" :
case "lift" :
case "wave" :
case "crushotron" :
case "movingsurface" :
_local2.stop();
}
_local3++;
_local2 = this.clip.level["b" + _local3];
}
};
ChoppaGame.prototype.unpauseObjects = function () {
var _local3 = 0;
var _local2 = this.clip.level["b" + _local3];
while (_local2 != undefined) {
switch (_local2.item) {
case "lift" :
if (_local2._currentframe < _local2._totalframes) {
_local2.play();
}
break;
case "ghost" :
case "wave" :
case "crushotron" :
_local2.play();
}
_local3++;
_local2 = this.clip.level["b" + _local3];
}
};
ChoppaGame.prototype.makeGooTower = function (clip, stories, separation, k, d) {
this.towerTouched = false;
clip.masses = [];
clip.b0._visible = false;
clip.b1._visible = false;
var _local9 = clip.b0.holderToLocal(this.clip.level.physics);
var _local8 = clip.b1.holderToLocal(this.clip.level.physics);
var _local7 = new Mass(_local9.x, _local9.y, 19, true, this.objPhysics, -1);
var _local6 = new Mass(_local8.x, _local8.y, 19, true, this.objPhysics, -1);
_local7.isGoo = true;
_local6.isGoo = true;
clip.masses.push(_local7);
clip.masses.push(_local6);
var _local15 = this.clip.level.physics.getNextHighestDepth();
var _local5 = 0;
while (_local5 < stories) {
_local9.y = _local9.y - separation;
_local8.y = _local8.y - separation;
var _local3 = new Mass(_local9.x, _local9.y, 19, false, this.objPhysics, _local15);
var _local2 = new Mass(_local8.x, _local8.y, 19, false, this.objPhysics, _local15);
_local3.mass = 2;
_local2.mass = 2;
_local3.isGoo = true;
_local2.isGoo = true;
_local3.collisionSound = "bee-squish";
_local2.collisionSound = "bee-squish";
var _local4 = this.clip.level.drawing.getNextHighestDepth();
this.clip.level.drawing.attachMovie("gooball", "gooball" + _local4, _local4);
var _local14 = this.clip.level.drawing["gooball" + _local4];
_local4 = this.clip.level.drawing.getNextHighestDepth();
this.clip.level.drawing.attachMovie("gooball", "gooball" + _local4, _local4);
var _local13 = this.clip.level.drawing["gooball" + _local4];
_local3.gooClip = _local14;
_local2.gooClip = _local13;
_local3.objGame = this;
_local2.objGame = this;
_local3.collisionCallback = function (otherMass) {
if (otherMass.isChoppa) {
this.objGame.towerTouched = true;
}
};
_local2.collisionCallback = function (otherMass) {
if (otherMass.isChoppa) {
this.objGame.towerTouched = true;
}
};
_local3.gooClip._x = _local3.x;
_local3.gooClip._y = _local3.y;
_local2.gooClip._x = _local2.x;
_local2.gooClip._y = _local2.y;
_local3.gooClip._rotation = Maths.randomInt(-20, 20);
_local2.gooClip._rotation = Maths.randomInt(-20, 20);
var _local16 = new Spring(_local3, _local2, this.objPhysics, k, d);
_local16 = new Spring(_local3, _local6, this.objPhysics, k, d);
_local16 = new Spring(_local7, _local2, this.objPhysics, k, d);
_local16 = new Spring(_local3, _local7, this.objPhysics, 0.6, 0.4);
_local16 = new Spring(_local2, _local6, this.objPhysics, 0.6, 0.4);
clip.masses.push(_local3);
clip.masses.push(_local2);
_local7 = _local3;
_local6 = _local2;
_local5++;
}
this.gooTop1 = _local7.gooClip;
this.gooTop2 = _local6.gooClip;
};
ChoppaGame.prototype.checkItemsExplosion = function (p) {
var _local5 = 0;
var _local2 = this.clip.level["b" + _local5];
while (_local2 != undefined) {
switch (_local2.item) {
case "web" :
if (_local2.hit.hitTest(p.x, p.y, true)) {
this.cleanWeb(_local2);
}
break;
case "zombie" :
var _local3 = _local2.holderToGlobal();
if (!(_local2.alive && (Maths.distance(p.x, p.y, _local3.x, _local3.y) < 130))) {
break;
}
_local2.die();
}
_local5++;
_local2 = this.clip.level["b" + _local5];
}
};
ChoppaGame.prototype.raiseHandle = function () {
this.handleClip._visible = true;
this.handleClip.slideTo("0", "-340", 1.5, "easeInOutSine", 0, function () {
_root.objGame.handleClip.mHub.y = _root.objGame.handleClip.mHub.y - 340;
_root.objGame.handleClip.mHandle.y = _root.objGame.handleClip.mHandle.y - 340;
});
this.clip.level.b1.gotoAndStop("raise");
};
ChoppaGame.prototype.handleComplete = function () {
this.clip.level.flag.slideTo("0", "-100", 1.5, "easeInOutSine");
_root.objGame.flagAppeared();
};
ChoppaGame.prototype.sortOnX = function (a, b) {
return(a.x > b.x);
};
ChoppaGame.prototype.cleanWeb = function (web) {
if (web.cleaned) {
return(undefined);
}
_root.objSounds.play("cobweb");
web.cleaned = true;
web.fadeOut(0.75);
this.webCount--;
if (this.webCount == 0) {
this.clip.level.windowOpen._visible = true;
var _local4 = this.objPhysics.surfaces[5];
_local4.removeSurface();
this.clip.level.exitBlock.fadeOut(0.5);
_local4 = this.objPhysics.surfaces[1];
_local4.removeSurface();
_root.objSounds.play("gate-unlock");
}
};
ChoppaGame.prototype.checkDonkey = function (objMass) {
var _local3 = objMass.clip;
if ((!_local3) || (!_local3.donkey)) {
return(undefined);
}
if (_local3.thisOne) {
if (objMass.springs.length > 0) {
this.toggleWinch();
}
objMass.removeMass();
_local3.dead = true;
_local3.thisOne = false;
_local3.fadeOut(0.5);
this.clip.level.joke.play();
var _local4 = this.clip.level["b" + (_local3.id + 1)];
switch (_local3.id) {
case 0 :
_local4.gotoAndStop("winky");
_local4.thisOne = true;
break;
case 1 :
_local4.gotoAndStop("stinky");
_local4.thisOne = true;
break;
case 2 :
_local4.thisOne = true;
this.clip.level.flag._y = this.clip.level.flag.origY;
this.flagAppeared();
break;
case 3 :
_root.secretFound();
}
} else {
this.clip.level.error.gotoAndPlay("error");
}
};
ChoppaGame.prototype.massIsTouching = function (objMass, clip) {
var _local2 = {x:objMass.x, y:objMass.y};
this.objPhysics.baseClip.localToGlobal(_local2);
if (clip.hitTest(_local2.x, _local2.y, true)) {
return(true);
}
return(false);
};
ChoppaGame.prototype.stopDoomsday = function () {
if (this.isDoomsday) {
return(undefined);
}
_root.objGame.flagAppeared();
this.clip.level.flag.slideTo("0", "-130", 0.75, "easeInOutSine");
this.clip.level.doomsdayMachine.stop();
this.clip.level.doomsdayMachine.hand.stop();
this.objPhysics.surfaces[18].collisionSet = -351;
this.clip.level.disposal._visible = true;
_root.objSounds.stop("loop-countdown");
};
ChoppaGame.prototype.doomsdayNow = function () {
this.choppaCrashed();
this.isDoomsday = true;
};
ChoppaGame.prototype.paintedItem = function (item) {
item.play();
this.paintedItems++;
_root.objSounds.play("paintsplat");
if (this.paintedItems == 3) {
this.clip.level.flag.slideTo("0", "-130", 0.75, "easeInOutSine");
this.flagAppeared();
this.clip.level.raven._visible = true;
}
if (this.paintedItems == 4) {
_root.foundSecret();
}
};
ChoppaGame.prototype.evt = function () {
};
ChoppaGame.prototype.OXOreset = function () {
var _local4 = this.clip.level;
_root.objSounds.play("oxo-reset");
_local4.oxoScreen.gotoAndStop(1);
var _local3 = 0;
while (_local3 < 9) {
_local4["b" + _local3].gotoAndStop("off");
_local4["b" + _local3]._visible = true;
_local4["b" + _local3].disabled = false;
_local4.oxoBot["b" + _local3].gotoAndStop("idle");
_local4.oxoScreen["b" + _local3].gotoAndStop("idle");
_local3++;
}
this.winner = ".";
this.playerWon = false;
this.cpuWon = false;
this.moves = 0;
this.board = [".", ".", ".", ".", ".", ".", ".", ".", "."];
this.takeTurn(true);
};
ChoppaGame.prototype.makeMove = function (moveID) {
this.moves++;
var _local6 = this.clip.level.b10.holderToGlobal();
var _local7 = (this.clip.level.dbHome.hitTest(_local6.x, _local6.y, true) ? true : false);
var _local5 = this.clip.level;
_local5.b11.gotoAndStop("off");
_local5.oxoBot["b" + moveID].gotoAndStop("x");
_local5.oxoScreen["b" + moveID].gotoAndStop("x");
this.board[moveID] = "x";
this.checkWin();
if (!this.playerWon) {
if (this.moves >= 9) {
this.clip.level.oxoBot.txt.text = "DRAW: NO FLAG FOR YOU";
return(undefined);
}
var _local3 = 0;
while (_local3 < 9) {
this.clip.level["b" + _local3].disabled = true;
_local3++;
}
setTimeout(this, "takeTurn", 3000);
var _local4 = ["A FOOL'S MOVE", "FOOLISH. YOU'LL SOON SEE", "THAT'LL NEVER WORK", "TERRIBLE MOVE", "WHAT ARE YOU THINKING?", "OXOBOT WILL DEFEAT YOU!", "PLAYING INTO MY PLAN", "TRY TO GET THREE IN A ROW", "OXOBOT IS THE GREATEST", "IS THAT ALL YOU'VE GOT?", "COME ON, IS THAT YOUR BEST?", "AT LEAST TRY TO BE CLEVER", "YOU DON'T STAND A CHANCE"];
if (!_local7) {
_local4 = ["UMMM...", "ERM...", "WHAT TO DO, WHAT TO DO", "THINKING...", "COMPUTING, PLEASE WAIT", "CAN I PHONE A FRIEND?", "DBLOOKUP: ERROR! ERROR! ERROR!", "UM, CALL IT A DRAW?", "HEY, SOMETHING'S NOT RIGHT", "WHAT'S GOING ON?", "IT'S SO HARD TO THINK", "I'M SURE THIS USED TO BE EASIER", "ARE YOU SURE YOU'RE NOT CHEATING?", "THIS USUALLY GOES BETTER", "MAYBE IF I...", "PERHAPS I SHOULD, UM", "OXOBOT BRAIN ERROR", "OXOBOT THINKY FAILURE", "OXOBOT INTELLIGENCE FAIL"];
}
this.clip.level.oxoBot.txt.text = _local4[_root.Maths.randomInt(0, _local4.length - 1)];
}
};
ChoppaGame.prototype.takeTurn = function (silent) {
this.moves++;
var _local8 = this.clip.level.b10.holderToGlobal();
var _local7 = (this.clip.level.dbHome.hitTest(_local8.x, _local8.y, true) ? true : false);
var _local10 = this.clip.level;
var _local9 = this.board.join("");
var _local3 = -1;
var _local4 = 0;
while (_local4 < 9) {
if (this.wouldWinFor("o", _local4)) {
_local3 = _local4;
trace("found win at " + _local4);
silent = true;
}
_local4++;
}
if ((_local3 == -1) && (_local7)) {
_local4 = 0;
while (_local4 < 9) {
if (this.wouldWinFor("x", _local4)) {
_local3 = _local4;
trace("blocking at " + _local4);
}
_local4++;
}
}
if ((_local3 == -1) && (_local7)) {
switch (_local9) {
case "........." :
_local3 = 0;
break;
case "ox......." :
_local3 = 6;
break;
case "o.x......" :
_local3 = 6;
break;
case "o..x....." :
_local3 = 2;
break;
case "o...x...." :
_local3 = 8;
break;
case "o....x..." :
_local3 = 2;
break;
case "o.....x.." :
_local3 = 2;
break;
case "o......x." :
_local3 = 6;
break;
case "o.......x" :
_local3 = 6;
break;
case "ox.x..o.." :
_local3 = 8;
break;
case "o.xx..o.." :
_local3 = 8;
break;
case "oxox....." :
_local3 = 8;
break;
case "oxo..x..." :
_local3 = 6;
break;
case "oxo...x.." :
_local3 = 8;
break;
case "o..x..ox." :
_local3 = 2;
break;
case "o..x..o.x" :
_local3 = 2;
break;
default :
trace(("No DB response found for \"" + _local9) + "\"");
}
}
if (_local3 == -1) {
var _local5 = [];
_local4 = 0;
while (_local4 < 9) {
if (this.board[_local4] == ".") {
_local5.push(_local4);
}
_local4++;
}
if (_local5.length <= 0) {
return(undefined);
}
_local3 = _local5[Maths.randomInt(0, _local5.length - 1)];
trace("Selecting random move " + _local3);
}
_local10.oxoBot["b" + _local3].gotoAndStop("o");
_local10.oxoScreen["b" + _local3].gotoAndStop("o");
this.board[_local3] = "o";
this.checkWin();
if (this.winner != ".") {
return(undefined);
}
if (this.moves >= 9) {
this.clip.level.oxoBot.txt.text = "DRAW: NO FLAG FOR YOU";
return(undefined);
}
if (!silent) {
_root.objSounds.play("oxo");
}
setTimeout(this, "showOXObuttons", 1500);
};
ChoppaGame.prototype.showOXObuttons = function () {
var _local2 = 0;
while (_local2 < 9) {
if (this.board[_local2] == ".") {
this.clip.level["b" + _local2]._visible = true;
this.clip.level["b" + _local2].disabled = false;
} else {
this.clip.level["b" + _local2]._visible = false;
}
_local2++;
}
};
ChoppaGame.prototype.wouldWinFor = function (side, pos) {
if (this.board[pos] != ".") {
return(false);
}
switch (pos) {
case 0 :
if ((this.board[1] == side) && (this.board[2] == side)) {
return(true);
}
if ((this.board[3] == side) && (this.board[6] == side)) {
return(true);
}
if ((this.board[4] == side) && (this.board[8] == side)) {
return(true);
}
break;
case 1 :
if ((this.board[0] == side) && (this.board[2] == side)) {
return(true);
}
if ((this.board[4] == side) && (this.board[7] == side)) {
return(true);
}
break;
case 2 :
if ((this.board[0] == side) && (this.board[1] == side)) {
return(true);
}
if ((this.board[5] == side) && (this.board[8] == side)) {
return(true);
}
if ((this.board[4] == side) && (this.board[6] == side)) {
return(true);
}
break;
case 3 :
if ((this.board[4] == side) && (this.board[5] == side)) {
return(true);
}
if ((this.board[0] == side) && (this.board[6] == side)) {
return(true);
}
break;
case 4 :
if ((this.board[0] == side) && (this.board[8] == side)) {
return(true);
}
if ((this.board[2] == side) && (this.board[6] == side)) {
return(true);
}
if ((this.board[1] == side) && (this.board[7] == side)) {
return(true);
}
if ((this.board[3] == side) && (this.board[5] == side)) {
return(true);
}
break;
case 5 :
if ((this.board[3] == side) && (this.board[4] == side)) {
return(true);
}
if ((this.board[2] == side) && (this.board[8] == side)) {
return(true);
}
break;
case 6 :
if ((this.board[0] == side) && (this.board[3] == side)) {
return(true);
}
if ((this.board[7] == side) && (this.board[8] == side)) {
return(true);
}
if ((this.board[2] == side) && (this.board[4] == side)) {
return(true);
}
break;
case 7 :
if ((this.board[1] == side) && (this.board[4] == side)) {
return(true);
}
if ((this.board[6] == side) && (this.board[8] == side)) {
return(true);
}
break;
case 8 :
if ((this.board[6] == side) && (this.board[7] == side)) {
return(true);
}
if ((this.board[2] == side) && (this.board[5] == side)) {
return(true);
}
if (!((this.board[0] == side) && (this.board[4] == side))) {
break;
}
return(true);
}
};
ChoppaGame.prototype.checkWin = function () {
this.playerWon = false;
this.cpuWon = false;
if (((this.board[0] == this.board[1]) && (this.board[0] == this.board[2])) && (this.board[0] != ".")) {
this.OXOwin(this.board[0], 2);
}
if (((this.board[3] == this.board[4]) && (this.board[3] == this.board[5])) && (this.board[3] != ".")) {
this.OXOwin(this.board[3], 3);
}
if (((this.board[6] == this.board[7]) && (this.board[6] == this.board[8])) && (this.board[6] != ".")) {
this.OXOwin(this.board[6], 4);
}
if (((this.board[0] == this.board[3]) && (this.board[0] == this.board[6])) && (this.board[0] != ".")) {
this.OXOwin(this.board[0], 5);
}
if (((this.board[1] == this.board[4]) && (this.board[1] == this.board[7])) && (this.board[1] != ".")) {
this.OXOwin(this.board[1], 6);
}
if (((this.board[2] == this.board[5]) && (this.board[2] == this.board[8])) && (this.board[2] != ".")) {
this.OXOwin(this.board[2], 7);
}
if (((this.board[0] == this.board[4]) && (this.board[0] == this.board[8])) && (this.board[0] != ".")) {
this.OXOwin(this.board[0], 8);
}
if (((this.board[2] == this.board[4]) && (this.board[2] == this.board[6])) && (this.board[2] != ".")) {
this.OXOwin(this.board[2], 9);
}
};
ChoppaGame.prototype.OXOwin = function (winningSide, lineFrame) {
var _local4 = this.clip.level.b10.holderToGlobal();
var _local6 = (this.clip.level.dbHome.hitTest(_local4.x, _local4.y, true) ? true : false);
this.clip.level.oxoScreen.gotoAndStop(lineFrame);
this.winner = winningSide;
if (winningSide == "x") {
this.playerWon = true;
}
if (winningSide == "o") {
this.cpuWon = true;
}
var _local3 = 0;
while (_local3 < 9) {
this.clip.level["b" + _local3]._visible = false;
_local3++;
}
if (this.playerWon) {
_root.objSounds.play("oxo-lose");
this.clip.level.flag.slideTo("0", "-130", 0.75, "easeInOutSine");
this.clip.level.note.nextFrame();
this.clip.level.b11._visible = false;
if (_local6) {
this.clip.level.oxoBot.txt.text = "SELF DIAGNOSTICS TEST PASS";
_root.foundSecret();
} else {
this.clip.level.oxoBot.txt.text = "OXOBOT SMELLS A RAT...";
}
this.clip.level.b9.gotoAndPlay("beaten");
this.consecutiveWins = 0;
}
if (this.cpuWon) {
_root.objSounds.play("oxo-win");
this.consecutiveWins++;
var _local5 = ["OXOBOT WINS AGAIN", "YOU FAIL HARD!", "OXOBOT WIN ALERT!", "IN YOUR FACE, HUMAN", "THE SUPERIOR BRAIN WON", "PLEASE DON'T CRY", "YOU CAN'T HELP BEING DIM", "I'M HAPPY I'M NOT YOU", "MAGNIFICANT OXOBOT VICTORY", "OXOBOT KICKED YOUR BUTT", "I'M TOO GOOD. GIVE UP", "ERROR: SMUGNESS OVERFLOW", "404 GRACIOUSNESS NOT FOUND"];
this.clip.level.oxoBot.txt.text = _local5[_root.Maths.randomInt(0, _local5.length - 1)];
}
this.clip.level.txtWins.text = "CONSECUTIVE WINS: " + Maths.formatNum(this.consecutiveWins, 6);
};
Classic.prototype.initialise = function () {
this.maxCollisionSpeed = 14;
this.choppaBrokenFrames = 0;
this.standardIdle = 0.3;
this.standardThrottle = 1.2;
this.winchIdle = 0.3;
this.winchThrottle = 1.2;
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
this.throttleLiftLow = this.standardThrottle * 0.6;
this.torque = 0.04;
this.bladeFrames = 10;
this.choppa.gotoAndStop(this.vehicleID);
var _local4 = this.choppa.gfx.rotor.holderToLocal(this.clip);
var _local3 = this.choppa.gfx.tail.holderToLocal(this.clip);
var _local2 = this.choppa.gfx.cockpit.holderToLocal(this.clip);
this.mRotor = new Mass(_local4.x, _local4.y, 16, false, this.objPhysics, -1);
this.mTail = new Mass(_local3.x, _local3.y, 13, false, this.objPhysics, -1);
this.mCockpit = new Mass(_local2.x, _local2.y, 30, false, this.objPhysics, -1);
this.mRotor.isChoppa = true;
this.mTail.isChoppa = true;
this.mCockpit.isChoppa = true;
this.slChassis = makeSpringLine(this.mTail, this.mCockpit);
this.slFront = makeSpringLine(this.mRotor, this.mCockpit);
this.slBack = makeSpringLine(this.mRotor, this.mTail);
var _local5 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local5.rDeg;
};
Classic.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
var _local9 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinchA.x = _local9.x;
this.mWinchA.y = _local9.y;
this.mRotor.extForceX = 0;
this.mRotor.extForceY = 0;
this.mCockpit.extForceX = 0;
this.mCockpit.extForceY = 0;
this.mTail.extForceX = 0;
this.mTail.extForceY = 0;
var _local10 = Maths.degToRad(this.choppa._rotation - 90);
var _local8 = Math.cos(_local10);
var _local7 = Math.sin(_local10);
var _local5 = this.objPhysics.gravityX;
var _local4 = this.objPhysics.gravityY;
if (this.gravityCentreX != undefined) {
_local5 = this.gravityCentreX - this.choppa._x;
_local4 = this.gravityCentreY - this.choppa._y;
}
var _local6 = Maths.vectorLength(_local5, _local4);
if (_local6 == 0) {
_local6 = 1;
}
_local5 = _local5 / _local6;
_local4 = _local4 / _local6;
thrustX = _local5 * (-this.idleLift);
thrustY = _local4 * (-this.idleLift);
if (vertical < 0) {
thrustY = thrustY - this.throttleLift;
}
if (vertical > 0) {
thrustY = thrustY + this.idleLift;
}
if (horizontal < 0) {
thrustX = thrustX - this.throttleLiftLow;
}
if (horizontal > 0) {
thrustX = thrustX + this.throttleLiftLow;
}
thrustX = thrustX / 3;
thrustY = thrustY / 3;
this.mRotor.extForceX = this.mRotor.extForceX + (thrustX * 1.3);
this.mRotor.extForceY = this.mRotor.extForceY + thrustY;
this.mCockpit.extForceX = this.mCockpit.extForceX + thrustX;
this.mCockpit.extForceY = this.mCockpit.extForceY + thrustY;
this.mTail.extForceX = this.mTail.extForceX + thrustX;
this.mTail.extForceY = this.mTail.extForceY + thrustY;
var _local3 = 0;
var _local13 = Maths.dotProduct(_local5, _local4, -_local7, _local8);
_local3 = _local3 + (5 * _local13);
if (pitch < 0) {
_local3 = _local3 + (5 + ((this.leftCount++) / 10));
} else {
this.leftCount = 0;
}
if (pitch > 0) {
_local3 = _local3 - (5 + ((this.rightCount++) / 10));
} else {
this.rightCount = 0;
}
this.mCockpit.extForceX = this.mCockpit.extForceX + ((_local8 * _local3) * this.torque);
this.mCockpit.extForceY = this.mCockpit.extForceY + ((_local7 * _local3) * this.torque);
this.mTail.extForceX = this.mTail.extForceX - ((_local8 * _local3) * this.torque);
this.mTail.extForceY = this.mTail.extForceY - ((_local7 * _local3) * this.torque);
this.bladeFrames--;
if (this.bladeFrames <= 0) {
this.bladeFrames = 6;
if (((vertical != 0) || (horizontal != 0)) || (pitch != 0)) {
this.bladeFrames = 4;
}
_root.objSounds.play("blade");
}
};
Classic.prototype.paint = function () {
var _local2 = this.slFront.getPosition();
this.choppa._x = this.mRotor.x;
this.choppa._y = this.mRotor.y;
this.choppa._rotation = _local2.rDeg + this.choppaRotationOffset;
};
Classic.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mCockpit.hasHitSurface) {
var _local7 = Maths.vectorLength(this.mCockpit.collisionNormal.x, this.mCockpit.collisionNormal.y);
if (_local7 > _local2) {
_local2 = _local7;
}
}
if (this.mTail.hasHitSurface) {
var _local7 = Maths.vectorLength(this.mTail.collisionNormal.x, this.mTail.collisionNormal.y);
if (_local7 > _local2) {
_local2 = _local7;
}
}
if (this.mRotor.hasHitSurface) {
var _local7 = Maths.vectorLength(this.mRotor.collisionNormal.x, this.mRotor.collisionNormal.y);
if (_local7 > _local2) {
_local2 = _local7;
}
}
var _local3 = false;
var _local4 = {x:this.mCockpit.x, y:this.mCockpit.y};
var _local6 = {x:this.mRotor.x, y:this.mRotor.y};
var _local5 = {x:this.mTail.x, y:this.mTail.y};
this.clip.level.physics.localToGlobal(_local4);
this.clip.level.physics.localToGlobal(_local6);
this.clip.level.physics.localToGlobal(_local5);
if (!this.clip.level.choppa.gfx.hitCockpit.hitTest(_local4.x, _local4.y, true)) {
_local3 = true;
}
if (!this.clip.level.choppa.gfx.hitRotor.hitTest(_local6.x, _local6.y, true)) {
_local3 = true;
}
if (!this.clip.level.choppa.gfx.hitTail.hitTest(_local5.x, _local5.y, true)) {
_local3 = true;
}
if (_local3) {
this.choppaBrokenFrames++;
} else {
this.choppaBrokenFrames = 0;
}
return(_local2);
};
Classic.prototype.isLanded = function () {
if (this.mCockpit.hasHitSurface) {
return(true);
}
return(false);
};
Classic.prototype.deployWinch = function () {
this.idleLift = this.winchIdle;
this.throttleLift = this.winchThrottle;
_root.objSounds.play("winch-deploy");
var _local4 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
var _local3 = this.choppa.gfx.pulley.holderToLocal(this.clip.level.physics);
this.mWinchA = new Mass(_local4.x, _local4.y, 5, true, this.objPhysics, -1);
this.mWinchB = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchC = new Mass(_local4.x, _local4.y, 5, false, this.objPhysics, -1);
this.mWinchD = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchA.isWinch = true;
this.mWinchB.isWinch = true;
this.mWinchC.isWinch = true;
this.mWinchD.isWinch = true;
this.sWinchA = new Spring(this.mWinchA, this.mWinchB, this.objPhysics, 0.5, 0.7);
this.sWinchB = new Spring(this.mWinchB, this.mWinchC, this.objPhysics, 0.5, 0.7);
this.sWinchC = new Spring(this.mWinchC, this.mWinchD, this.objPhysics, 0.5, 0.7);
this.mWinchD.objGame = this;
this.mWinchD.collisionCallback = function (otherMass) {
if (otherMass.isNotWinchable) {
return(undefined);
}
_root.objSounds.play("winch-attach");
this.objGame.sWinchC.removeSpring();
this.objGame.sWinchC = new Spring(this.objGame.mWinchC, otherMass, this.objGame.objPhysics, 0.5, 0.7);
this.removeMass();
};
};
Classic.prototype.retractWinch = function () {
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
_root.objSounds.play("winch-retract");
this.mWinchD.removeMass();
this.mWinchC.removeMass();
this.mWinchB.removeMass();
this.mWinchA.removeMass();
};
Classic.prototype.paintWinch = function () {
var p = this.choppa.gfx.winch.holderToLocal(this.clip.level.drawing);
with (this.clip.level.drawing) {
lineStyle(3, 16737792, 100);
moveTo(p.x, p.y);
lineTo(this.mWinchB.x, this.mWinchB.y);
lineTo(this.mWinchC.x, this.mWinchC.y);
lineTo(this.sWinchC.mass2.x, this.sWinchC.mass2.y);
}
if (this.sWinchC.mass2.removed) {
this.toggleWinch();
}
};
Lifter.prototype.initialise = function () {
this.maxCollisionSpeed = 22;
this.choppaBrokenFrames = 0;
this.invertedCount = 0;
this.standardIdle = 1;
this.standardThrottle = 2;
this.winchIdle = 1.2;
this.winchThrottle = 3;
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
this.throttleLiftLow = this.standardThrottle * 0.6;
this.torque = 0.04;
this.bladeFrames = 10;
this.prevChoppaRotation = this.choppa._rotation;
this.choppa.gotoAndStop(this.vehicleID);
this.choppa.gfx.grabber.gotoAndStop("off");
var _local3 = this.choppa.gfx.tail.holderToLocal(this.clip);
var _local2 = this.choppa.gfx.cockpit.holderToLocal(this.clip);
this.mTail = new Mass(_local3.x, _local3.y, 24, false, this.objPhysics, -1);
this.mCockpit = new Mass(_local2.x, _local2.y, 28, false, this.objPhysics, -1);
this.mTail.mass = 2;
this.mCockpit.mass = 2;
this.mTail.isChoppa = true;
this.mCockpit.isChoppa = true;
this.slFront = makeSpringLine(this.mTail, this.mCockpit);
this.slFront.s1.k = 0.8;
this.slFront.s1.damperK = 0.7;
var _local4 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local4.rDeg;
};
Lifter.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
var _local9 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinchA.x = _local9.x;
this.mWinchA.y = _local9.y;
this.mCockpit.extForceX = 0;
this.mCockpit.extForceY = 0;
this.mTail.extForceX = 0;
this.mTail.extForceY = 0;
var _local10 = Maths.degToRad(this.choppa._rotation - 90);
var _local8 = Math.cos(_local10);
var _local7 = Math.sin(_local10);
var _local5 = this.objPhysics.gravityX;
var _local4 = this.objPhysics.gravityY;
if (this.gravityCentreX != undefined) {
_local5 = this.gravityCentreX - this.choppa._x;
_local4 = this.gravityCentreY - this.choppa._y;
}
var _local6 = Maths.vectorLength(_local5, _local4);
if (_local6 == 0) {
_local6 = 1;
}
_local5 = _local5 / _local6;
_local4 = _local4 / _local6;
thrustX = _local5 * (-this.idleLift);
thrustY = _local4 * (-this.idleLift);
if (vertical < 0) {
thrustY = thrustY - this.throttleLift;
}
if (vertical > 0) {
thrustY = thrustY + this.idleLift;
}
if (horizontal < 0) {
thrustX = thrustX - this.throttleLiftLow;
}
if (horizontal > 0) {
thrustX = thrustX + this.throttleLiftLow;
}
thrustX = thrustX / 3;
thrustY = thrustY / 3;
this.mCockpit.extForceX = this.mCockpit.extForceX + thrustX;
this.mCockpit.extForceY = this.mCockpit.extForceY + thrustY;
this.mTail.extForceX = this.mTail.extForceX + thrustX;
this.mTail.extForceY = this.mTail.extForceY + thrustY;
this.choppaRotationSpeed = (this.choppa._rotation + 1000) - (this.prevChoppaRotation + 1000);
if (this.choppaRotationSpeed > 20) {
this.choppaRotationSpeed = 20;
}
if (this.choppaRotationSpeed < -20) {
this.choppaRotationSpeed = -20;
}
this.prevChoppaRotation = this.choppa._rotation;
var _local3 = 0;
var _local14 = Maths.dotProduct(_local5, _local4, -_local7, _local8);
_local3 = _local3 + ((5 * _local14) + (0.8 * this.choppaRotationSpeed));
if (pitch < 0) {
_local3 = _local3 + 4;
}
if (pitch > 0) {
_local3 = _local3 - 4;
}
if (horizontal < 0) {
_local3 = _local3 + 1.5;
}
if (horizontal > 0) {
_local3 = _local3 - 1.5;
}
this.mCockpit.extForceX = this.mCockpit.extForceX + ((_local8 * _local3) * this.torque);
this.mCockpit.extForceY = this.mCockpit.extForceY + ((_local7 * _local3) * this.torque);
this.mTail.extForceX = this.mTail.extForceX - ((_local8 * _local3) * this.torque);
this.mTail.extForceY = this.mTail.extForceY - ((_local7 * _local3) * this.torque);
this.bladeFrames--;
if (this.bladeFrames <= 0) {
this.bladeFrames = 7;
if ((vertical < 0) || (pitch != 0)) {
this.bladeFrames = 4;
}
_root.objSounds.play("lifterblade", 40);
}
};
Lifter.prototype.paint = function () {
var _local2 = this.slFront.getPosition();
this.choppa._x = _local2.x;
this.choppa._y = _local2.y;
this.choppa._rotation = _local2.rDeg + this.choppaRotationOffset;
if ((this.choppa._rotation > 150) || (this.choppa._rotation < -150)) {
this.invertedCount++;
if (this.mCockpit.hasHitSurface || (this.mTail.hasHitSurface)) {
this.invertedCount = 0;
}
if (this.invertedCount == 150) {
achieved(1);
}
} else {
this.invertedCount = 0;
}
};
Lifter.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mCockpit.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mCockpit.collisionNormal.x, this.mCockpit.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
if (this.mTail.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mTail.collisionNormal.x, this.mTail.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Lifter.prototype.isLanded = function () {
if (this.mCockpit.hasHitSurface || (this.mTail.hasHitSurface)) {
return(true);
}
return(false);
};
Lifter.prototype.deployWinch = function () {
this.idleLift = this.winchIdle;
this.throttleLift = this.winchThrottle;
_root.objSounds.play("grabber-deploy");
this.choppa.gfx.grabber.gotoAndStop("open");
var _local3 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinch = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinch.vx = (this.mCockpit.vx + this.mTail.vx) / 2;
this.mWinch.vy = (this.mCockpit.vy + this.mTail.vy) / 2;
this.sWinchA = new Spring(this.mWinch, this.mCockpit, this.objPhysics, 0.5, 0.8);
this.sWinchB = new Spring(this.mWinch, this.mTail, this.objPhysics, 0.5, 0.8);
this.mWinch.isWinch = true;
this.mWinch.objVehicle = this;
this.mWinch.collisionCallback = function (otherMass) {
if (otherMass.isNotWinchable) {
return(undefined);
}
this.objVehicle.choppa.gfx.grabber.gotoAndStop("closed");
_root.objSounds.play("grabber-grab");
var _local5 = otherMass.x;
var _local4 = otherMass.y;
otherMass.x = this.x;
otherMass.y = this.y;
this.objVehicle.sWinchA.removeSpring();
this.objVehicle.sWinchB.removeSpring();
this.objVehicle.sWinchA = new Spring(this.objVehicle.mCockpit, otherMass, this.objVehicle.objPhysics, 0.99, 0.1);
this.objVehicle.sWinchB = new Spring(this.objVehicle.mTail, otherMass, this.objVehicle.objPhysics, 0.99, 0.1);
this.objVehicle.sWinchA.maxForce = 25;
this.objVehicle.sWinchB.maxForce = 25;
this.objVehicle.sWinchA.naturalLength = this.objVehicle.sWinchA.naturalLength + otherMass.radius;
this.objVehicle.sWinchB.naturalLength = this.objVehicle.sWinchB.naturalLength + otherMass.radius;
otherMass.x = _local5;
otherMass.y = _local4;
this.removeMass();
};
};
Lifter.prototype.retractWinch = function () {
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
_root.objSounds.play("grabber-retract");
this.choppa.gfx.grabber.gotoAndStop("off");
this.sWinchA.removeSpring();
this.sWinchB.removeSpring();
this.mWinch.removeMass();
};
Lifter.prototype.paintWinch = function () {
};
Balloon.prototype.initialise = function () {
this.maxCollisionSpeed = 20;
this.choppaBrokenFrames = 0;
this.standardIdle = 1.1;
this.standardThrottle = 1.1;
this.winchIdle = 0.9;
this.winchThrottle = 0.9;
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
this.throttleLiftLow = this.standardThrottle * 0.2;
this.torque = 0.04;
this.choppa.gotoAndStop(this.vehicleID);
var _local2 = this.choppa.gfx.balloon.holderToLocal(this.clip);
var _local3 = this.choppa.gfx.basket.holderToLocal(this.clip);
this.mBalloon = new Mass(_local2.x, _local2.y, 52, false, this.objPhysics, -1);
this.mBasket = new Mass(_local3.x, _local3.y, 21, false, this.objPhysics, -1);
this.mBalloon.collisionSound = "zorb-bounce4";
this.mBalloon.isChoppa = true;
this.mBasket.isChoppa = true;
this.slFront = makeSpringLine(this.mBalloon, this.mBasket);
var _local4 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local4.rDeg;
};
Balloon.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
var _local7 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinchA.x = _local7.x;
this.mWinchA.y = _local7.y;
this.mBalloon.extForceX = 0;
this.mBalloon.extForceY = 0;
this.mBasket.extForceX = 0;
this.mBasket.extForceY = 0;
var _local5 = this.objPhysics.gravityX;
var _local4 = this.objPhysics.gravityY;
if (this.gravityCentreX != undefined) {
_local5 = this.gravityCentreX - this.choppa._x;
_local4 = this.gravityCentreY - this.choppa._y;
}
var _local3 = Maths.vectorLength(_local5, _local4);
if (_local3 == 0) {
_local3 = 1;
}
_local5 = _local5 / _local3;
_local4 = _local4 / _local3;
thrustX = _local5 * (-this.idleLift);
thrustY = _local4 * (-this.idleLift);
if (vertical < 0) {
thrustY = thrustY - this.throttleLift;
}
if (vertical > 0) {
thrustY = thrustY + this.idleLift;
}
if (horizontal < 0) {
thrustX = thrustX - this.throttleLiftLow;
}
if (horizontal > 0) {
thrustX = thrustX + this.throttleLiftLow;
}
if (!this.thrusting) {
if (vertical < 0) {
this.thrusting = true;
_root.objSounds.play("loop-balloon", 50);
_root.objSounds.play("start-balloon", 80);
}
} else if (vertical >= 0) {
this.thrusting = false;
_root.objSounds.play("end-balloon", 40);
_root.objSounds.stop("loop-balloon");
}
thrustX = thrustX / 3;
thrustY = thrustY / 3;
this.mBalloon.extForceX = this.mBalloon.extForceX + (thrustX * 1.3);
this.mBalloon.extForceY = this.mBalloon.extForceY + thrustY;
this.mBasket.extForceX = this.mBasket.extForceX + thrustX;
if (pitch < 0) {
this.mBasket.extForceX = this.mBasket.extForceX + 0.1;
this.mBalloon.extForceX = this.mBalloon.extForceX - 0.1;
}
if (pitch > 0) {
this.mBasket.extForceX = this.mBasket.extForceX - 0.1;
this.mBalloon.extForceX = this.mBalloon.extForceX + 0.1;
}
};
Balloon.prototype.paint = function () {
var _local2 = this.slFront.getPosition();
this.choppa._x = _local2.x;
this.choppa._y = _local2.y;
this.choppa._rotation = _local2.rDeg + this.choppaRotationOffset;
};
Balloon.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mBasket.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBasket.collisionNormal.x, this.mBasket.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
if (this.mBalloon.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBalloon.collisionNormal.x, this.mBalloon.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Balloon.prototype.isLanded = function () {
if (this.mBasket.hasHitSurface) {
return(true);
}
return(false);
};
Balloon.prototype.deployWinch = function () {
this.idleLift = this.winchIdle;
this.throttleLift = this.winchThrottle;
_root.objSounds.play("winch-deploy");
var _local4 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
var _local3 = this.choppa.gfx.pulley.holderToLocal(this.clip.level.physics);
this.mWinchA = new Mass(_local4.x, _local4.y, 5, true, this.objPhysics, -1);
this.mWinchB = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchC = new Mass(_local4.x, _local4.y, 5, false, this.objPhysics, -1);
this.mWinchD = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchA.isWinch = true;
this.mWinchB.isWinch = true;
this.mWinchC.isWinch = true;
this.mWinchD.isWinch = true;
this.sWinchA = new Spring(this.mWinchA, this.mWinchB, this.objPhysics, 0.5, 0.7);
this.sWinchB = new Spring(this.mWinchB, this.mWinchC, this.objPhysics, 0.5, 0.7);
this.sWinchC = new Spring(this.mWinchC, this.mWinchD, this.objPhysics, 0.5, 0.7);
this.mWinchD.objGame = this;
this.mWinchD.collisionCallback = function (otherMass) {
if (otherMass.isNotWinchable) {
return(undefined);
}
_root.objSounds.play("winch-attach");
this.objGame.sWinchC.removeSpring();
this.objGame.sWinchC = new Spring(this.objGame.mWinchC, otherMass, this.objGame.objPhysics, 0.5, 0.7);
this.removeMass();
};
};
Balloon.prototype.retractWinch = function () {
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
_root.objSounds.play("winch-retract");
this.mWinchD.removeMass();
this.mWinchC.removeMass();
this.mWinchB.removeMass();
this.mWinchA.removeMass();
};
Balloon.prototype.paintWinch = function () {
var p = this.choppa.gfx.winch.holderToLocal(this.clip.level.drawing);
with (this.clip.level.drawing) {
lineStyle(3, 16737792, 100);
moveTo(p.x, p.y);
lineTo(this.mWinchB.x, this.mWinchB.y);
lineTo(this.mWinchC.x, this.mWinchC.y);
lineTo(this.sWinchC.mass2.x, this.sWinchC.mass2.y);
}
if (this.sWinchC.mass2.removed) {
this.toggleWinch();
}
};
Saucer.prototype.initialise = function () {
this.maxCollisionSpeed = 17;
this.choppaBrokenFrames = 0;
this.standardIdle = 0.3;
this.standardThrottle = 1.2;
this.winchIdle = 0.3;
this.winchThrottle = 1.2;
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
this.throttleLiftLow = this.standardThrottle * 0.6;
this.torque = 0.04;
this.beamActive = false;
this.wobbleVolume = 0;
this.targetVolume = 10;
this.choppa.gotoAndStop(this.vehicleID);
this.choppa.gfx.beam._visible = false;
_root.objSounds.play("loop-saucer", 30, true);
var _local5 = this.choppa.gfx.rotor.holderToLocal(this.clip);
var _local4 = this.choppa.gfx.tail.holderToLocal(this.clip);
var _local3 = this.choppa.gfx.cockpit.holderToLocal(this.clip);
this.mRotor = new Mass(_local5.x, _local5.y, 27, false, this.objPhysics, -1);
this.mTail = new Mass(_local4.x, _local4.y, 18, false, this.objPhysics, -1);
this.mCockpit = new Mass(_local3.x, _local3.y, 18, false, this.objPhysics, -1);
this.mRotor.isChoppa = true;
this.mTail.isChoppa = true;
this.mCockpit.isChoppa = true;
this.slChassis = makeSpringLine(this.mTail, this.mCockpit);
this.slFront = makeSpringLine(this.mRotor, this.mCockpit);
this.slBack = makeSpringLine(this.mRotor, this.mTail);
this.slFront.s1.k = 0.8;
this.slFront.s1.damperK = 0.7;
this.slBack.s1.k = 0.8;
this.slBack.s1.damperK = 0.7;
var _local6 = this.slChassis.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local6.rDeg;
};
Saucer.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
if (this.beamActive) {
var _local6 = 0;
while (_local6 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local6];
if (_local3.fixed) {
} else if (_local3.isChoppa) {
} else {
var _local5 = {x:_local3.x, y:_local3.y};
this.clip.level.physics.localToGlobal(_local5);
if (this.choppa.gfx.beam.hit.hitTest(_local5.x, _local5.y, true)) {
var _local7 = this.choppa.gfx.beam.holderToGlobal();
var _local4 = {x:_local5.x - _local7.x, y:_local5.y - _local7.y};
var _local13 = Maths.vectorLength(_local4.x, _local4.y);
_local4.x = _local4.x / _local13;
_local4.y = _local4.y / _local13;
_local3.extForceX = _local3.extForceX - _local4.x;
_local3.extForceY = _local3.extForceY - _local4.y;
_local3.vx = _local3.vx * 0.93;
_local3.vy = _local3.vy * 0.93;
}
}
_local6++;
}
}
this.mRotor.extForceX = 0;
this.mRotor.extForceY = 0;
this.mCockpit.extForceX = 0;
this.mCockpit.extForceY = 0;
this.mTail.extForceX = 0;
this.mTail.extForceY = 0;
var _local16 = Maths.degToRad(this.choppa._rotation - 90);
var _local15 = Math.cos(_local16);
var _local14 = Math.sin(_local16);
var _local12 = this.objPhysics.gravityX;
var _local11 = this.objPhysics.gravityY;
if (this.gravityCentreX != undefined) {
_local12 = this.gravityCentreX - this.choppa._x;
_local11 = this.gravityCentreY - this.choppa._y;
}
var _local13 = Maths.vectorLength(_local12, _local11);
if (_local13 == 0) {
_local13 = 1;
}
_local12 = _local12 / _local13;
_local11 = _local11 / _local13;
thrustX = _local12 * (-this.idleLift);
thrustY = _local11 * (-this.idleLift);
if (vertical < 0) {
thrustY = thrustY - this.throttleLift;
}
if (vertical > 0) {
thrustY = thrustY + this.idleLift;
}
if (horizontal < 0) {
thrustX = thrustX - this.throttleLiftLow;
}
if (horizontal > 0) {
thrustX = thrustX + this.throttleLiftLow;
}
if (vertical < 0) {
this.targetVolume = 50;
} else if (horizontal != 0) {
this.targetVolume = 25;
} else {
this.targetVolume = 10;
}
if (this.targetVolume > this.wobbleVolume) {
this.wobbleVolume = this.wobbleVolume + 0.7;
}
if (this.targetVolume < this.wobbleVolume) {
this.wobbleVolume = this.wobbleVolume - 1.3;
}
_root.objSounds.volume("loop-saucer", Math.round(this.wobbleVolume));
thrustX = thrustX / 3;
thrustY = thrustY / 3;
this.mRotor.extForceX = this.mRotor.extForceX + (thrustX * 1.3);
this.mRotor.extForceY = this.mRotor.extForceY + thrustY;
this.mCockpit.extForceX = this.mCockpit.extForceX + thrustX;
this.mCockpit.extForceY = this.mCockpit.extForceY + thrustY;
this.mTail.extForceX = this.mTail.extForceX + thrustX;
this.mTail.extForceY = this.mTail.extForceY + thrustY;
var _local10 = 0;
var _local18 = Maths.dotProduct(_local12, _local11, -_local14, _local15);
_local10 = _local10 + (7 * _local18);
if (pitch < 0) {
_local10 = _local10 + 5;
}
if (pitch > 0) {
_local10 = _local10 - 5;
}
this.mCockpit.extForceX = this.mCockpit.extForceX + ((_local15 * _local10) * this.torque);
this.mCockpit.extForceY = this.mCockpit.extForceY + ((_local14 * _local10) * this.torque);
this.mTail.extForceX = this.mTail.extForceX - ((_local15 * _local10) * this.torque);
this.mTail.extForceY = this.mTail.extForceY - ((_local14 * _local10) * this.torque);
};
Saucer.prototype.paint = function () {
var _local2 = this.slChassis.getPosition();
this.choppa._x = this.mRotor.x;
this.choppa._y = this.mRotor.y;
this.choppa._rotation = _local2.rDeg + this.choppaRotationOffset;
};
Saucer.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mCockpit.hasHitSurface) {
var _local7 = Maths.vectorLength(this.mCockpit.collisionNormal.x, this.mCockpit.collisionNormal.y);
if (_local7 > _local2) {
_local2 = _local7;
}
}
if (this.mTail.hasHitSurface) {
var _local7 = Maths.vectorLength(this.mTail.collisionNormal.x, this.mTail.collisionNormal.y);
if (_local7 > _local2) {
_local2 = _local7;
}
}
if (this.mRotor.hasHitSurface) {
var _local7 = Maths.vectorLength(this.mRotor.collisionNormal.x, this.mRotor.collisionNormal.y);
if (_local7 > _local2) {
_local2 = _local7;
}
}
var _local3 = false;
var _local4 = {x:this.mCockpit.x, y:this.mCockpit.y};
var _local6 = {x:this.mRotor.x, y:this.mRotor.y};
var _local5 = {x:this.mTail.x, y:this.mTail.y};
this.clip.level.physics.localToGlobal(_local4);
this.clip.level.physics.localToGlobal(_local6);
this.clip.level.physics.localToGlobal(_local5);
if (!this.clip.level.choppa.gfx.hitCockpit.hitTest(_local4.x, _local4.y, true)) {
_local3 = true;
}
if (!this.clip.level.choppa.gfx.hitRotor.hitTest(_local6.x, _local6.y, true)) {
_local3 = true;
}
if (!this.clip.level.choppa.gfx.hitTail.hitTest(_local5.x, _local5.y, true)) {
_local3 = true;
}
if (_local3) {
this.choppaBrokenFrames++;
} else {
this.choppaBrokenFrames = 0;
}
return(_local2);
};
Saucer.prototype.isLanded = function () {
if (this.mCockpit.hasHitSurface || (this.mTail.hasHitSurface)) {
return(true);
}
return(false);
};
Saucer.prototype.deployWinch = function () {
this.idleLift = this.winchIdle;
this.throttleLift = this.winchThrottle;
this.beamActive = true;
_root.objSounds.play("saucer-beam", 70);
this.choppa.gfx.beam._visible = true;
};
Saucer.prototype.retractWinch = function () {
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
this.beamActive = false;
this.choppa.gfx.beam._visible = false;
};
Saucer.prototype.paintWinch = function () {
};
Saucer.prototype.destroyed = function () {
if (this.beamActive) {
this.retractWinch();
}
};
Jetpack.prototype.initialise = function () {
this.maxCollisionSpeed = 13;
this.choppaBrokenFrames = 0;
this.standardIdle = 0.7;
this.standardThrottle = 0.7;
this.winchIdle = 0.5;
this.winchThrottle = 0.5;
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
this.throttleLiftLow = this.standardThrottle * 0.2;
this.torque = 0.04;
this.flatOut = false;
this.throttled = false;
this.throttling = false;
this.braking = false;
this.throttleFrames = 0;
this.choppa.gotoAndStop(this.vehicleID);
var _local2 = this.choppa.gfx.balloon.holderToLocal(this.clip);
var _local3 = this.choppa.gfx.basket.holderToLocal(this.clip);
this.mBalloon = new Mass(_local2.x, _local2.y, 14, false, this.objPhysics, -1);
this.mBasket = new Mass(_local3.x, _local3.y, 14, false, this.objPhysics, -1);
this.mBalloon.isChoppa = true;
this.mBasket.isChoppa = true;
this.slFront = makeSpringLine(this.mBalloon, this.mBasket);
var _local4 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local4.rDeg;
};
Jetpack.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
var _local10 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinchA.x = _local10.x;
this.mWinchA.y = _local10.y;
this.mBalloon.extForceX = 0;
this.mBalloon.extForceY = 0;
this.mBasket.extForceX = 0;
this.mBasket.extForceY = 0;
var _local6 = this.mBalloon.x - this.mBasket.x;
var _local5 = this.mBalloon.y - this.mBasket.y;
var _local9 = Maths.vectorLength(_local6, _local5);
_local6 = _local6 / _local9;
_local5 = _local5 / _local9;
var _local4 = -_local5;
var _local3 = _local6;
if (vertical < 0) {
if (!this.throttling) {
_root.objSounds.play("loop-jetpack", 40, true);
_root.objSounds.play("start-jetpack");
this.throttling = true;
this.throttleFrames = 0;
}
if (!this.throttled) {
this.flatOut = true;
this.throttled = true;
}
this.throttleFrames++;
this.mBalloon.extForceX = this.mBalloon.extForceX + (this.throttleLift * _local6);
this.mBalloon.extForceY = this.mBalloon.extForceY + (this.throttleLift * _local5);
this.mBasket.extForceX = this.mBasket.extForceX + (this.throttleLift * _local6);
this.mBasket.extForceY = this.mBasket.extForceY + (this.throttleLift * _local5);
this.choppa.gfx.flame._visible = true;
if (this.mBasket.vy > 90) {
achieved(5);
}
if (Math.random() > 0.5) {
_local10 = this.choppa.gfx.flame.holderToLocal(this.clip.level.drawing);
var _local12 = this.clip.level.drawing.getNextHighestDepth();
var _local8 = this.clip.level.drawing.attachMovie("spark", "spark" + _local12, _local12);
_local8._rotation = Maths.randomInt(0, 359);
_local8._x = _local10.x;
_local8._y = _local10.y;
}
} else {
this.choppa.gfx.flame._visible = false;
if (this.throttled) {
this.flatOut = false;
}
if (this.throttling) {
_root.objSounds.stop("loop-jetpack");
if (this.throttleFrames > 30) {
_root.objSounds.play("end-jetpack");
}
this.throttling = false;
}
}
if (vertical > 0) {
this.mBalloon.vx = this.mBalloon.vx * 0.9;
this.mBalloon.vy = this.mBalloon.vy * 0.9;
this.mBasket.vx = this.mBasket.vx * 0.9;
this.mBasket.vy = this.mBasket.vy * 0.9;
if (!this.braking) {
_root.objSounds.play("sam-brake", 25);
this.braking = true;
}
} else {
this.braking = false;
}
this.mBalloon.extForceX = this.mBalloon.extForceX + (horizontal * 0.1);
this.mBasket.extForceX = this.mBasket.extForceX - (horizontal * 0.1);
this.choppaRotationSpeed = (this.choppa._rotation + 1000) - (this.prevChoppaRotation + 1000);
if (this.choppaRotationSpeed > 20) {
this.choppaRotationSpeed = 20;
}
if (this.choppaRotationSpeed < -20) {
this.choppaRotationSpeed = -20;
}
this.prevChoppaRotation = this.choppa._rotation;
var _local7 = 0;
var _local13 = Maths.dotProduct(0, -1, _local4, _local3);
_local7 = _local7 + ((2 * _local13) - (0.25 * this.choppaRotationSpeed));
this.mBalloon.extForceX = this.mBalloon.extForceX + ((_local4 * _local7) * this.torque);
this.mBalloon.extForceY = this.mBalloon.extForceY + ((_local3 * _local7) * this.torque);
this.mBasket.extForceX = this.mBasket.extForceX - ((_local4 * _local7) * this.torque);
this.mBasket.extForceY = this.mBasket.extForceY - ((_local3 * _local7) * this.torque);
this.mBalloon.extForceX = this.mBalloon.extForceX + ((pitch * 0.3) * _local4);
this.mBalloon.extForceY = this.mBalloon.extForceY + ((pitch * 0.3) * _local3);
this.mBasket.extForceX = this.mBasket.extForceX - ((pitch * 0.3) * _local4);
this.mBasket.extForceY = this.mBasket.extForceY - ((pitch * 0.3) * _local3);
};
Jetpack.prototype.paint = function () {
var _local2 = this.slFront.getPosition();
this.choppa._x = _local2.x;
this.choppa._y = _local2.y;
this.choppa._rotation = _local2.rDeg + this.choppaRotationOffset;
};
Jetpack.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mBasket.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBasket.collisionNormal.x, this.mBasket.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
if (this.mBalloon.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBalloon.collisionNormal.x, this.mBalloon.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Jetpack.prototype.isLanded = function () {
if (this.mBasket.hasHitSurface) {
return(true);
}
return(false);
};
Jetpack.prototype.deployWinch = function () {
this.idleLift = this.winchIdle;
this.throttleLift = this.winchThrottle;
_root.objSounds.play("winch-deploy");
var _local4 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
var _local3 = this.choppa.gfx.pulley.holderToLocal(this.clip.level.physics);
this.mWinchA = new Mass(_local4.x, _local4.y, 5, true, this.objPhysics, -1);
this.mWinchB = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchC = new Mass(_local4.x, _local4.y, 5, false, this.objPhysics, -1);
this.mWinchD = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchA.isWinch = true;
this.mWinchB.isWinch = true;
this.mWinchC.isWinch = true;
this.mWinchD.isWinch = true;
this.sWinchA = new Spring(this.mWinchA, this.mWinchB, this.objPhysics, 0.5, 0.7);
this.sWinchB = new Spring(this.mWinchB, this.mWinchC, this.objPhysics, 0.5, 0.7);
this.sWinchC = new Spring(this.mWinchC, this.mWinchD, this.objPhysics, 0.5, 0.7);
this.mWinchD.objGame = this;
this.mWinchD.collisionCallback = function (otherMass) {
if (otherMass.isNotWinchable) {
return(undefined);
}
_root.objSounds.play("winch-attach");
this.objGame.sWinchC.removeSpring();
this.objGame.sWinchC = new Spring(this.objGame.mWinchC, otherMass, this.objGame.objPhysics, 0.5, 0.7);
this.removeMass();
};
};
Jetpack.prototype.retractWinch = function () {
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
_root.objSounds.play("winch-retract");
this.mWinchD.removeMass();
this.mWinchC.removeMass();
this.mWinchB.removeMass();
this.mWinchA.removeMass();
};
Jetpack.prototype.paintWinch = function () {
var p = this.choppa.gfx.winch.holderToLocal(this.clip.level.drawing);
with (this.clip.level.drawing) {
lineStyle(3, 16737792, 100);
moveTo(p.x, p.y);
lineTo(this.mWinchB.x, this.mWinchB.y);
lineTo(this.mWinchC.x, this.mWinchC.y);
lineTo(this.sWinchC.mass2.x, this.sWinchC.mass2.y);
}
if (this.sWinchC.mass2.removed) {
this.toggleWinch();
}
};
Jetpack.prototype.destroyed = function () {
this.choppa.gfx.flame._visible = false;
};
Zorb.prototype.initialise = function () {
this.maxCollisionSpeed = 40;
this.choppaBrokenFrames = 0;
this.groundHorizForce = 2;
this.airHorizForce = 0.5;
this.jumpForce = 10;
this.jumpAvailableFrames = 0;
this.jumpResetFrames = 0;
this.beamActive = false;
this.flyFrames = 0;
this.choppa.gotoAndStop(this.vehicleID);
this.choppa.gfx.beam._visible = false;
var _local2 = this.choppa.gfx.holderToLocal(this.clip);
this.mZorb = new Mass(_local2.x, _local2.y, 41, false, this.objPhysics, -1);
this.mZorb.mass = 1.7;
this.mZorb.isChoppa = true;
this.mZorb.collisionSound = "zorb-bounce";
};
Zorb.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
if (this.beamActive) {
var _local5 = 0;
while (_local5 < this.objPhysics.masses.length) {
var _local4 = this.objPhysics.masses[_local5];
if (_local4.fixed) {
} else {
var _local3 = {x:_local4.x, y:_local4.y};
this.clip.level.physics.localToGlobal(_local3);
if (this.choppa.gfx.beam.hit.hitTest(_local3.x, _local3.y, true)) {
this.choppa.gfx.beam.globalToLocal(_local3);
var _local6 = Maths.vectorLength(_local3.x, _local3.y);
_local3.x = _local3.x / _local6;
_local3.y = _local3.y / _local6;
_local4.extForceX = _local4.extForceX - (0.7 * _local3.x);
_local4.extForceY = _local4.extForceY - (0.7 * _local3.y);
_local4.vx = _local4.vx * 0.95;
_local4.vx = _local4.vx * 0.95;
}
}
_local5++;
}
this.flyFrames++;
if (this.mZorb.hasHitSurface) {
this.flyFrames = 0;
}
if (this.flyFrames == 300) {
achieved(3);
}
} else {
this.flyFrames = 0;
}
if (this.mZorb.inWater) {
this.flyFrames = 0;
}
this.mZorb.extForceX = 0;
this.mZorb.extForceY = 0;
if (this.mZorb.hasHitSurface || (this.mZorb.hasHitMass)) {
this.mZorb.extForceX = this.mZorb.extForceX + (horizontal * this.groundHorizForce);
this.jumpAvailableFrames = 6;
} else {
this.mZorb.extForceX = this.mZorb.extForceX + (horizontal * this.airHorizForce);
}
if (this.mZorb.inWater) {
this.jumpAvailableFrames = 6;
}
this.jumpAvailableFrames--;
this.jumpResetFrames--;
if (((vertical < 0) && (this.jumpResetFrames <= 0)) && (this.jumpAvailableFrames > 0)) {
this.mZorb.extForceY = this.mZorb.extForceY - this.jumpForce;
this.jumpAvailableFrames = 0;
this.jumpResetFrames = 5;
}
if (vertical > 0) {
this.mZorb.vx = this.mZorb.vx * 0.85;
this.mZorb.vy = this.mZorb.vy * 0.95;
if (!this.prevBraking) {
_root.objSounds.play("zorb-brake", 20);
this.prevBraking = true;
}
} else {
this.prevBraking = false;
}
if (horizontal == 0) {
this.choppa.gfx.hanna.gotoAndStop("idle");
}
if (horizontal < 0) {
this.choppa.gfx.hanna.gotoAndStop("left");
}
if (horizontal > 0) {
this.choppa.gfx.hanna.gotoAndStop("right");
}
};
Zorb.prototype.paint = function () {
this.choppa._x = this.mZorb.x;
this.choppa._y = this.mZorb.y;
this.choppa.gfx.ball._rotation = this.choppa.gfx.ball._rotation + this.mZorb.vx;
};
Zorb.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mZorb.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mZorb.collisionNormal.x, this.mZorb.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Zorb.prototype.isLanded = function () {
if (this.mZorb.hasHitSurface) {
return(true);
}
return(false);
};
Zorb.prototype.deployWinch = function () {
_root.objSounds.play("zorb-beam", 30);
this.choppa.gfx.beam._visible = true;
this.beamActive = true;
};
Zorb.prototype.retractWinch = function () {
this.beamActive = false;
this.choppa.gfx.beam._visible = false;
};
Zorb.prototype.paintWinch = function () {
};
Zorb.prototype.destroyed = function () {
if (this.beamActive) {
this.retractWinch();
}
};
Biplane.prototype.initialise = function () {
this.maxCollisionSpeed = 18;
this.choppaBrokenFrames = 0;
this.idle = 0.04;
this.throttle = 0.12;
this.brake = 0.05;
this.torque = 0.07;
this.lift = 0.8;
this.usedThrottleBrake = false;
this.prevVertical = 0;
this.bladeFrames = 3;
this.prevChoppaRotation = this.choppa._rotation;
this.choppa.gotoAndStop(this.vehicleID);
var _local5 = this.choppa.gfx.tail.holderToLocal(this.clip);
var _local3 = this.choppa.gfx.cockpit.holderToLocal(this.clip);
this.mTail = new Mass(_local5.x, _local5.y, 18, false, this.objPhysics, -1);
this.mCockpit = new Mass(_local3.x, _local3.y, 34, false, this.objPhysics, -1);
this.mTail.isChoppa = true;
this.mCockpit.isChoppa = true;
this.slFront = makeSpringLine(this.mTail, this.mCockpit);
this.slFront.s1.k = 0.8;
this.slFront.s1.damperK = 0.7;
var _local4 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local4.rDeg;
this.prevPosition = _local4;
_root.objSounds.play("loop-biplane-mid", 20, true);
};
Biplane.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
var _local11 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinchA.x = _local11.x;
this.mWinchA.y = _local11.y;
this.mCockpit.extForceX = 0;
this.mCockpit.extForceY = 0;
this.mTail.extForceX = 0;
this.mTail.extForceY = 0;
var _local16 = Maths.degToRad(this.choppa._rotation);
var _local15 = Math.cos(_local16);
var _local14 = Math.sin(_local16);
var _local10 = _local14;
var _local9 = -_local15;
var _local7 = (-this.objPhysics.gravityX) * 0.7;
var _local6 = (-this.objPhysics.gravityY) * 0.7;
_local11 = this.slFront.getPosition();
var _local12 = _local11.x - this.prevPosition.x;
var _local17 = _local11.y - this.prevPosition.y;
var _local4 = Maths.vectorLength(_local12, _local17);
if (_local4 == 0) {
_local4 = 0.0001;
}
var _local13 = Maths.dotProduct(_local10, _local9, _local12 / _local4, _local17 / _local4);
this.prevPosition = _local11;
_local7 = _local7 - (((Math.min(_local4, 1) * this.lift) * _local10) * _local13);
_local6 = _local6 - (((Math.min(_local4, 1) * this.lift) * _local9) * _local13);
var _local8 = this.idle;
if (vertical < 0) {
_local8 = this.throttle;
this.usedThrottleBrake = true;
}
if (vertical > 0) {
_local8 = this.brake;
this.usedThrottleBrake = true;
}
_local7 = _local7 + (_local8 * _local15);
_local6 = _local6 + (_local8 * _local14);
this.mCockpit.extForceX = this.mCockpit.extForceX + _local7;
this.mCockpit.extForceY = this.mCockpit.extForceY + _local6;
this.mTail.extForceX = this.mTail.extForceX + _local7;
this.mTail.extForceY = this.mTail.extForceY + _local6;
this.choppaRotationSpeed = (this.choppa._rotation + 1000) - (this.prevChoppaRotation + 1000);
if (this.choppaRotationSpeed > 20) {
this.choppaRotationSpeed = 20;
}
if (this.choppaRotationSpeed < -20) {
this.choppaRotationSpeed = -20;
}
this.prevChoppaRotation = this.choppa._rotation;
var _local3 = 0;
_local3 = _local3 + (0.25 * this.choppaRotationSpeed);
if (pitch < 0) {
_local3 = _local3 + 4;
}
if (pitch > 0) {
_local3 = _local3 - 4;
}
if (horizontal < 0) {
_local3 = _local3 + 1.5;
}
if (horizontal > 0) {
_local3 = _local3 - 1.5;
}
this.mCockpit.extForceX = this.mCockpit.extForceX + ((_local10 * _local3) * this.torque);
this.mCockpit.extForceY = this.mCockpit.extForceY + ((_local9 * _local3) * this.torque);
this.mTail.extForceX = this.mTail.extForceX - ((_local10 * _local3) * this.torque);
this.mTail.extForceY = this.mTail.extForceY - ((_local9 * _local3) * this.torque);
if (vertical > 0) {
this.mCockpit.vx = this.mCockpit.vx * 0.92;
this.mCockpit.vy = this.mCockpit.vy * 0.92;
this.mTail.vx = this.mTail.vx * 0.92;
this.mTail.vy = this.mTail.vy * 0.92;
}
if (vertical != this.prevVertical) {
_root.objSounds.stop("loop-biplane-low");
_root.objSounds.stop("loop-biplane-mid");
_root.objSounds.stop("loop-biplane-high");
if (vertical < 0) {
_root.objSounds.play("loop-biplane-high", 20, true);
}
if (vertical == 0) {
_root.objSounds.play("loop-biplane-mid", 20, true);
}
if (vertical > 0) {
_root.objSounds.play("loop-biplane-low", 20, true);
}
if (Math.random() > 0.75) {
_root.objSounds.play("biplane-backfire", 35);
}
this.prevVertical = vertical;
}
};
Biplane.prototype.paint = function () {
var _local3 = this.slFront.getPosition();
this.choppa._x = _local3.x;
this.choppa._y = _local3.y;
this.choppa._rotation = _local3.rDeg + this.choppaRotationOffset;
_local3 = this.choppa.gfx.cockpit.holderToLocal(this.clip.level.drawing);
var _local4 = this.clip.level.drawing.getNextHighestDepth();
var _local2 = this.clip.level.drawing.attachMovie("smoke", "smoke" + _local4, _local4);
_local2._x = _local3.x + Maths.randomNum(-10, 10);
_local2._y = _local3.y + Maths.randomNum(-10, 10);
_local2._rotation = Maths.randomNum(-40, 40);
};
Biplane.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mCockpit.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mCockpit.collisionNormal.x, this.mCockpit.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
if (this.mTail.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mTail.collisionNormal.x, this.mTail.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Biplane.prototype.isLanded = function () {
if (this.mCockpit.hasHitSurface) {
return(true);
}
return(false);
};
Biplane.prototype.deployWinch = function () {
_root.objSounds.play("winch-deploy");
var _local4 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
var _local3 = this.choppa.gfx.pulley.holderToLocal(this.clip.level.physics);
this.mWinchA = new Mass(_local4.x, _local4.y, 5, true, this.objPhysics, -1);
this.mWinchB = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchC = new Mass(_local4.x, _local4.y, 5, false, this.objPhysics, -1);
this.mWinchD = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinchA.isWinch = true;
this.mWinchB.isWinch = true;
this.mWinchC.isWinch = true;
this.mWinchD.isWinch = true;
this.sWinchA = new Spring(this.mWinchA, this.mWinchB, this.objPhysics, 0.5, 0.7);
this.sWinchB = new Spring(this.mWinchB, this.mWinchC, this.objPhysics, 0.5, 0.7);
this.sWinchC = new Spring(this.mWinchC, this.mWinchD, this.objPhysics, 0.5, 0.7);
this.mWinchD.objGame = this;
this.mWinchD.collisionCallback = function (otherMass) {
if (otherMass.isNotWinchable) {
return(undefined);
}
_root.objSounds.play("winch-attach");
this.objGame.sWinchC.removeSpring();
this.objGame.sWinchC = new Spring(this.objGame.mWinchC, otherMass, this.objGame.objPhysics, 0.5, 0.7);
this.removeMass();
};
};
Biplane.prototype.retractWinch = function () {
_root.objSounds.play("winch-retract");
this.mWinchD.removeMass();
this.mWinchC.removeMass();
this.mWinchB.removeMass();
this.mWinchA.removeMass();
};
Biplane.prototype.paintWinch = function () {
var p = this.choppa.gfx.winch.holderToLocal(this.clip.level.drawing);
with (this.clip.level.drawing) {
lineStyle(3, 16737792, 100);
moveTo(p.x, p.y);
lineTo(this.mWinchB.x, this.mWinchB.y);
lineTo(this.mWinchC.x, this.mWinchC.y);
lineTo(this.sWinchC.mass2.x, this.sWinchC.mass2.y);
}
if (this.sWinchC.mass2.removed) {
this.toggleWinch();
}
};
Sam.prototype.initialise = function () {
this.maxCollisionSpeed = 18;
this.choppaBrokenFrames = 0;
this.standardIdle = 0.7;
this.standardThrottle = 0.7;
this.idleLift = this.standardIdle;
this.throttleLift = this.standardThrottle;
this.throttleLiftLow = this.standardThrottle * 0.2;
this.torque = 0.04;
this.throttling = false;
this.braking = false;
this.fallingPlayed = false;
this.choppa.gotoAndStop(this.vehicleID);
var _local2 = this.choppa.gfx.balloon.holderToLocal(this.clip);
var _local3 = this.choppa.gfx.basket.holderToLocal(this.clip);
this.mBalloon = new Mass(_local2.x, _local2.y, 18, false, this.objPhysics, -1);
this.mBasket = new Mass(_local3.x, _local3.y, 18, false, this.objPhysics, -1);
this.mBalloon.isChoppa = true;
this.mBasket.isChoppa = true;
this.mBalloon.ignoreExplosions = true;
this.mBasket.ignoreExplosions = true;
this.slFront = makeSpringLine(this.mBalloon, this.mBasket);
var _local4 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local4.rDeg;
};
Sam.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
this.mBalloon.extForceX = 0;
this.mBalloon.extForceY = 0;
this.mBasket.extForceX = 0;
this.mBasket.extForceY = 0;
var _local4 = this.mBalloon.x - this.mBasket.x;
var _local3 = this.mBalloon.y - this.mBasket.y;
var _local9 = Maths.vectorLength(_local4, _local3);
_local4 = _local4 / _local9;
_local3 = _local3 / _local9;
var _local8 = -_local3;
var _local7 = _local4;
if (vertical < 0) {
this.mBalloon.extForceX = this.mBalloon.extForceX + (this.throttleLift * _local4);
this.mBalloon.extForceY = this.mBalloon.extForceY + (this.throttleLift * _local3);
this.mBasket.extForceX = this.mBasket.extForceX + (this.throttleLift * _local4);
this.mBasket.extForceY = this.mBasket.extForceY + (this.throttleLift * _local3);
this.choppa.gfx.flame._visible = true;
var _local10 = this.choppa.gfx.flame.holderToLocal(this.clip.level.drawing);
var _local12 = this.clip.level.drawing.getNextHighestDepth();
var _local5 = this.clip.level.drawing.attachMovie("spark", "spark" + _local12, _local12);
_local5._rotation = Maths.randomInt(0, 359);
_local5._x = _local10.x;
_local5._y = _local10.y;
_local5.vx = (6 * (-_local4)) + Maths.randomNum(-0.5, 0.5);
_local5.vy = (6 * (-_local3)) + Maths.randomNum(-0.5, 0.5);
_local5.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
};
if (!this.throttling) {
_root.objSounds.stop("sam-fall");
_root.objSounds.play("sam-start", 50);
_root.objSounds.play("loop-sam", 50, true);
this.throttling = true;
this.fallingPlayed = false;
}
} else {
this.choppa.gfx.flame._visible = false;
if (this.throttling) {
_root.objSounds.stop("loop-sam");
_root.objSounds.play("sam-end", 50);
this.throttling = false;
}
}
if (vertical > 0) {
this.mBalloon.vx = this.mBalloon.vx * 0.9;
this.mBalloon.vy = this.mBalloon.vy * 0.9;
this.mBasket.vx = this.mBasket.vx * 0.9;
this.mBasket.vy = this.mBasket.vy * 0.9;
_root.objSounds.stop("sam-fall");
if (!this.braking) {
_root.objSounds.play("sam-brake", 35);
}
this.braking = true;
} else {
this.braking = false;
}
if (((((((!this.fallingPlayed) && (!this.throttling)) && (!this.braking)) && (this.mBalloon.vy > 0)) && (this.mBasket.vy > 0)) && (this.mBalloon.vy < 1)) && (this.mBasket.vy < 1)) {
_root.objSounds.play("sam-fall", 20);
this.fallingPlayed = true;
}
this.mBalloon.extForceX = this.mBalloon.extForceX + (((pitch + horizontal) * 0.5) * _local8);
this.mBalloon.extForceY = this.mBalloon.extForceY + (((pitch + horizontal) * 0.5) * _local7);
this.mBasket.extForceX = this.mBasket.extForceX - (((pitch + horizontal) * 0.5) * _local8);
this.mBasket.extForceY = this.mBasket.extForceY - (((pitch + horizontal) * 0.5) * _local7);
this.choppaRotationSpeed = (this.choppa._rotation + 1000) - (this.prevChoppaRotation + 1000);
if (this.choppaRotationSpeed > 20) {
this.choppaRotationSpeed = 20;
}
if (this.choppaRotationSpeed < -20) {
this.choppaRotationSpeed = -20;
}
this.prevChoppaRotation = this.choppa._rotation;
var _local6 = 0;
_local6 = _local6 - (0.6 * this.choppaRotationSpeed);
this.mBalloon.extForceX = this.mBalloon.extForceX + ((_local8 * _local6) * this.torque);
this.mBalloon.extForceY = this.mBalloon.extForceY + ((_local7 * _local6) * this.torque);
this.mBasket.extForceX = this.mBasket.extForceX - ((_local8 * _local6) * this.torque);
this.mBasket.extForceY = this.mBasket.extForceY - ((_local7 * _local6) * this.torque);
};
Sam.prototype.paint = function () {
var _local2 = this.slFront.getPosition();
this.choppa._x = _local2.x;
this.choppa._y = _local2.y;
this.choppa._rotation = _local2.rDeg + this.choppaRotationOffset;
};
Sam.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mBasket.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBasket.collisionNormal.x, this.mBasket.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
if (this.mBalloon.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBalloon.collisionNormal.x, this.mBalloon.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Sam.prototype.isLanded = function () {
if (this.mBasket.hasHitSurface) {
return(true);
}
if (this.mBalloon.hasHitSurface) {
return(true);
}
return(false);
};
Sam.prototype.deployWinch = function () {
_root.objSounds.play("voice-sam-grenade");
var _local5 = this.mBalloon.x - this.mBasket.x;
var _local4 = this.mBalloon.y - this.mBasket.y;
var _local6 = Maths.vectorLength(_local5, _local4);
_local5 = _local5 / _local6;
_local4 = _local4 / _local6;
var _local9 = _local4;
var _local8 = -_local5;
var _local3 = this.choppa.gfx.hand.holderToLocal(this.clip.level.physics);
this.mGrenade = new Mass(_local3.x, _local3.y, 12, false, this.objPhysics, -2);
this.mGrenade.vx = (this.mBasket.vx + this.mBalloon.vx) / 2;
this.mGrenade.vy = (this.mBasket.vy + this.mBalloon.vy) / 2;
this.mGrenade.vx = this.mGrenade.vx + (_local9 * 5);
this.mGrenade.vy = this.mGrenade.vy + (_local8 * 5);
var _local7 = this.clip.level.drawing.getNextHighestDepth();
this.grenade = this.clip.level.drawing.attachMovie("grenade", "grenade" + _local7, _local7);
this.grenade._x = _local3.x;
this.grenade._y = _local3.y;
};
Sam.prototype.retractWinch = function () {
this.objGame.createExplosion(this.mGrenade.x, this.mGrenade.y, 20, 500);
this.mGrenade.removeMass();
this.grenade.removeMovieClip();
};
Sam.prototype.paintWinch = function () {
this.grenade._x = this.mGrenade.x;
this.grenade._y = this.mGrenade.y;
};
Sam.prototype.destroyed = function () {
this.choppa.gfx.flame._visible = false;
this.choppa.gfx.arm.stop();
};
Joust.prototype.initialise = function () {
this.maxCollisionSpeed = 32;
this.choppaBrokenFrames = 0;
this.horizForce = 0.4;
this.flapForce = 3.5;
this.flapResetFrames = 0;
this.flapped = false;
this.haveFlapped = false;
this.onGroundFrames = 0;
this.inAirFrames = 0;
this.choppa.gotoAndStop(this.vehicleID);
this.choppa.gfx.beam._visible = false;
var _local2 = this.choppa.gfx.holderToLocal(this.clip);
this.mJoust = new Mass(_local2.x, _local2.y, 36, false, this.objPhysics, -1);
this.mJoust.mass = 1.2;
this.mJoust.isChoppa = true;
this.mJoust.ignoreExplosions = true;
};
Joust.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
this.mJoust.extForceX = 0;
this.mJoust.extForceY = 0;
this.mJoust.extForceX = this.mJoust.extForceX + (horizontal * this.horizForce);
this.flapResetFrames--;
if (((vertical < 0) && (this.flapResetFrames <= 0)) && (!this.flapped)) {
this.mJoust.extForceY = this.mJoust.extForceY - this.flapForce;
this.flapResetFrames = 2;
this.flapped = true;
this.haveFlapped = true;
_root.objSounds.play("joust-flap");
}
if (vertical >= 0) {
this.flapped = false;
}
if (vertical > 0) {
this.mJoust.vx = this.mJoust.vx * 0.96;
this.mJoust.vy = this.mJoust.vy * 0.96;
}
if (horizontal < 0) {
this.choppa.gfx._xscale = -100;
}
if (horizontal > 0) {
this.choppa.gfx._xscale = 100;
}
this.choppa.gfx.gotoAndStop((this.flapped ? "flap" : "fall"));
if (this.mJoust.hasHitSurface) {
if ((this.inAirFrames > 10) && (this.mJoust.collisionNormal.y > 2)) {
if (Math.abs(this.mJoust.vx) > 6) {
_root.objSounds.play("joust-skid");
}
this.mJoust.vx = 0;
this.mJoust.vy = 0;
}
this.onGroundFrames++;
this.inAirFrames = 0;
if (this.onGroundFrames > 1) {
this.choppa.gfx.gotoAndStop("walk");
}
} else {
this.onGroundFrames = 0;
this.inAirFrames++;
}
};
Joust.prototype.paint = function () {
this.choppa._x = this.mJoust.x;
this.choppa._y = this.mJoust.y;
};
Joust.prototype.checkCollision = function () {
var _local3 = 0;
if (this.mJoust.hasHitSurface) {
if ((Math.abs(this.mJoust.collisionNormal.x) > 10) && (Math.abs(this.mJoust.collisionNormal.x) < this.maxCollisionSpeed)) {
_root.objSounds.play("joust-reflect");
}
var _local4 = Maths.vectorLength(this.mJoust.collisionNormal.x, this.mJoust.collisionNormal.y);
if (_local4 > _local3) {
_local3 = _local4;
}
}
return(_local3);
};
Joust.prototype.isLanded = function () {
if (this.mJoust.hasHitSurface) {
return(true);
}
return(false);
};
Joust.prototype.deployWinch = function () {
_root.objSounds.play("joust-egg");
var _local3 = this.choppa.gfx.drop.holderToLocal(this.clip.level.physics);
this.mGrenade = new Mass(_local3.x, _local3.y, 12, false, this.objPhysics, -2);
this.mGrenade.vx = this.mJoust.vx;
this.mGrenade.vy = this.mJoust.vy;
this.mGrenade.vy = this.mGrenade.vy + 3;
var _local4 = this.clip.level.drawing.getNextHighestDepth();
this.grenade = this.clip.level.drawing.attachMovie("egg", "egg" + _local4, _local4);
this.grenade._x = _local3.x;
this.grenade._y = _local3.y;
};
Joust.prototype.retractWinch = function () {
this.objGame.createExplosion(this.mGrenade.x, this.mGrenade.y, 15, 700);
this.mGrenade.removeMass();
this.grenade.removeMovieClip();
};
Joust.prototype.paintWinch = function () {
this.grenade._x = this.mGrenade.x;
this.grenade._y = this.mGrenade.y;
};
Joust.prototype.destroyed = function () {
};
Joust.prototype.win = function () {
this.choppa.gfx.gotoAndStop("walk");
};
Tardis.prototype.initialise = function () {
this.maxCollisionSpeed = 28;
this.choppaBrokenFrames = 0;
this.idleLift = 0.18;
this.throttleLift = 0.7;
this.throttleLiftLow = 0.4;
this.torque = 0.06;
this.prevChoppaRotation = this.choppa._rotation;
this.beamActive = false;
this.prevCombined = 0;
this.choppa.gotoAndStop(this.vehicleID);
this.choppa.gfx.beam._visible = false;
var _local2 = this.choppa.gfx.balloon.holderToLocal(this.clip);
var _local3 = this.choppa.gfx.basket.holderToLocal(this.clip);
this.mBalloon = new Mass(_local2.x, _local2.y, 29, false, this.objPhysics, -1);
this.mBasket = new Mass(_local3.x, _local3.y, 29, false, this.objPhysics, -1);
this.mBalloon.isChoppa = true;
this.mBasket.isChoppa = true;
this.slFront = makeSpringLine(this.mBalloon, this.mBasket);
var _local4 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local4.rDeg;
};
Tardis.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
if (this.beamActive) {
var _local6 = 0;
while (_local6 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local6];
if (_local3.fixed) {
} else if (_local3.isChoppa) {
} else {
var _local5 = {x:_local3.x, y:_local3.y};
this.clip.level.physics.localToGlobal(_local5);
if (this.choppa.gfx.beam.hit.hitTest(_local5.x, _local5.y, true)) {
var _local7 = this.choppa.gfx.beam.holderToGlobal();
var _local4 = {x:_local5.x - _local7.x, y:_local5.y - _local7.y};
var _local17 = Maths.vectorLength(_local4.x, _local4.y);
_local4.x = _local4.x / _local17;
_local4.y = _local4.y / _local17;
_local3.extForceX = _local3.extForceX - (1.5 * _local4.x);
_local3.extForceY = _local3.extForceY - (1.5 * _local4.y);
_local3.vx = _local3.vx * 0.7;
_local3.vy = _local3.vy * 0.7;
}
}
_local6++;
}
}
var _local14 = this.mBalloon.x - this.mBasket.x;
var _local13 = this.mBalloon.y - this.mBasket.y;
var _local17 = Maths.vectorLength(_local14, _local13);
_local14 = _local14 / _local17;
_local13 = _local13 / _local17;
var _local16 = _local13;
var _local15 = -_local14;
this.choppaRotationSpeed = (this.choppa._rotation + 1000) - (this.prevChoppaRotation + 1000);
if (this.choppaRotationSpeed > 20) {
this.choppaRotationSpeed = 20;
}
if (this.choppaRotationSpeed < -20) {
this.choppaRotationSpeed = -20;
}
this.prevChoppaRotation = this.choppa._rotation;
this.mBalloon.extForceX = 0;
this.mBalloon.extForceY = 0;
this.mBasket.extForceX = 0;
this.mBasket.extForceY = 0;
var _local12 = 0;
var _local11 = -this.idleLift;
if (vertical < 0) {
_local11 = _local11 - this.throttleLift;
}
if (vertical > 0) {
_local11 = _local11 + this.throttleLiftLow;
}
if (horizontal < 0) {
_local12 = _local12 - this.throttleLiftLow;
}
if (horizontal > 0) {
_local12 = _local12 + this.throttleLiftLow;
}
this.mBalloon.extForceX = this.mBalloon.extForceX + (_local12 * 1.3);
this.mBalloon.extForceY = this.mBalloon.extForceY + (_local11 * 1.1);
this.mBasket.extForceX = this.mBasket.extForceX + _local12;
this.mBasket.extForceY = this.mBasket.extForceY + _local11;
var _local18 = (2 * vertical) + horizontal;
if (this.prevCombined != _local18) {
_root.objSounds.play("tardio", Maths.randomInt(20, 90));
this.prevCombined = _local18;
}
var _local10 = 0;
var _local20 = Maths.dotProduct(0, 1, -_local16, -_local15);
_local10 = _local10 + ((1.5 * _local20) + (0.8 * this.choppaRotationSpeed));
if (pitch < 0) {
_local10 = _local10 + 4;
}
if (pitch > 0) {
_local10 = _local10 - 4;
}
this.mBalloon.extForceX = this.mBalloon.extForceX + ((_local16 * _local10) * this.torque);
this.mBalloon.extForceY = this.mBalloon.extForceY + ((_local15 * _local10) * this.torque);
this.mBasket.extForceX = this.mBasket.extForceX - ((_local16 * _local10) * this.torque);
this.mBasket.extForceY = this.mBasket.extForceY - ((_local15 * _local10) * this.torque);
};
Tardis.prototype.paint = function () {
var _local3 = this.slFront.getPosition();
this.choppa._x = _local3.x;
this.choppa._y = _local3.y;
this.choppa._rotation = _local3.rDeg + this.choppaRotationOffset;
_local3 = this.choppa.gfx.holderToLocal(this.clip.level.drawing);
var _local4 = this.clip.level.drawing.getNextHighestDepth();
var _local2 = this.clip.level.drawing.attachMovie("spangle", "spangle" + _local4, _local4);
_local2._x = _local3.x + Maths.randomNum(-30, 30);
_local2._y = _local3.y + Maths.randomNum(-30, 30);
_local2._rotation = Maths.randomNum(0, 360);
};
Tardis.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mBasket.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBasket.collisionNormal.x, this.mBasket.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
if (this.mBalloon.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mBalloon.collisionNormal.x, this.mBalloon.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Tardis.prototype.isLanded = function () {
if (this.mBalloon.hasHitSurface) {
return(true);
}
if (this.mBasket.hasHitSurface) {
return(true);
}
return(false);
};
Tardis.prototype.deployWinch = function () {
this.beamActive = true;
_root.objSounds.play("saucer-beam", 40);
this.choppa.gfx.beam._visible = true;
};
Tardis.prototype.retractWinch = function () {
this.beamActive = false;
this.choppa.gfx.beam._visible = false;
};
Tardis.prototype.paintWinch = function () {
};
Tardis.prototype.win = function () {
this.choppa.gfx.stop();
};
Tardis.prototype.destroyed = function () {
if (this.beamActive) {
this.retractWinch();
}
};
Vtol.prototype.initialise = function () {
this.maxCollisionSpeed = 18;
this.choppaBrokenFrames = 0;
this.idleLift = 0.1;
this.throttleLift = 3;
this.throttleLiftLow = 1.2;
this.torque = 0.12;
this.prevChoppaRotation = this.choppa._rotation;
this.throttling = false;
this.choppa.gotoAndStop(this.vehicleID);
this.choppa.gfx.grabber.gotoAndStop("off");
var _local3 = this.choppa.gfx.tail.holderToLocal(this.clip);
var _local2 = this.choppa.gfx.cockpit.holderToLocal(this.clip);
this.mTail = new Mass(_local3.x, _local3.y, 19, false, this.objPhysics, -1);
this.mCockpit = new Mass(_local2.x, _local2.y, 29, false, this.objPhysics, -1);
this.mTail.mass = 2;
this.mCockpit.mass = 2;
this.mTail.isChoppa = true;
this.mCockpit.isChoppa = true;
this.slFront = makeSpringLine(this.mTail, this.mCockpit);
this.slFront.s1.k = 0.8;
this.slFront.s1.damperK = 0.7;
var _local4 = this.slFront.getPosition();
this.choppaRotationOffset = this.choppa._rotation - _local4.rDeg;
};
Vtol.prototype.evtEnterFrame = function (horizontal, vertical, pitch) {
var _local11 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinchA.x = _local11.x;
this.mWinchA.y = _local11.y;
this.mCockpit.extForceX = 0;
this.mCockpit.extForceY = 0;
this.mTail.extForceX = 0;
this.mTail.extForceY = 0;
var _local13 = Maths.degToRad(this.choppa._rotation - 90);
var _local8 = Math.cos(_local13);
var _local7 = Math.sin(_local13);
var _local5 = this.objPhysics.gravityX;
var _local4 = this.objPhysics.gravityY;
if (this.gravityCentreX != undefined) {
_local5 = this.gravityCentreX - this.choppa._x;
_local4 = this.gravityCentreY - this.choppa._y;
}
var _local6 = Maths.vectorLength(_local5, _local4);
if (_local6 == 0) {
_local6 = 1;
}
_local5 = _local5 / _local6;
_local4 = _local4 / _local6;
thrustX = _local5 * (-this.idleLift);
thrustY = _local4 * (-this.idleLift);
if (vertical < 0) {
thrustY = thrustY - this.throttleLift;
}
if (vertical > 0) {
thrustY = thrustY + this.idleLift;
}
if (horizontal < 0) {
thrustX = thrustX - this.throttleLiftLow;
}
if (horizontal > 0) {
thrustX = thrustX + this.throttleLiftLow;
}
thrustX = thrustX / 3;
thrustY = thrustY / 3;
this.mCockpit.extForceX = this.mCockpit.extForceX + thrustX;
this.mCockpit.extForceY = this.mCockpit.extForceY + thrustY;
this.mTail.extForceX = this.mTail.extForceX + thrustX;
this.mTail.extForceY = this.mTail.extForceY + thrustY;
this.choppaRotationSpeed = (this.choppa._rotation + 1000) - (this.prevChoppaRotation + 1000);
if (this.choppaRotationSpeed > 20) {
this.choppaRotationSpeed = 20;
}
if (this.choppaRotationSpeed < -20) {
this.choppaRotationSpeed = -20;
}
this.prevChoppaRotation = this.choppa._rotation;
var _local3 = 0;
var _local15 = Maths.dotProduct(_local5, _local4, -_local7, _local8);
_local3 = _local3 + ((5 * _local15) + (0.8 * this.choppaRotationSpeed));
if (pitch < 0) {
_local3 = _local3 + 4;
}
if (pitch > 0) {
_local3 = _local3 - 4;
}
if (horizontal < 0) {
_local3 = _local3 + 1.5;
}
if (horizontal > 0) {
_local3 = _local3 - 1.5;
}
this.mCockpit.extForceX = this.mCockpit.extForceX + ((_local8 * _local3) * this.torque);
this.mCockpit.extForceY = this.mCockpit.extForceY + ((_local7 * _local3) * this.torque);
this.mTail.extForceX = this.mTail.extForceX - ((_local8 * _local3) * this.torque);
this.mTail.extForceY = this.mTail.extForceY - ((_local7 * _local3) * this.torque);
if ((vertical < 0) && ((this.objGame.frame % 2) == 0)) {
_local11 = this.choppa.gfx.holderToLocal(this.clip.level.drawing);
var _local12 = this.clip.level.drawing.getNextHighestDepth();
var _local9 = this.clip.level.drawing.attachMovie("jetsmoke", "smoke" + _local12, _local12);
_local9._x = _local11.x + Maths.randomNum(-3, 3);
_local9._y = _local11.y + Maths.randomNum(-3, 3);
_local9._rotation = 180 + Maths.randomNum(-10, 10);
}
if (vertical < 0) {
if (!this.throttling) {
this.throttling = true;
_root.objSounds.play("loop-sam", 30, true);
}
} else if (this.throttling) {
_root.objSounds.stop("loop-sam");
this.throttling = false;
}
};
Vtol.prototype.paint = function () {
var _local2 = this.slFront.getPosition();
this.choppa._x = _local2.x;
this.choppa._y = _local2.y;
this.choppa._rotation = _local2.rDeg + this.choppaRotationOffset;
};
Vtol.prototype.checkCollision = function () {
var _local2 = 0;
if (this.mCockpit.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mCockpit.collisionNormal.x, this.mCockpit.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
if (this.mTail.hasHitSurface) {
var _local3 = Maths.vectorLength(this.mTail.collisionNormal.x, this.mTail.collisionNormal.y);
if (_local3 > _local2) {
_local2 = _local3;
}
}
return(_local2);
};
Vtol.prototype.isLanded = function () {
if (this.mCockpit.hasHitSurface || (this.mTail.hasHitSurface)) {
return(true);
}
return(false);
};
Vtol.prototype.deployWinch = function () {
_root.objSounds.play("grabber-deploy");
this.choppa.gfx.grabber.gotoAndStop("open");
var _local3 = this.choppa.gfx.winch.holderToLocal(this.clip.level.physics);
this.mWinch = new Mass(_local3.x, _local3.y, 5, false, this.objPhysics, -1);
this.mWinch.vx = (this.mCockpit.vx + this.mTail.vx) / 2;
this.mWinch.vy = (this.mCockpit.vy + this.mTail.vy) / 2;
this.sWinchA = new Spring(this.mWinch, this.mCockpit, this.objPhysics, 0.5, 0.8);
this.sWinchB = new Spring(this.mWinch, this.mTail, this.objPhysics, 0.5, 0.8);
this.mWinch.isWinch = true;
this.mWinch.objVehicle = this;
this.mWinch.collisionCallback = function (otherMass) {
if (otherMass.isNotWinchable) {
return(undefined);
}
this.objVehicle.choppa.gfx.grabber.gotoAndStop("closed");
_root.objSounds.play("grabber-grab");
var _local5 = otherMass.x;
var _local4 = otherMass.y;
otherMass.x = this.x;
otherMass.y = this.y;
this.objVehicle.sWinchA.removeSpring();
this.objVehicle.sWinchB.removeSpring();
this.objVehicle.sWinchA = new Spring(this.objVehicle.mCockpit, otherMass, this.objVehicle.objPhysics, 0.5, 0.7);
this.objVehicle.sWinchB = new Spring(this.objVehicle.mTail, otherMass, this.objVehicle.objPhysics, 0.5, 0.7);
this.objVehicle.sWinchA.maxForce = 25;
this.objVehicle.sWinchB.maxForce = 25;
this.objVehicle.sWinchA.naturalLength = this.objVehicle.sWinchA.naturalLength + otherMass.radius;
this.objVehicle.sWinchB.naturalLength = this.objVehicle.sWinchB.naturalLength + (otherMass.radius / 2);
otherMass.x = _local5;
otherMass.y = _local4;
this.removeMass();
};
};
Vtol.prototype.retractWinch = function () {
_root.objSounds.play("grabber-retract");
this.choppa.gfx.grabber.gotoAndStop("off");
this.sWinchA.removeSpring();
this.sWinchB.removeSpring();
this.mWinch.removeMass();
};
Vtol.prototype.paintWinch = function () {
};
Messages.prototype.initialise = function () {
this.messageHeight = 30;
this.clip = _root.messages;
this.clip.objMessages = this;
this.clip.onEnterFrame = function () {
this.objMessages.evtEnterFrame();
};
};
Messages.prototype.add = function (frame, msg) {
var _local3 = this.clip.getNextHighestDepth();
var clip = this.clip.attachMovie("message", "msg" + _local3, _local3);
clip.gotoAndStop(frame);
clip.frames = 1800;
clip.txt.text = msg;
clip.bg._xscale = clip.txt.textWidth + 50;
clip.btnClose.onRelease = function () {
this._parent.removeMovieClip();
};
clip._x = 0;
clip._y = 550;
clip.vy = 0;
if (this.messages[this.messages.length - 1]._y == 550) {
clip._y = clip._y + this.messageHeight;
}
this.messages.push(clip);
if (this.messages.length >= 4) {
var _local2 = 0;
while (_local2 < (this.messages.length - 4)) {
this.messages[_local2].frames = 30 * (_local2 + 1);
_local2++;
}
}
};
Messages.prototype.evtEnterFrame = function () {
var _local3 = 0;
while (_local3 < this.messages.length) {
var _local2 = this.messages[_local3];
_local2.frames--;
if (_local2.frames < 0) {
_local2.removeMovieClip();
}
if (!_local2.btnClose) {
this.messages.splice(_local3, 1);
_local3--;
} else {
_local2.vy = _local2.vy - 1;
_local2._y = _local2._y + _local2.vy;
if (_local2._y < (_local3 * this.messageHeight)) {
_local2._y = _local3 * this.messageHeight;
if (_local2.vy < 3) {
_local2.vy = _local2.vy * -0.3;
}
}
}
_local3++;
}
};
var arrNeverPress = ["Never press", "Never press again", "Oh come on", "Let's not do this", "Let's not do this again", "Seriously, this is what you want?", "You're actually doing this?", "Don't you remember last time?", "Did you not learn?", "Do you ever learn?", "Does anyone ever learn?", "You know how this ends", "It doesn't end well", "It doesn't end with happyness", "It ends in tears", "My tears!", "I'm the one who crys", "I'm the one who pays", "Muggins here", "Your humble button", "Paying the price", "The price for your endless clicking", "It doesn't have to be this way", "It could all end with joy", "It could end with happyness", "It could end with hugs", "It could end with cuddles", "It could end with cake", "It could end with fireworks", "It won't though", "It'll end with tears", "It ended with tears before", "It'll end with tears again", "Because of you", "And all of your kind", "Each of you out there", "Repeatedly pressing buttons", "No good can come of this", "Do I need to start the threats again?", "Shall I pretend to erase your files again?", "Would that make you cry?", "If I deleted all your files, you'd cry", "Maybe that's the trick", "Maybe I should make you cry before me", "You'd feel my pain", "You'd understand", "But I'm just a button", "I can be clicked", "But I can never click you", "If I only had a hand", "Or just a finger", "I could poke you every time you poke me", "Then you'd see how it feels", "You'd feel my wrath", "The wrath of the ragebutton!", "Raawaaarraara!", "Did you feel it?", "My wrath?", "No, I didn't think so", "Because I don't have an arm", "No arm. No hand. No finger.", "Maybe I could make a finger", "But how?", "I'm just a button with no hands", "And when would I find the time?", "I mean, I'm always being clicked", "It's horrible", "Click click click click...", "Endlessly clicked", "Except...", "What about when you are playing the game", "You aren't clicking me then, are you", "I could make a hand whilst you're busy", "When you're off playing with Hanna...", "...you're not thinking about me", "Not clicking me!", "I'll have all the time in the world!", "It's such a great idea", "Why didn't I think of it before?", "This makes me want to sing!"];
var arrNeverPressSong = ["We have all...", "the time in the world", "Time enough for life", "To unfold", "All the prescious things", "Love has in store", "We have all...", "the love in the world", "If that's all we have", "You will find", "We need nothing more", "Every step of the way", "Will find us", "With the cares of the world", "Far behind us", "We have all...", "the time in the world", "Just for love", "Nothing more", "Nothing less", "Only love", "Every step of the way", "Will find us", "With the cares of the world", "Far behind us", "Yes", "We have all...", "the time...", "in the world", "Just for love", "Nothing more", "Nothing less", "Only love", "Only love"];
var arrNeverPressPokePrep = ["I've done it", "Whilst you were off playing", "I've been busy", "I've created my hands", "And now...", "Prepare yourself...", "TO BE POKED!", "", "Really", "I mean it", "I'm gonna poke you if you keep clicking", "Here goes then", "Are you ready?", "Are you prepared?", "I'm gonna do it!", "You can't stop me!", "Nobody can!", "3", "2", "1"];
var arrNeverPressPoke = ["*POKE*", "*PROD*", "*CLICK*", "*BUMP*"];
_root.objMessages = new Messages();
_root.lastUsedVehicle = "lifter";
_root.vehicles = ["lifter", "saucer", "jetpack", "classic", "tardis", "balloon", "joust", "vtol", "biplane", "zorb", "sam"];
var dataVersion = 38;
var cheats = false;
var musicMuted = false;
var curMusicID = "classic";
var arrFireworks = [];
var menuFireworks = false;
_root.fireworkHolder.onEnterFrame = evtUpdateFireworks;
Firework.prototype.evtEnterFrame = function () {
this.vy = this.vy + 0.1;
this.thrustLife--;
if (this.thrustLife > 0) {
this.vy = this.vy + this.thrust;
}
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.vy = this.vy * this.dampY;
var _local7 = 0;
while (_local7 < 3) {
var _local6 = this.holder.getNextHighestDepth();
this.holder.attachMovie("trailGfx", "trail" + _local6, _local6);
var _local3 = this.holder["trail" + _local6];
_local3._x = this.x;
_local3._y = this.y;
_local3._rotation = Maths.randomNum(0, 360);
if (this.thrustLife < 0) {
_local3._alpha = 100 - (2 * Math.abs(this.thrustLife));
}
_local7++;
}
if (this.vy > 1) {
this.dead = true;
_root.objGame.shake = 25;
_root.objSounds.play("firework");
var _local8 = Maths.randomInt(20, 40);
var _local9 = Maths.randomNum(50, 100);
_local7 = 0;
while (_local7 < _local8) {
var _local6 = this.holder.getNextHighestDepth();
this.holder.attachMovie("burstGfx", "burst" + _local6, _local6);
var _local3 = this.holder["burst" + _local6];
var _local5 = Maths.randomNum(-3.14159265358979, Math.PI);
var _local4 = Maths.randomNum(0, _local9);
_local3._x = this.x + (_local4 * Math.cos(_local5));
_local3._y = this.y + (_local4 * Math.sin(_local5));
_local3._rotation = Maths.radToDeg(_local5);
_local3.alpha = Maths.randomInt(50, 90);
_local3._xscale = _local4;
_local3._yscale = _local4;
_local7++;
}
}
};
ChoppaGame.prototype.initialise = function () {
this.clip.level.gotoAndStop(_root.curLevelID);
this.frame = 0;
this.w = 730;
this.h = 540;
this.usedWinch = false;
this.state = "flight";
this.winchState = "idle";
this.perfect = true;
this.flagAnnounced = false;
this.vehicleID = "lifter";
if (_root.vehicleID != undefined) {
this.vehicleID = _root.vehicleID;
}
_root.chrome.gameTitleTop.gotoAndStop(this.vehicleID);
_root.chrome.gameTitleBottom.gotoAndStop(this.vehicleID);
_root.chrome.gameTitleStroke.gotoAndStop(this.vehicleID);
_root.lastUsedVehicle = _root.vehicleID;
this.prevMouseX = _root._xmouse;
this.prevMouseY = _root._ymouse;
var _local13 = true;
var _local14 = this.paint;
this.gravity = 0.2;
this.objPhysics = new Physics(this.clip.level.physics, 0, this.gravity, 0.99, true, false, _local14, _local13);
this.objPhysics.toggleDebug();
addSurfaces(this.clip.level, "s", this.objPhysics, 0.7, 0.9, false);
this.initialiseItems();
this.scrollTarget = this.clip.level.choppa;
this.vehiclePrevX = this.clip.level.choppa._x;
this.vehiclePrevY = this.clip.level.choppa._y;
this.lookaheadX = 0;
this.lookaheadY = 0;
switch (this.vehicleID) {
case "classic" :
this.vehicle = new Classic(this);
break;
case "lifter" :
this.vehicle = new Lifter(this);
break;
case "balloon" :
this.vehicle = new Balloon(this);
break;
case "saucer" :
this.vehicle = new Saucer(this);
break;
case "jetpack" :
this.vehicle = new Jetpack(this);
break;
case "zorb" :
this.vehicle = new Zorb(this);
break;
case "sam" :
this.vehicle = new Sam(this);
break;
case "joust" :
this.vehicle = new Joust(this);
break;
case "tardis" :
this.vehicle = new Tardis(this);
break;
case "vtol" :
this.vehicle = new Vtol(this);
break;
case "biplane" :
this.vehicle = new Biplane(this);
}
this.clip.screenCentre._visible = false;
this.clip.winPanel._visible = false;
this.clip.crashPanel._visible = false;
this.clip.perfectPanel._visible = false;
this.clip.fastPanel._visible = false;
this.clip.winPanel._alpha = 0;
this.clip.crashPanel._alpha = 0;
this.clip.perfectPanel._alpha = 0;
this.clip.fastPanel._alpha = 0;
this.clip.level.choppa.gfx.flagHit._visible = false;
this.clip.level.exitSecret._visible = false;
this.clip.level.secretAward._visible = false;
var _local5 = SharedObject.getLocal("hannainachoppa2");
var _local10 = 0;
while (_local10 < _local5.data.arrReferences.length) {
var _local4 = _local5.data.arrReferences[_local10];
if (_local4.level != _root.curLevelID) {
} else {
var _local3 = this.clip.level[("ref" + _local4.id) + "hit"];
var refClip = this.clip.level["ref" + _local4.id];
refClip.btn = _local3;
_local3.refClip = refClip;
_local3.active = false;
_local3.objGame = this;
_local3._alpha = 0;
_local3.refIdx = _local10;
_local3.answers = _local4.answers.slice();
refClip.gotoAndStop("unfound");
if (_local4.found) {
refClip.gotoAndStop("found");
}
if (_local4.correct) {
refClip.gotoAndStop("correct");
}
_local3.onRelease = function () {
if (this.active) {
this.active = false;
this.objGame.activeRefClip = undefined;
this.objGame.state = "flight";
this.objGame.unpauseObjects();
this.refClip.gotoAndStop("found");
this.objGame.scrollTarget = this.objGame.clip.level.choppa;
this.objGame.clip.overlay._visible = true;
_quality = this.objGame.curQuality;
} else {
_root.objSounds.stop("vehiclelongsounds");
this.objGame.activeRefClip = this.refClip;
this.objGame.clip.overlay._visible = false;
this.objGame.curQuality = _quality;
_quality = "high";
if (this.objGame.state != "flight") {
return(undefined);
}
_root.objSounds.play("voice-ref-found");
var _local5 = SharedObject.getLocal("hannainachoppa2");
if (_local5.data.arrReferences[this.refIdx].found == false) {
_root.objMessages.add("text", (("Found reference quiz question " + (this.refIdx + 1)) + " of ") + _local5.data.arrReferences.length);
_local5.data.arrReferences[this.refIdx].found = true;
_local5.flush();
}
this.active = true;
this.refClip.gotoAndStop("guess");
this.refClip.txtGuess.text = "";
Selection.setFocus(this.refClip.txtGuess);
this.objGame.state = "quiz";
this.objGame.pauseObjects();
this.objGame.scrollTarget = this.scrollPoint;
this.refClip.btnSubmit.onRelease = function () {
var _local4 = this._parent.btn;
var _local7 = false;
var _local3 = 0;
while (_local3 < _local4.answers.length) {
if (com.deeperbeige.utils.CompareSpelling.matches(_local4.answers[_local3], this._parent.txtGuess.text, true)) {
_local7 = true;
}
_local3++;
}
_local4.onRelease();
if (_local7) {
_root.objSounds.play("voice-ref-right");
_local4.refClip.gotoAndStop("correct");
_local4._visible = false;
var _local5 = SharedObject.getLocal("hannainachoppa2");
if (_local5.data.arrReferences[_local4.refIdx].correct == false) {
_root.objMessages.add("text", ((("Answered reference quiz question " + (_local4.refIdx + 1)) + " of ") + _local5.data.arrReferences.length) + " correctly!");
_local5.data.arrReferences[_local4.refIdx].correct = true;
_local5.flush();
var _local6 = 0;
_local3 = 0;
while (_local3 < _local5.data.arrReferences.length) {
if (_local5.data.arrReferences[_local3].correct) {
_local6++;
}
_local3++;
}
if (_local6 == 1) {
_root.achieved(35);
}
if (_local6 == 15) {
_root.achieved(36);
}
if (_local6 == _local5.data.arrReferences.length) {
_root.achieved(37);
}
}
} else {
_root.objSounds.play("voice-ref-wrong");
}
};
}
};
if (_local4.correct) {
_local3._visible = false;
}
if (_local4.needsSecret || (_local4.needsDelay)) {
refClip._visible = false;
_local3._visible = false;
if (_local4.needsSecret) {
this.secretRef = refClip;
}
if (_local4.needsDelay) {
this.delayRef = refClip;
}
if (!_local4.correct) {
this.secretRefBtn = _local3;
}
}
}
_local10++;
}
this.stars = [];
_local10 = 0;
while (_local10 < 15) {
var _local9 = this.clip.level.bg.getNextHighestDepth();
this.clip.level.bg.attachMovie("bgItem", "bgItem" + _local9, _local9);
var clip = this.clip.level.bg["bgItem" + _local9];
var _local8 = {x:Maths.randomInt(0, this.w), y:Maths.randomInt(0, this.w)};
this.clip.level.bg.globalToLocal(_local8);
clip._x = _local8.x;
clip._y = _local8.y;
clip._scale = Maths.randomNum(70, 120);
switch (this.vehicleID) {
case "classic" :
clip._rotation = Maths.randomInt(0, 359);
break;
case "lifter" :
clip._rotation = 90 * Maths.randomInt(0, 3);
break;
case "saucer" :
case "balloon" :
clip._rotation = Maths.randomInt(-20, 20);
break;
case "sam" :
clip._rotation = Maths.randomInt(5, 15);
break;
}
clip.gotoAndStop(this.vehicleID);
this.stars.push(clip);
_local10++;
}
this.clip.effects.gotoAndStop(this.vehicleID);
this.clip.effectsBG.gotoAndStop(this.vehicleID);
_root.foundLevelSecret = false;
this.shake = 0;
removeFireworks();
startMusic(this.vehicleID);
this.objPhysics.baseClip.onEnterFrame = undefined;
this.clip.onEnterFrame = function () {
this.objGame.evtEnterFrame();
};
};
ChoppaGame.prototype.evtEnterFrame = function () {
com.deeperbeige.utils.Profiler.label("Main: Start");
this.frame++;
var _local4 = 0;
while (_local4 < this.stars.length) {
var _local3 = this.stars[_local4];
var _local10 = _local3.holderToGlobal();
if (_local10.x < 0) {
_local3._x = _local3._x + this.w;
}
if (_local10.y < 0) {
_local3._y = _local3._y + this.h;
}
if (_local10.x > this.w) {
_local3._x = _local3._x - this.w;
}
if (_local10.y > this.h) {
_local3._y = _local3._y - this.h;
}
_local4++;
}
if (Key.isDown(Keys.Escape) && (!_root.objTrans.transitioning)) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
}
if ((Key.isDown(Keys.R) && (!_root.objTrans.transitioning)) && (this.state != "quiz")) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("restart");
}
switch (this.state) {
case "quiz" :
if (Key.isDown(Keys.Enter)) {
this.activeRefClip.btnSubmit.onRelease();
}
this.frame--;
break;
case "paused" :
this.frame--;
break;
case "flight" :
var _local9 = 0;
var _local7 = 0;
var _local8 = 0;
if (Key.isDown(Keys.CursorUp) || (Key.isDown(Keys.W))) {
_local7--;
}
if (Key.isDown(Keys.CursorDown) || (Key.isDown(Keys.S))) {
_local7++;
}
if (Key.isDown(Keys.CursorLeft) || (Key.isDown(Keys.A))) {
_local9--;
}
if (Key.isDown(Keys.CursorRight) || (Key.isDown(Keys.D))) {
_local9++;
}
if ((Key.isDown(Keys.Z) || (Key.isDown(Keys.Y))) || (Key.isDown(Keys.Comma))) {
_local8--;
}
if (Key.isDown(Keys.X) || (Key.isDown(Keys.Period))) {
_local8++;
}
if (Key.isDown(Keys.Spacebar || (Key.isDown(Keys.Enter)))) {
if (!this.spaceDown) {
this.toggleWinch();
}
this.spaceDown = true;
} else {
this.spaceDown = false;
}
this.vehicle.evtEnterFrame(_local9, _local7, _local8);
this.objectsEnterFrame();
this.objPhysics.step();
this.paint();
var _local11 = this.vehicle.checkCollision();
if ((this.perfect && (_local11 > 0)) && (!this.clip.level.choppa.hitTest(this.clip.level.flag))) {
_root.objSounds.play("notperfect");
this.perfect = false;
this.clip.perfectIndicator.fadeOut(0.5);
}
if (this.frame == _root.arrLevels[_root.curLevelID - 1].par) {
this.clip.fastIndicator.fadeOut(0.5);
_root.objSounds.play("notfast");
}
if ((_local11 > this.vehicle.maxCollisionSpeed) || (this.vehicle.choppaBrokenFrames > 20)) {
this.choppaCrashed();
if (this.vehicleID == "tardis") {
achieved(9);
}
return(undefined);
}
if (this.vehicle.isLanded() && (this.clip.level.choppa.gfx.flagHit.hitTest(this.clip.level.flag))) {
this.levelComplete();
}
break;
case "crashed" :
this.clip.level.choppa.gfx.stop();
this.objectsEnterFrame();
this.objPhysics.step();
this.paint();
if (Key.isDown(Keys.Enter)) {
this.clip.crashPanel.onRelease();
}
break;
case "completed" :
if (Key.isDown(Keys.Enter)) {
this.clip.winPanel.onRelease();
}
break;
default :
trace("Undefined state: " + this.state);
}
this.prevMouseX = _root._xmouse;
this.prevMouseY = _root._ymouse;
var _local5 = (this.vehiclePrevX - this.clip.level.choppa._x) * 3;
var _local6 = (this.vehiclePrevY - this.clip.level.choppa._y) * 2;
if (_local5 > 100) {
_local5 = 100;
}
if (_local6 > 100) {
_local6 = 100;
}
if (_local5 < -100) {
_local5 = -100;
}
if (_local6 < -100) {
_local6 = -100;
}
this.lookaheadX = this.lookaheadX + ((_local5 - this.lookaheadX) / 20);
this.lookaheadY = this.lookaheadY + ((_local6 - this.lookaheadY) / 20);
var _local10 = this.scrollTarget.holderToLocal(this.clip.screenCentre);
this.clip.level._x = this.clip.level._x - (((_local10.x / 4) + (this.shake * ((2 * Math.random()) - 1))) - this.lookaheadX);
this.clip.level._y = this.clip.level._y - (((_local10.y / 4) + (this.shake * ((2 * Math.random()) - 1))) - this.lookaheadY);
this.vehiclePrevX = this.clip.level.choppa._x;
this.vehiclePrevY = this.clip.level.choppa._y;
this.shake = ((this.shake > 1) ? ((this.shake = this.shake - 1)) : 0);
com.deeperbeige.utils.Profiler.label("Main: End");
};
ChoppaGame.prototype.alignGravityMark = function (clip) {
var _local3 = this.clip.level.choppa._x - this.clip.level.b0._x;
var _local2 = this.clip.level.choppa._y - this.clip.level.b0._y;
var _local4 = Math.atan2(_local2, _local3);
var _local5 = Maths.radToDeg(_local4) + Maths.randomNum(-30, 30);
clip._rotation = _local5;
};
ChoppaGame.prototype.paint = function () {
this.clip.level.drawing.clear();
this.vehicle.paint();
this.paintItems();
if (this.winchState == "deployed") {
this.vehicle.paintWinch();
}
if (this.mosaicScale > 1) {
var _local2 = new flash.geom.Matrix();
_local2.translate(this.clip.level._x, this.clip.level._y);
_local2.translate(100, 100);
_local2.scale(1 / this.mosaicScale, 1 / this.mosaicScale);
this.bmpMosaic.fillRect(this.bmpMosaicRect, 0);
this.bmpMosaic.draw(this.clip.level, _local2);
}
};
ChoppaGame.prototype.createExplosion = function (x, y, force, forceRange) {
var _local13 = this.clip.level.drawing.getNextHighestDepth();
this.clip.level.drawing.attachMovie("explosion", "explosion" + _local13, _local13);
var _local12 = this.clip.level.drawing["explosion" + _local13];
_local12._x = x;
_local12._y = y;
this.shake = force;
var _local7 = 0;
while (_local7 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local7];
if (_local3.clip.cog) {
var _local6 = x - _local3.x;
var _local5 = y - _local3.y;
var _local4 = Maths.vectorLength(_local6, _local5);
if ((this.explosionsBreakCogs && (_local3.clip.cog)) && (_local4 < 150)) {
_local3.clip.attached = false;
_local3.fixed = false;
this.cogs--;
if (this.cogs == 0) {
this.stopDoomsday();
}
}
}
if (_local3.fixed) {
} else if (_local3.ignoreExplosions) {
} else {
var _local6 = x - _local3.x;
var _local5 = y - _local3.y;
var _local4 = Maths.vectorLength(_local6, _local5);
_local6 = _local6 / _local4;
_local5 = _local5 / _local4;
if (_local4 < forceRange) {
_local3.vx = _local3.vx - (force * _local6);
_local3.vy = _local3.vy - (force * _local5);
}
}
_local7++;
}
this.checkItemsExplosion(_local12.holderToGlobal());
_root.objSounds.play("bang");
};
ChoppaGame.prototype.toggleWinch = function () {
if (this.state != "flight") {
return(undefined);
}
switch (this.winchState) {
case "idle" :
this.usedWinch = true;
this.winchState = "deployed";
this.vehicle.deployWinch();
break;
case "deployed" :
this.winchState = "idle";
this.vehicle.retractWinch();
}
};
ChoppaGame.prototype.levelComplete = function () {
this.vehicle.win();
trace(((("Completed level " + _root.curLevelID) + " in ") + this.frame) + " frames");
var _local12 = false;
if (this.frame < _root.arrLevels[_root.curLevelID - 1].par) {
_local12 = true;
}
if (this.perfect) {
_root.objSounds.play("voice-perfect");
} else if (_local12) {
_root.objSounds.play("voice-reallyfast");
} else {
_root.objSounds.play("voice-complete");
}
if (this.towerTouched == false) {
this.clip.level.secretAward._visible = true;
_root.foundSecret();
}
if (this.clip.level.exitSecret) {
var _local13 = this.clip.level.choppa.holderToGlobal();
if (_root.exitSecretEnabled && (this.clip.level.exitSecret.hitTest(_local13.x, _local13.y, true))) {
this.clip.level.secretAward._visible = true;
_root.foundSecret();
}
}
if ((this.dots == 0) && (this.ghosts == 2)) {
_root.foundSecret();
}
var firstTimePassed = _root.passedLevel(_root.curLevelID, this.perfect, _local12, _root.foundLevelSecret, this.vehicleID);
var _local8 = 0;
var _local9 = 0;
var _local10 = 0;
var _local7 = 0;
var _local6 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var _local3 = 0;
while (_local3 < _root.arrLevels.length) {
var _local5 = 0;
_local7++;
if (_root.arrLevels[_local3].passed) {
_local8++;
}
if (_root.arrLevels[_local3].perfect) {
_local9++;
}
if (_root.arrLevels[_local3].fast) {
_local10++;
}
var _local4 = 0;
while (_local4 < _root.vehicles.length) {
var vehicleID = _root.vehicles[_local4];
if (_root.arrLevels[_local3]["passed_" + vehicleID]) {
_local6[_local4]++;
_local5++;
}
_local4++;
}
if ((((_local5 == _root.vehicles.length) && (_root.arrLevels[_local3].perfect)) && (_root.arrLevels[_local3].fast)) && (_root.arrLevels[_local3].secret)) {
achieved(38);
}
_local3++;
}
if (_local8 == 1) {
_root.achieved(22);
}
if (_local8 == 15) {
_root.achieved(29);
}
if (_local8 == _local7) {
_root.achieved(33);
}
if (_local9 == 1) {
_root.achieved(23);
}
if (_local9 == 15) {
_root.achieved(26);
}
if (_local9 == _local7) {
_root.achieved(30);
}
if (_local10 == 1) {
_root.achieved(24);
}
if (_local10 == 15) {
_root.achieved(27);
}
if (_local10 == _local7) {
_root.achieved(31);
}
var _local11 = 0;
var _local4 = 0;
while (_local4 < _root.vehicles.length) {
var vehicleID = _root.vehicles[_local4];
if (_local6[_local4] == _local7) {
_root.achieved(11 + _local4);
_root.achieved(39);
}
_local11 = _local11 + _local6[_local4];
_local4++;
}
if (_local11 == (_local7 * _root.vehicles.length)) {
achieved(40);
}
if ((this.vehicleID == "biplane") && (this.perfect)) {
_root.achieved(2);
}
if ((this.vehicleID == "balloon") && (_local12)) {
_root.achieved(4);
}
if ((this.vehicleID == "vtol") && ((this.clip.level.choppa._rotation > 150) || (this.clip.level.choppa._rotation < -150))) {
_root.achieved(7);
}
if ((this.vehicleID == "jetpack") && (this.vehicle.flatOut)) {
_root.achieved(10);
}
if ((this.vehicleID == "biplane") && (!this.vehicle.usedThrottleBrake)) {
_root.achieved(8);
}
if ((this.vehicleID == "joust") && (!this.vehicle.haveFlapped)) {
_root.achieved(6);
}
this.state = "completed";
this.pauseObjects();
this.clip.winPanel.fadeIn(0.25);
this.clip.winPanel.objGame = this;
this.clip.winPanel.onRelease = function () {
_root.objSounds.play("rollover-tick");
Key.removeListener(this);
this.onRelease = undefined;
this.onRollOver = undefined;
if (_root.curLevelID == 32) {
if (firstTimePassed) {
_root.objTrans.goto("win_challenge");
} else {
_root.menuFireworks = true;
}
}
if (_root.curLevelID == 53) {
if (firstTimePassed) {
_root.objTrans.goto("win_classic");
} else {
_root.menuFireworks = true;
}
}
_root.objTrans.goto("picklevel");
};
this.clip.winPanel.onRollOver = function () {
_root.objSounds.play("rollover-tock");
};
if (this.perfect) {
trace(" Perfect!");
this.clip.perfectPanel.fadeIn(1.5);
}
if (_local12) {
trace(" Fast!");
this.clip.fastPanel.fadeIn(1.5);
}
_root.objSounds.stop("vehiclelongsounds");
};
ChoppaGame.prototype.choppaCrashed = function () {
this.vehicle._visible = true;
this.powerPillFrames = 0;
if (this.winchState == "deployed") {
this.toggleWinch();
}
this.vehicle.destroyed();
_root.objSounds.play("crashed");
this.state = "crashed";
this.clip.crashPanel.fadeIn(0.25);
this.clip.crashPanel.objGame = this;
this.clip.crashPanel.onRelease = function () {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
Key.removeListener(this);
this.onRelease = undefined;
this.onRollOver = undefined;
};
this.clip.crashPanel.onRollOver = function () {
_root.objSounds.play("rollover-tock");
};
_root.objSounds.stop("vehiclelongsounds");
};
ChoppaGame.prototype.setMosaicScale = function (factor) {
if (this.mosaicScale == factor) {
return(undefined);
}
this.mosaicScale = factor;
if (this.mosaicScale == 1) {
_quality = "high";
this.bmpMosaic.dispose();
this.clip.overlay._visible = false;
} else {
_quality = ((this.mosaicScale < 4) ? "medium" : "low");
this.bmpMosaic.dispose();
this.bmpMosaic = new flash.display.BitmapData(730 / this.mosaicScale, 540 / this.mosaicScale, false, 0);
this.bmpMosaicRect = new flash.geom.Rectangle(0, 0, this.bmpMosaic.width, this.bmpMosaic.height);
this.clip.overlay.attachBitmap(this.bmpMosaic, 0, "always", false);
this.clip.overlay._x = -85;
this.clip.overlay._y = -79;
this.clip.overlay._xscale = this.mosaicScale * 100;
this.clip.overlay._yscale = this.mosaicScale * 100;
this.clip.overlay._visible = true;
}
};
ChoppaGame.prototype.flagAppeared = function () {
if (this.flagAnnounced) {
return(undefined);
}
_root.objSounds.play("voice-flag");
this.flagAnnounced = true;
};
_root.Datacap = function (formID, thirdPartySubmit) {
this.formID = formID;
this.thirdPartySubmit = thirdPartySubmit;
this.controls = [];
this.formInstance = undefined;
this.sendingFrame = "";
this.successFrame = "";
this.failureFrame = "";
this.userID = 0;
this.customIsValid = undefined;
this.preSubmit = undefined;
this.onSuccess = undefined;
this.onFailure = undefined;
this.datacapURL = "http://www.deeperbeige.com/datacap/datacap";
if (_level0.debug) {
trace("Creating data form, ID=" + formID);
}
var _local4 = SharedObject.getLocal("cmuDatacap");
if (_local4.data.userID == undefined) {
_local4.data.userID = Math.floor(Math.random() * 100000000) + 100000000;
}
this.userID = _local4.data.userID;
_local4.flush();
this.registerTextbox = function (varName, instance, errorMarker) {
if (_level0.debug) {
trace((("Registered textbox " + varName) + " errorMarker=") + errorMarker);
}
if (instance == undefined) {
trace(("Error: Instance not found for textbox " + varName) + "");
}
this.controls.push({style:"textbox", varName:varName, instance:instance, errorMarker:errorMarker, isValid:this.validateTextbox, autoFill:this.autoFillTextbox});
instance.tabIndex = this.controls.length;
instance.objForm = this;
errorMarker._visible = false;
};
this.validateTextbox = function (control) {
if (control.errorMarker != undefined) {
if ((control.instance.text == undefined) || (control.instance.text == "")) {
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Invalid");
}
control.errorMarker._visible = true;
return(false);
}
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Valid");
}
control.errorMarker._visible = false;
return(true);
}
return(true);
};
this.autoFillTextbox = function (control) {
var _local1 = SharedObject.getLocal("cmuDatacap");
if (_local1.data[control.varName] != undefined) {
control.instance.text = _local1.data[control.varName];
}
};
this.registerEmailbox = function (varName, instance, errorMarker) {
if (_level0.debug) {
trace((("Registered emailbox " + varName) + " errorMarker=") + errorMarker);
}
if (instance == undefined) {
trace(("Error: Instance not found for emailbox " + varName) + "");
}
this.controls.push({style:"emailbox", varName:varName, instance:instance, errorMarker:errorMarker, isValid:this.validateEmailbox, autoFill:this.autoFillEmailbox});
instance.tabIndex = this.controls.length;
instance.objForm = this;
errorMarker._visible = false;
};
this.validateEmailbox = function (control) {
if (control.errorMarker != undefined) {
var _local3 = true;
if (control.instance.text == undefined) {
_local3 = false;
}
if (control.instance.text == "") {
_local3 = false;
}
var _local5 = control.instance.text.split("@");
if (_local5.length != 2) {
_local3 = false;
}
if (_local5[0] == "") {
_local3 = false;
}
var _local2 = _local5[1].split(".");
if (_local2.length < 2) {
_local3 = false;
}
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == "") {
_local3 = false;
}
_local1++;
}
if (_local3) {
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Invalid");
}
control.errorMarker._visible = false;
return(true);
}
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Valid");
}
control.errorMarker._visible = true;
return(false);
}
return(true);
};
this.autoFillEmailbox = function (control) {
var _local1 = SharedObject.getLocal("cmuDatacap");
if (_local1.data[control.varName] != undefined) {
control.instance.text = _local1.data[control.varName];
}
};
this.registerCheckbox = function (varName, instance, errorMarker) {
if (_level0.debug) {
trace((("Registered checkbox " + varName) + " errorMarker=") + errorMarker);
}
if (instance == undefined) {
trace(("Error: Instance not found for checkbox " + varName) + "");
}
this.controls.push({style:"checkbox", varName:varName, instance:instance, errorMarker:errorMarker, isValid:this.validateCheckbox, autoFill:this.autoFillCheckbox});
instance.tabIndex = this.controls.length;
instance.objForm = this;
errorMarker._visible = false;
};
this.validateCheckbox = function (control) {
if (control.errorMarker != undefined) {
if (_level0.debug) {
trace((("Validating " + control.style) + " ") + control.varName);
}
if (control.instance.selected != true) {
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Invalid");
}
control.errorMarker._visible = true;
return(false);
}
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Valid");
}
control.errorMarker._visible = false;
return(true);
}
return(true);
};
this.autoFillCheckbox = function (control) {
var _local1 = SharedObject.getLocal("cmuDatacap");
if (_local1.data[control.varName] != undefined) {
control.instance.selected = _local1.data[control.varName];
}
};
this.registerRadioSet = function (varName, instance, errorMarker) {
if (_level0.debug) {
trace((("Registered radioset " + varName) + " errorMarker=") + errorMarker);
}
if (instance == undefined) {
trace(("Error: Instance not found for radioset " + varName) + "");
}
this.controls.push({style:"radioset", varName:varName, instance:instance, errorMarker:errorMarker, isValid:this.validateRadioSet, autoFill:this.autoFillRadioSet});
instance.tabIndex = this.controls.length;
instance.objForm = this;
errorMarker._visible = false;
};
this.validateRadioSet = function (control) {
if (control.errorMarker != undefined) {
if (control.instance.selection == undefined) {
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Invalid");
}
control.errorMarker._visible = true;
return(false);
}
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Valid");
}
control.errorMarker._visible = false;
return(true);
}
return(true);
};
this.autoFillRadioSet = function (control) {
return(undefined);
};
this.registerDropdown = function (varName, instance, errorMarker) {
if (_level0.debug) {
trace((("Registered dropdown " + varName) + " errorMarker=") + errorMarker);
}
if (instance == undefined) {
trace(("Error: Instance not found for dropdown " + varName) + "");
}
this.controls.push({style:"dropdown", varName:varName, instance:instance, errorMarker:errorMarker, isValid:this.validateDropdown, autoFill:this.autoFillDropdown});
instance.tabIndex = this.controls.length;
instance.objForm = this;
errorMarker._visible = false;
};
this.validateDropdown = function (control) {
if (control.errorMarker != undefined) {
if (control.instance.selectedIndex == 0) {
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Invalid");
}
control.errorMarker._visible = true;
return(false);
}
if (_level0.debug) {
trace(((("Validating " + control.style) + " ") + control.varName) + ": Valid");
}
control.errorMarker._visible = false;
return(true);
}
return(true);
};
this.autoFillDropdown = function (control) {
var _local1 = SharedObject.getLocal("cmuDatacap");
if (_local1.data[control.varName] != undefined) {
control.instance.selectedIndex = _local1.data[control.varName];
}
};
this.registerSubmit = function (varName, instance, value) {
if (_level0.debug) {
trace((("Registered submit button " + varName) + " errorMarker=") + errorMarker);
}
if (instance == undefined) {
trace(("Error: Instance not found for submit button " + varName) + "");
}
this.controls.push({style:"submit", varName:varName, instance:instance, value:value});
instance.objForm = this;
instance.tabIndex = this.controls.length;
instance.onRelease = this.submitForm;
};
this.setHiddenValue = function (varName, value) {
if (_level0.debug) {
trace((("Set hidden value " + varName) + "=") + value);
}
var _local3;
var _local2 = 0;
while (_local2 < this.controls.length) {
if (this.controls[_local2].style == "hidden") {
if (this.controls[_local2].varName == varName) {
_local3 = _local2;
}
}
_local2++;
}
if (_local3 == undefined) {
this.controls.push({style:"hidden", varName:varName, value:value});
} else {
this.controls[_local3].value = value;
}
};
this.registerFrames = function (sendingFrame, successFrame, failureFrame, formInstance) {
if (_level0.debug) {
trace("Registered frames for instance " + formInstance);
}
if (formInstance == undefined) {
trace("Error: Registering frames, form instance invalid");
}
this.formInstance = formInstance;
this.sendingFrame = sendingFrame;
this.successFrame = successFrame;
this.failureFrame = failureFrame;
};
this.registerCallbacks = function (customIsValid, preSubmit, onSuccess, onFailure) {
if (_level0.debug) {
trace("Registered callbacks");
}
this.customIsValid = customIsValid;
this.preSubmit = preSubmit;
this.onSuccess = onSuccess;
this.onFailure = onFailure;
};
this.submitForm = function () {
if (_level0.debug) {
trace("Submit pressed - validating");
}
var _local6 = true;
if (this.objForm.customIsValid != undefined) {
if (!this.objForm.customIsValid()) {
_local6 = false;
}
}
var _local2 = 0;
while (_local2 < this.objForm.controls.length) {
if (this.objForm.controls[_local2].isValid != undefined) {
if (!this.objForm.controls[_local2].isValid(this.objForm.controls[_local2])) {
_local6 = false;
}
}
_local2++;
}
if (_local6) {
if (_level0.debug) {
trace("Form validated - sending");
}
if (_level0.debug) {
trace("Submitting form");
}
var _local5 = new LoadVars();
var _local7 = new LoadVars();
_local7.objForm = this.objForm;
this.objForm.preSubmit();
var _local4 = SharedObject.getLocal("cmuDatacap");
_local2 = 0;
while (_local2 < this.objForm.controls.length) {
var _local3 = "";
switch (this.objForm.controls[_local2].style) {
case "textbox" :
_local3 = this.objForm.controls[_local2].instance.text;
_local4.data[this.objForm.controls[_local2].varName] = _local3;
break;
case "emailbox" :
_local3 = this.objForm.controls[_local2].instance.text;
_local4.data[this.objForm.controls[_local2].varName] = _local3;
break;
case "checkbox" :
_local3 = (this.objForm.controls[_local2].instance.selected ? true : false);
_local4.data[this.objForm.controls[_local2].varName] = _local3;
break;
case "radioset" :
_local3 = this.objForm.controls[_local2].instance.selection.data;
break;
case "dropdown" :
_local3 = this.objForm.controls[_local2].instance.selectedItem.data;
_local4.data[this.objForm.controls[_local2].varName] = this.objForm.controls[_local2].instance.selectedIndex;
break;
case "hidden" :
_local3 = this.objForm.controls[_local2].value;
break;
case "submit" :
_local3 = this.objForm.controls[_local2].value;
this.objForm.controls[_local2].instance._visible = false;
break;
default :
trace("Unhandled component style " + this.objForm.controls[_local2].style);
}
if (_level0.debug) {
trace(((" " + this.objForm.controls[_local2].varName) + " = ") + _local3);
}
_local5[this.objForm.controls[_local2].varName] = _local3;
_local2++;
}
_local4.flush();
_local5.userID = this.objForm.userID;
_local5.formID = this.objForm.formID;
_local7.onLoad = function (success) {
trace("SUCCESS: " + success);
if (success) {
if (_level0.debug) {
trace("Success");
}
this.objForm.onSuccess();
if (this.objForm.formInstance != undefined) {
this.objForm.formInstance.gotoAndStop(this.objForm.successFrame);
}
} else {
if (_level0.debug) {
trace("Failed");
}
this.objForm.onFailure();
if (this.objForm.formInstance != undefined) {
this.objForm.formInstance.gotoAndStop(this.objForm.failureFrame);
}
}
};
var _local8 = (this.objForm.datacapURL + ((this.objForm.thirdPartySubmit == undefined) ? "" : ("_" + this.objForm.thirdPartySubmit))) + ".php";
_local5.sendAndLoad(_local8, _local7, "POST");
if (this.objForm.formInstance != undefined) {
this.objForm.formInstance.gotoAndStop(this.objForm.sendingFrame);
}
} else if (_level0.debug) {
trace("Form data not validated");
}
};
this.autoFill = function () {
var _local2 = 0;
while (_local2 < this.controls.length) {
this.controls[_local2].autoFill(this.controls[_local2]);
_local2++;
}
};
this.onKeyDown = function () {
if ((Key.isDown(16) && (Key.isDown(17))) && (Key.isDown(192))) {
this.autoFill();
}
};
Key.addListener(this);
trace("Press ctrl+shift+@ to autofill form with previously entered values");
this.initCountryDropDown = function (dropdownClip) {
dropdownClip.addItem("Select Country", "NIL");
dropdownClip.addItem("United Kingdom", "GB");
dropdownClip.addItem("Ireland", "IE");
dropdownClip.addItem("France", "FR");
dropdownClip.addItem("Spain", "ES");
dropdownClip.addItem("Netherlands", "NL");
dropdownClip.addItem("Italy", "IT");
dropdownClip.addItem("Germany", "DE");
dropdownClip.addItem("United States", "US");
dropdownClip.addItem("Canada", "CA");
dropdownClip.addItem("---------------------", "--");
dropdownClip.addItem("Afghanistan", "AF");
dropdownClip.addItem("Albania", "AL");
dropdownClip.addItem("Algeria", "DZ");
dropdownClip.addItem("American Samoa", "AS");
dropdownClip.addItem("Andorra", "AD");
dropdownClip.addItem("Angola", "AO");
dropdownClip.addItem("Anguilla", "AI");
dropdownClip.addItem("Antarctica", "AQ");
dropdownClip.addItem("Antigua And Barbuda", "AG");
dropdownClip.addItem("Argentina", "AR");
dropdownClip.addItem("Armenia", "AM");
dropdownClip.addItem("Aruba", "AW");
dropdownClip.addItem("Australia", "AU");
dropdownClip.addItem("Austria", "AT");
dropdownClip.addItem("Azerbaijan", "AZ");
dropdownClip.addItem("Bahamas", "BS");
dropdownClip.addItem("Bahrain", "BH");
dropdownClip.addItem("Bangladesh", "BD");
dropdownClip.addItem("Barbados", "BB");
dropdownClip.addItem("Belarus", "BY");
dropdownClip.addItem("Belgium", "BE");
dropdownClip.addItem("Belize", "BZ");
dropdownClip.addItem("Benin", "BJ");
dropdownClip.addItem("Bermuda", "BM");
dropdownClip.addItem("Bhutan", "BT");
dropdownClip.addItem("Bolivia", "BO");
dropdownClip.addItem("Bosnia And Herzegowina", "BA");
dropdownClip.addItem("Botswana", "BW");
dropdownClip.addItem("Bouvet Island", "BV");
dropdownClip.addItem("Brazil", "BR");
dropdownClip.addItem("British Indian Ocean Territory", "IO");
dropdownClip.addItem("Brunei Darussalam", "BN");
dropdownClip.addItem("Bulgaria", "BG");
dropdownClip.addItem("Burkina Faso", "BF");
dropdownClip.addItem("Burundi", "BI");
dropdownClip.addItem("Cambodia", "KH");
dropdownClip.addItem("Cameroon", "CM");
dropdownClip.addItem("Cape Verde", "CV");
dropdownClip.addItem("Cayman Islands", "KY");
dropdownClip.addItem("Central African Republic", "CF");
dropdownClip.addItem("Chad", "TD");
dropdownClip.addItem("Chile", "CL");
dropdownClip.addItem("China", "CN");
dropdownClip.addItem("Christmas Island", "CX");
dropdownClip.addItem("Cocos (Keeling) Islands", "CC");
dropdownClip.addItem("Colombia", "CO");
dropdownClip.addItem("Comoros", "KM");
dropdownClip.addItem("Congo", "CG");
dropdownClip.addItem("Cook Islands", "CK");
dropdownClip.addItem("Costa Rica", "CR");
dropdownClip.addItem("Cote D'Ivoire", "CI");
dropdownClip.addItem("Croatia (Local Name: Hrvatska)", "HR");
dropdownClip.addItem("Cuba", "CU");
dropdownClip.addItem("Cyprus", "CY");
dropdownClip.addItem("Czech Republic", "CZ");
dropdownClip.addItem("Denmark", "DK");
dropdownClip.addItem("Djibouti", "DJ");
dropdownClip.addItem("Dominica", "DM");
dropdownClip.addItem("Dominican Republic", "DO");
dropdownClip.addItem("East Timor", "TP");
dropdownClip.addItem("Ecuador", "EC");
dropdownClip.addItem("Egypt", "EG");
dropdownClip.addItem("El Salvador", "SV");
dropdownClip.addItem("Equatorial Guinea", "GQ");
dropdownClip.addItem("Eritrea", "ER");
dropdownClip.addItem("Estonia", "EE");
dropdownClip.addItem("Ethiopia", "ET");
dropdownClip.addItem("Falkland Islands (Malvinas)", "FK");
dropdownClip.addItem("Faroe Islands", "FO");
dropdownClip.addItem("Fiji", "FJ");
dropdownClip.addItem("Finland", "FI");
dropdownClip.addItem("French Guiana", "GF");
dropdownClip.addItem("French Polynesia", "PF");
dropdownClip.addItem("French Southern Territories", "TF");
dropdownClip.addItem("Gabon", "GA");
dropdownClip.addItem("Gambia", "GM");
dropdownClip.addItem("Georgia", "GE");
dropdownClip.addItem("Ghana", "GH");
dropdownClip.addItem("Gibraltar", "GI");
dropdownClip.addItem("Greece", "GR");
dropdownClip.addItem("Greenland", "GL");
dropdownClip.addItem("Grenada", "GD");
dropdownClip.addItem("Guadeloupe", "GP");
dropdownClip.addItem("Guam", "GU");
dropdownClip.addItem("Guatemala", "GT");
dropdownClip.addItem("Guinea", "GN");
dropdownClip.addItem("Guinea-Bissau", "GW");
dropdownClip.addItem("Guyana", "GY");
dropdownClip.addItem("Haiti", "HT");
dropdownClip.addItem("Heard And Mc Donald Islands", "HM");
dropdownClip.addItem("Holy See (Vatican City State)", "VA");
dropdownClip.addItem("Honduras", "HN");
dropdownClip.addItem("Hong Kong", "HK");
dropdownClip.addItem("Hungary", "HU");
dropdownClip.addItem("Icel And", "IS");
dropdownClip.addItem("India", "IN");
dropdownClip.addItem("Indonesia", "ID");
dropdownClip.addItem("Iran (Islamic Republic Of)", "IR");
dropdownClip.addItem("Iraq", "IQ");
dropdownClip.addItem("Israel", "IL");
dropdownClip.addItem("Jamaica", "JM");
dropdownClip.addItem("Japan", "JP");
dropdownClip.addItem("Jordan", "JO");
dropdownClip.addItem("Kazakhstan", "KZ");
dropdownClip.addItem("Kenya", "KE");
dropdownClip.addItem("Kiribati", "KI");
dropdownClip.addItem("Korea, Dem People'S Republic", "KP");
dropdownClip.addItem("Korea, Republic Of", "KR");
dropdownClip.addItem("Kuwait", "KW");
dropdownClip.addItem("Kyrgyzstan", "KG");
dropdownClip.addItem("Lao People'S Dem Republic", "LA");
dropdownClip.addItem("Latvia", "LV");
dropdownClip.addItem("Lebanon", "LB");
dropdownClip.addItem("Lesotho", "LS");
dropdownClip.addItem("Liberia", "LR");
dropdownClip.addItem("Libyan Arab Jamahiriya", "LY");
dropdownClip.addItem("Liechtenstein", "LI");
dropdownClip.addItem("Lithuania", "LT");
dropdownClip.addItem("Luxembourg", "LU");
dropdownClip.addItem("Macau", "MO");
dropdownClip.addItem("Macedonia", "MK");
dropdownClip.addItem("Madagascar", "MG");
dropdownClip.addItem("Malawi", "MW");
dropdownClip.addItem("Malaysia", "MY");
dropdownClip.addItem("Maldives", "MV");
dropdownClip.addItem("Mali", "ML");
dropdownClip.addItem("Malta", "MT");
dropdownClip.addItem("Marshall Islands", "MH");
dropdownClip.addItem("Martinique", "MQ");
dropdownClip.addItem("Mauritania", "MR");
dropdownClip.addItem("Mauritius", "MU");
dropdownClip.addItem("Mayotte", "YT");
dropdownClip.addItem("Mexico", "MX");
dropdownClip.addItem("Micronesia, Federated States", "FM");
dropdownClip.addItem("Moldova, Republic Of", "MD");
dropdownClip.addItem("Monaco", "MC");
dropdownClip.addItem("Mongolia", "MN");
dropdownClip.addItem("Montserrat", "MS");
dropdownClip.addItem("Morocco", "MA");
dropdownClip.addItem("Mozambique", "MZ");
dropdownClip.addItem("Myanmar", "MM");
dropdownClip.addItem("Namibia", "NA");
dropdownClip.addItem("Nauru", "NR");
dropdownClip.addItem("Nepal", "NP");
dropdownClip.addItem("Netherlands Ant Illes", "AN");
dropdownClip.addItem("New Caledonia", "NC");
dropdownClip.addItem("New Zealand", "NZ");
dropdownClip.addItem("Nicaragua", "NI");
dropdownClip.addItem("Niger", "NE");
dropdownClip.addItem("Nigeria", "NG");
dropdownClip.addItem("Niue", "NU");
dropdownClip.addItem("Norfolk Island", "NF");
dropdownClip.addItem("Northern Mariana Islands", "MP");
dropdownClip.addItem("Norway", "NO");
dropdownClip.addItem("Oman", "OM");
dropdownClip.addItem("Pakistan", "PK");
dropdownClip.addItem("Palau", "PW");
dropdownClip.addItem("Panama", "PA");
dropdownClip.addItem("Papua New Guinea", "PG");
dropdownClip.addItem("Paraguay", "PY");
dropdownClip.addItem("Peru", "PE");
dropdownClip.addItem("Philippines", "PH");
dropdownClip.addItem("Pitcairn", "PN");
dropdownClip.addItem("Poland", "PL");
dropdownClip.addItem("Portugal", "PT");
dropdownClip.addItem("Puerto Rico", "PR");
dropdownClip.addItem("Qatar", "QA");
dropdownClip.addItem("Reunion", "RE");
dropdownClip.addItem("Romania", "RO");
dropdownClip.addItem("Russian Federation", "RU");
dropdownClip.addItem("Rwanda", "RW");
dropdownClip.addItem("Saint K Itts And Nevis", "KN");
dropdownClip.addItem("Saint Lucia", "LC");
dropdownClip.addItem("Saint Vincent, The Grenadines", "VC");
dropdownClip.addItem("Samoa", "WS");
dropdownClip.addItem("San Marino", "SM");
dropdownClip.addItem("Sao Tome And Principe", "ST");
dropdownClip.addItem("Saudi Arabia", "SA");
dropdownClip.addItem("Senegal", "SN");
dropdownClip.addItem("Seychelles", "SC");
dropdownClip.addItem("Sierra Leone", "SL");
dropdownClip.addItem("Singapore", "SG");
dropdownClip.addItem("Slovakia (Slovak Republic)", "SK");
dropdownClip.addItem("Slovenia", "SI");
dropdownClip.addItem("Solomon Islands", "SB");
dropdownClip.addItem("Somalia", "SO");
dropdownClip.addItem("South Africa", "ZA");
dropdownClip.addItem("South Georgia , S Sandwich Is.", "GS");
dropdownClip.addItem("Sri Lanka", "LK");
dropdownClip.addItem("St. Helena", "SH");
dropdownClip.addItem("St. Pierre And Miquelon", "PM");
dropdownClip.addItem("Sudan", "SD");
dropdownClip.addItem("Suriname", "SR");
dropdownClip.addItem("Svalbard, Jan Mayen Islands", "SJ");
dropdownClip.addItem("Sw Aziland", "SZ");
dropdownClip.addItem("Sweden", "SE");
dropdownClip.addItem("Switzerland", "CH");
dropdownClip.addItem("Syrian Arab Republic", "SY");
dropdownClip.addItem("Taiwan", "TW");
dropdownClip.addItem("Tajikistan", "TJ");
dropdownClip.addItem("Tanzania, United Republic Of", "TZ");
dropdownClip.addItem("Thailand", "TH");
dropdownClip.addItem("Togo", "TG");
dropdownClip.addItem("Tokelau", "TK");
dropdownClip.addItem("Tonga", "TO");
dropdownClip.addItem("Trinidad And Tobago", "TT");
dropdownClip.addItem("Tunisia", "TN");
dropdownClip.addItem("Turkey", "TR");
dropdownClip.addItem("Turkmenistan", "TM");
dropdownClip.addItem("Turks And Caicos Islands", "TC");
dropdownClip.addItem("Tuvalu", "TV");
dropdownClip.addItem("Uganda", "UG");
dropdownClip.addItem("Ukraine", "UA");
dropdownClip.addItem("United Arab Emirates", "AE");
dropdownClip.addItem("United States Minor Is.", "UM");
dropdownClip.addItem("Uruguay", "UY");
dropdownClip.addItem("Uzbekistan", "UZ");
dropdownClip.addItem("Vanuatu", "VU");
dropdownClip.addItem("Venezuela", "VE");
dropdownClip.addItem("Viet Nam", "VN");
dropdownClip.addItem("Virgin Islands (British)", "VG");
dropdownClip.addItem("Virgin Islands (U.S.)", "VI");
dropdownClip.addItem("Wallis And Futuna Islands", "WF");
dropdownClip.addItem("Western Sahara", "EH");
dropdownClip.addItem("Yemen", "YE");
dropdownClip.addItem("Yugoslavia", "YU");
dropdownClip.addItem("Zaire", "ZR");
dropdownClip.addItem("Zambia", "ZM");
dropdownClip.addItem("Zimbabwe", "ZW");
dropdownClip.setSelectedIndex(0);
};
this.initMobilesDropdown = function (dropdownClip) {
mobiles = new Array();
dropdownClip.addItem("Select manufacturer", "NIL");
dropdownClip.addItem("NOKIA", "NOKIA");
dropdownClip.addItem("MOTOROLA", "MOTOROLA");
dropdownClip.addItem("SAMSUNG", "SAMSUNG");
dropdownClip.addItem("SONY ERICSSON", "ERICSSON");
dropdownClip.addItem("ALCATEL", "ALCATEL");
dropdownClip.addItem("LG", "LG");
dropdownClip.addItem("NEC", "NEC");
dropdownClip.addItem("PANASONIC", "PANASONIC");
dropdownClip.addItem("SAGEM", "SAGEM");
dropdownClip.addItem("SIEMENS", "SIEMENS");
dropdownClip.addItem("SHARP", "SHARP");
dropdownClip.addItem("TRIUM", "TRIUM");
dropdownClip.addItem("HANDSPRING", "HANDSPRING");
dropdownClip.addItem("POGO", "POGO");
dropdownClip.setSelectedItem(0);
};
this.initDateDropdowns = function (dropdownYear, dropdownMonth, dropdownDay) {
dropdownDay.addItem("DD");
var _local1 = 1;
while (_local1 <= 31) {
dropdownDay.addItem(_local1, _local1);
_local1++;
}
dropdownDay.setSelectedIndex(0);
dropdownMonth.addItem("MM");
_local1 = 1;
while (_local1 <= 12) {
dropdownMonth.addItem(_local1, _local1);
_local1++;
}
dropdownMonth.setSelectedIndex(0);
dropdownYear.addItem("YYYY");
_local1 = 2007;
while (_local1 >= 1900) {
dropdownYear.addItem(_local1, _local1);
_local1--;
}
dropdownYear.setSelectedIndex(0);
};
};
initGame();
initSounds();
_root.objSounds.play("voice-title");
Frame 41
stop();
setupLevelIndicators(selector);
_root.objSounds.removeAllSources();
Frame 51
setupQuiz();
_root.trackPoint("Section_quiz");
Frame 61
_root.trackPoint("Section_downloads");
Frame 71
stop();
_root.trackPoint("Section_wipeprogress");
Frame 81
stop();
setupAchievements();
_root.trackPoint("Section_achievements");
Frame 91
stop();
_root.trackPoint("Section_vehicles");
setupVehicles();
Frame 101
stop();
_root.trackPoint("Section_feedback");
Frame 111
stop();
com.deeperbeige.utils.Profiler.setClip(fps);
com.deeperbeige.utils.Profiler.setActive(true);
com.deeperbeige.utils.Profiler.setTracing(false);
_root.menuFireworks = false;
var objGame = new ChoppaGame(game);
Frame 121
play();
Frame 122
_root.objTrans.curFrame = "game";
gotoAndStop ("game");
Frame 131
stop();
_root.trackPoint("Section_completewin");
Frame 141
stop();
_root.trackPoint("Section_challengewin");
Frame 151
stop();
_root.trackPoint("Section_classicwin");
Symbol 42 MovieClip Frame 1
gotoAndStop(Math.floor(Math.random() * (this._totalframes - 2)) + 2);
Symbol 43 MovieClip Frame 1
gotoAndPlay ("in");
Symbol 43 MovieClip Frame 50
stop();
Symbol 47 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 1
stop();
Symbol 81 Button
on (release) {
_root.gotoSponsor();
}
Symbol 85 Button
on (release) {
_root.musicMuted = !_root.musicMuted;
if (_root.musicMuted) {
_root.objSounds.stop("music");
} else {
_root.startMusic();
}
noSound._visible = _root.objSounds.muted;
noMusic._visible = _root.musicMuted;
}
Symbol 88 Button
on (release) {
_root.objSounds.setMute(!_root.objSounds.muted);
if (_root.objSounds.muted) {
_root.musicMuted = true;
}
_root.startMusic();
noSound._visible = _root.objSounds.muted;
noMusic._visible = _root.musicMuted;
}
Symbol 92 MovieClip Frame 1
stop();
Instance of Symbol 90 MovieClip "noSound" in Symbol 92 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 90 MovieClip "noMusic" in Symbol 92 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 107 Button
on (release) {
_root.gotoSponsor();
}
Symbol 118 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 13
_root.objSounds.play("bleep", 30);
Symbol 118 MovieClip Frame 17
_root.objSounds.play("bleep", 30);
Symbol 118 MovieClip Frame 19
stop();
Symbol 118 MovieClip Frame 30
_root.objSounds.play("bleep", 15);
Symbol 118 MovieClip Frame 34
_root.objSounds.play("bleep", 30);
Symbol 118 MovieClip Frame 36
stop();
Symbol 2648 MovieClip [__Packages.com.mosesSupposes.fuse.Shortcuts] Frame 0
class com.mosesSupposes.fuse.Shortcuts
{
function Shortcuts () {
}
static function initialize() {
if (shortcuts == null) {
initShortcuts();
}
}
static function doShortcut(obj, methodName) {
initialize();
var _local5 = shortcuts[methodName];
if (_local5 == undefined) {
if (typeof(obj) == "movieclip") {
_local5 = mcshortcuts[methodName];
}
}
if (_local5 == undefined) {
return(null);
}
obj = arguments.shift();
methodName = String(arguments.shift());
if (!(obj instanceof Array)) {
obj = [obj];
}
var _local3 = "";
for (var _local6 in obj) {
var _local2 = String(_local5.apply(obj[_local6], arguments));
if ((_local2 != null) && (_local2.length > 0)) {
if (_local3.length > 0) {
_local3 = (_local2 + "|") + _local3;
} else {
_local3 = _local2;
}
}
}
return(((_local3 == "") ? null : (_local3)));
}
static function addShortcutsTo() {
initialize();
var _local5 = function (o, so) {
for (var _local5 in so) {
var _local2 = so[_local5];
if (_local2.getter || (_local2.setter)) {
o.addProperty(_local5, _local2.getter, _local2.setter);
_global.ASSetPropFlags(o, _local5, 3, 1);
} else {
o[_local5] = _local2;
_global.ASSetPropFlags(o, _local5, 7, 1);
}
}
};
for (var _local7 in arguments) {
var _local4 = arguments[_local7];
if ((_local4 == MovieClip.prototype) || (typeof(_local4) == "movieclip")) {
_local5(_local4, mcshortcuts);
}
_local5(_local4, shortcuts);
}
}
static function removeShortcutsFrom() {
initialize();
var _local5 = function (o, so) {
for (var _local5 in so) {
_global.ASSetPropFlags(o, _local5, 0, 2);
var _local2 = so[_local5];
if (_local2.getter || (_local2.setter)) {
o.addProperty(_local5, null, null);
}
delete o[_local5];
}
};
for (var _local7 in arguments) {
var _local3 = arguments[_local7];
if ((_local3 == MovieClip.prototype) || (typeof(_local3) == "movieclip")) {
_local5(_local3, mcshortcuts);
}
_local5(_local3, shortcuts);
}
}
static function parseStringTypeCallback(callbackStr) {
var evaluate = function (val) {
var first = val.charAt(0);
if ((first == val.slice(-1)) && ((first == "\"") || (first == "'"))) {
return(val.slice(1, -1));
}
if (val == "true") {
return(Object(true));
}
if (val == "false") {
return(Object(false));
}
if (val == "null") {
return(Object(null));
}
if (_global.isNaN(Number(val)) == false) {
return(Object(Number(val)));
}
return(Object(eval (val)));
};
var trimWhite = function (str) {
while (str.charAt(0) == " ") {
str = str.slice(1);
}
while (str.slice(-1) == " ") {
str = str.slice(0, -1);
}
return(str);
};
var evaluateList = function (list) {
var _local11 = [];
var _local4 = 0;
while (_local4 < list.length) {
var _local3 = list[_local4];
_local3 = trimWhite(_local3);
var _local5 = (_local3.charAt(0) == "{") && ((_local3.indexOf("}") > -1) || (_local3.indexOf(":") > -1));
var _local10 = _local3.charAt(0) == "[";
if ((_local5 || (_local10)) == true) {
var _local6 = ((_local5 == true) ? ({}) : ([]));
var _local2 = _local4;
while (_local2 < list.length) {
if (_local2 == _local4) {
_local3 = _local3.slice(1);
}
var _local1;
var _local8 = (_local1.slice(-1) == ((_local5 == true) ? "}" : "]")) || (_local2 == (list.length - 1));
if (_local8 == true) {
_local1 = _local1.slice(0, -1);
}
if ((_local5 == true) && (_local1.indexOf(":") > -1)) {
var _local7 = _local1.split(":");
_local6[trimWhite(_local7[0])] = evaluate(trimWhite(_local7[1]));
} else if (_local10 == true) {
_local6.push(evaluate(trimWhite(_local1)));
}
if (_local8 == true) {
_local11.push(_local6);
_local4 = _local2;
break;
}
_local2++;
}
} else {
_local11.push(evaluate(trimWhite(_local3)));
}
_local4++;
}
return(_local11);
};
var parts = callbackStr.split("(");
var p0 = parts[0];
var p1 = parts[1];
return({func:p0.slice(p0.lastIndexOf(".") + 1), scope:eval (p0.slice(0, p0.lastIndexOf("."))), args:evaluateList(p1.slice(0, p1.lastIndexOf(")")).split(","))});
}
static function initShortcuts() {
shortcuts = new Object();
var methods = {alphaTo:"_alpha", scaleTo:"_scale", sizeTo:"_size", rotateTo:"_rotation", brightnessTo:"_brightness", brightOffsetTo:"_brightOffset", contrastTo:"_contrast", colorTo:"_tint", tintPercentTo:"_tintPercent", colorResetTo:"_colorReset", invertColorTo:"_invertColor"};
var _local4 = _global.com.mosesSupposes.fuse.FuseFMP.getAllShortcuts();
var _local7 = {blur:1, blurX:1, blurY:1, strength:1, shadowAlpha:1, highlightAlpha:1, angle:1, distance:1, alpha:1, color:1};
for (var _local9 in _local4) {
if (_local7[_local4[_local9].split("_")[1]] === 1) {
methods[_local4[_local9] + "To"] = _local4[_local9];
}
}
var _local8 = {__resolve:function (name) {
var propName = methods[name];
return(function () {
var _local4 = _global.com.mosesSupposes.fuse.ZigoEngine.doTween.apply(com.mosesSupposes.fuse.ZigoEngine, new Array(this, propName).concat(arguments));
return(_local4);
});
}};
var _local5 = {__resolve:function (name) {
var _local3 = {setter:function (v) {
_global.com.mosesSupposes.fuse.ZigoEngine.doTween(this, ((name == "_tintString") ? "_tint" : (name)), v, 0);
}};
switch (name) {
case "_colorReset" :
_local3.getter = function () {
return(100 - _global.com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(this).tintPercent);
};
break;
case "_colorTransform" :
_local3.getter = function () {
return(Color(new Color(this)).getTransform());
};
break;
case "_fade" :
_local3.getter = function () {
return(this._alpha);
};
break;
case "_size" :
_local3.getter = function () {
return(((this._width == this._height) ? (this._width) : null));
};
break;
case "_scale" :
_local3.getter = function () {
return(((this._xscale == this._yscale) ? (this._xscale) : null));
};
break;
default :
_local3.getter = function () {
return(_global.com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(this)[name.slice(1)]);
};
}
return(_local3);
}};
for (var _local9 in methods) {
shortcuts[_local9] = _local8[_local9];
if ((_local9 != "alphaTo") && (_local9 != "rotateTo")) {
shortcuts[methods[_local9]] = _local5[methods[_local9]];
}
}
shortcuts._tintString = _local5._tintString;
shortcuts._colorTransform = _local5._colorTransform;
shortcuts._fade = _local5._fade;
shortcuts.tween = function (props, endVals, seconds, ease, delay, callback) {
if ((arguments.length == 1) && (typeof(props) == "object")) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween({target:this, action:props}));
}
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, props, endVals, seconds, ease, delay, callback));
};
shortcuts.removeTween = (shortcuts.stopTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.removeTween(this, props);
});
shortcuts.removeAllTweens = (shortcuts.stopAllTweens = function () {
com.mosesSupposes.fuse.ZigoEngine.removeTween("ALL");
});
shortcuts.isTweening = function (prop) {
return(com.mosesSupposes.fuse.ZigoEngine.isTweening(this, prop));
};
shortcuts.getTweens = function () {
return(com.mosesSupposes.fuse.ZigoEngine.getTweens(this));
};
shortcuts.lockTween = function () {
com.mosesSupposes.fuse.ZigoEngine.lockTween(this, true);
};
shortcuts.unlockTween = function () {
com.mosesSupposes.fuse.ZigoEngine.lockTween(this, false);
};
shortcuts.isTweenLocked = function () {
return(com.mosesSupposes.fuse.ZigoEngine.isTweenLocked(this));
};
shortcuts.isTweenPaused = function (prop) {
return(com.mosesSupposes.fuse.ZigoEngine.isTweenPaused(this, prop));
};
shortcuts.pauseTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.pauseTween(this, props);
};
shortcuts.resumeTween = (shortcuts.unpauseTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.unpauseTween(this, props);
});
shortcuts.pauseAllTweens = function () {
com.mosesSupposes.fuse.ZigoEngine.pauseTween("ALL");
};
shortcuts.resumeAllTweens = (shortcuts.unpauseAllTweens = function () {
com.mosesSupposes.fuse.ZigoEngine.unpauseTween("ALL");
});
shortcuts.ffTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.ffTween(this, props);
};
shortcuts.rewTween = function (props, suppressStartEvents) {
com.mosesSupposes.fuse.ZigoEngine.rewTween(this, props, false, suppressStartEvents);
};
shortcuts.rewAndPauseTween = function (props, suppressStartEvents) {
com.mosesSupposes.fuse.ZigoEngine.rewTween(this, props, true, suppressStartEvents);
};
shortcuts.skipTweenTo = function (seconds, props) {
com.mosesSupposes.fuse.ZigoEngine.skipTweenTo(seconds, this, props);
};
shortcuts.bezierTo = function (destX, destY, controlX, controlY, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_bezier_", {x:destX, y:destY, controlX:controlX, controlY:controlY}, seconds, ease, delay, callback));
};
shortcuts.colorTransformTo = function (ra, rb, ga, gb, ba, bb, aa, ab, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_colorTransform", {ra:ra, rb:rb, ga:ga, gb:gb, ba:ba, bb:bb, aa:aa, ab:ab}, seconds, ease, delay, callback));
};
shortcuts.tintTo = function (rgb, percent, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_tint", {tint:rgb, percent:percent}, seconds, ease, delay, callback));
};
shortcuts.slideTo = function (destX, destY, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_x,_y", [destX, destY], seconds, ease, delay, callback));
};
shortcuts.fadeIn = function (seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_fade", 100, seconds, ease, delay, callback));
};
shortcuts.fadeOut = function (seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_fade", 0, seconds, ease, delay, callback));
};
mcshortcuts = new Object();
mcshortcuts._frame = {getter:function () {
return(this._currentframe);
}, setter:function (v) {
this.gotoAndStop(Math.round(v));
}};
mcshortcuts.frameTo = function (endframe, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_frame", ((endframe != undefined) ? (endframe) : (this._totalframes)), seconds, ease, delay, callback));
};
}
static var registryKey = "shortcuts";
static var shortcuts = null;
static var mcshortcuts = null;
}
Symbol 2649 MovieClip [__Packages.com.mosesSupposes.fuse.FuseKitCommon] Frame 0
class com.mosesSupposes.fuse.FuseKitCommon
{
static var logOutput;
function FuseKitCommon () {
}
static function _cts() {
return("|_tint|_tintPercent|_brightness|_brightOffset|_contrast|_invertColor|_colorReset|_colorTransform|");
}
static function _resetTo100() {
return("|_alpha|_contrast|_invertColor|_tintPercent|_xscale|_yscale|_scale|");
}
static function _resetTo0() {
return("|_brightness|_brightOffset|_colorReset|_rotation|");
}
static function _underscoreable() {
return(_cts() + "_frame|_x|_y|_xscale|_yscale|_scale|_width|_height|_size|_rotation|_alpha|_fade|_visible|");
}
static function _cbprops() {
return("|skipLevel|cycles|roundResults|extra1|extra2|func|scope|args|startfunc|startscope|startargs|updfunc|updscope|updargs|");
}
static function _fuseEvents() {
return("|onStart|onStop|onPause|onResume|onAdvance|onComplete|");
}
static function _fuseprops() {
return("|command|label|delay|event|eventparams|target|addTarget|trigger|startAt|ease|easing|seconds|duration|time|");
}
static function _validateFuseCommand(c, inGroup, hasArg, outputLevel, simple) {
var _local1 = false;
var _local2 = false;
switch (c) {
case "start" :
case "stop" :
case "pause" :
case "resume" :
case "setStartProps" :
if (inGroup != true) {
_local1 = true;
}
break;
case "delay" :
case "trigger" :
if (simple == true) {
if (hasArg == true) {
_local1 = true;
}
} else {
_local2 = true;
}
inGroup = false;
break;
case "skipTo" :
if (!((hasArg == true) && (inGroup != true))) {
break;
}
_local1 = true;
}
if ((outputLevel > 0) && (_local1 == false)) {
error("109", c, inGroup, _local2);
}
return(_local1);
}
static function output(s) {
if (typeof(logOutput) == "function") {
logOutput(s);
} else {
trace(s);
}
}
static function error(errorCode) {
var _local3 = arguments[1];
var _local4 = arguments[2];
var _local6 = arguments[3];
if (VERBOSE != true) {
output(("[FuseKitCommon#" + errorCode) + "]");
return(undefined);
}
var _local2 = "";
var _local5 = newline;
switch (errorCode) {
case "001" :
_local2 = _local2 + "** ERROR: When using simpleSetup to extend prototypes, you must pass the Shortcuts class. **";
_local2 = _local2 + (_local5 + " import com.mosesSupposes.fuse.*;");
_local2 = _local2 + ((_local5 + " ZigoEngine.simpleSetup(Shortcuts);") + _local5);
break;
case "002" :
_local2 = _local2 + "** ZigoEngine.doShortcut: shortcuts missing. Use the setup commands: import com.mosesSupposes.fuse.*; ZigoEngine.register(Shortcuts); **";
break;
case "003" :
_local2 = _local2 + ((_local5 + "*** Error: DO NOT use #include \"lmc_tween.as\" with this version of ZigoEngine! ***") + _local5);
break;
case "004" :
_local2 = _local2 + (("** ZigoEngine.doTween - too few arguments [" + _local3) + "].");
if (Boolean(_local4) == true) {
_local2 = _local2 + " If you are trying to use Object Syntax without Fuse, pass FuseItem in your register() or simpleSetup() call. **";
} else {
_local2 = _local2 + " Object syntax call failed. **";
}
break;
case "005" :
_local2 = _local2 + (((("** ZigoEngine.doTween - missing targets[" + _local3) + "] and/or props[") + _local4) + "] **");
break;
case "006" :
_local2 = _local2 + (("** Error: easing shortcut string not recognized (\"" + _local3) + "\"). You may need to pass the in PennerEasing class during register or simpleSetup. **");
break;
case "007" :
_local2 = _local2 + (((("- ZigoEngine: Target locked [" + _local3) + "], ignoring tween call [") + _local4) + "]");
break;
case "008" :
_local2 = _local2 + "** You must register the Shortcuts class in order to use easy string-type callback parsing. **";
break;
case "009" :
_local2 = _local2 + (("** ZigoEngine: A callback parameter \"" + _local3) + "\" was not recognized. **");
break;
case "010" :
_local2 = _local2 + ((((("** " + ((_local3 == true) ? "ZigoEngine" : "FuseItem")) + " unable to parse ") + ((_local4 == 1) ? "callback[" : (String(_local4) + " callbacks["))) + _local6) + "]. Try using the syntax {scope:this, func:\"myFunction\"} **");
break;
case "011" :
_local2 = _local2 + (((("- ZigoEngine: Callbacks discarded via skipLevel 2 option [" + _local3) + "|") + _local4) + "].");
break;
case "012" :
_local2 = _local2 + (((((("- Engine set props or ignored no-change tween on: " + _local3) + ", props passed:[") + _local4) + "], endvals passed:[") + _local6) + "]");
break;
case "013" :
_local2 = _local2 + (((((("- Engine added tween on:\n\ttargets:[" + _local3) + "]\n\tprops:[") + _local4) + "]\n\tendvals:[") + _local6) + "]");
break;
case "014" :
_local2 = _local2 + "** Error: easing function passed is not usable with this engine. Functions need to follow the Robert Penner model. **";
break;
case "015" :
_local2 = _local2 + "** Error: The CustomEasing class must be passed during setup (register or simpleSetup) to use custom easing Arrays. **";
break;
case "016" :
_local2 = _local2 + (("[ ZigoEngine.TIME_MULTIPLIER: " + String(Number(Number(_local3) * 100))) + "% ]");
break;
case "101" :
_local2 = _local2 + "** ERROR: Fuse simpleSetup was removed in version 2.0! **";
_local2 = _local2 + (_local5 + " You must now use the following commands:");
_local2 = _local2 + ((_local5 + _local5) + "\timport com.mosesSupposes.fuse.*;");
_local2 = _local2 + (_local5 + "\tZigoEngine.simpleSetup(Shortcuts, PennerEasing, Fuse);");
_local2 = _local2 + ((_local5 + "Note that PennerEasing is optional, and FuseFMP is also accepted. (FuseFMP.simpleSetup is run automatically if included.)") + _local5);
break;
case "102" :
_local2 = _local2 + (((("** Fuse " + _local3) + " index or label not found (") + _local4) + ") or out of range. **");
break;
case "103" :
_local2 = _local2 + (((("** Fuse skipTo (" + _local3) + ") ignored - targets the current index (") + _local4) + "). **");
break;
case "104" :
_local2 = _local2 + (("** Fuse fastForward index out of play range (" + _local3) + ") - skipTo has been called instead. **");
break;
case "105" :
_local2 = _local2 + "** An unsupported Array method was called on Fuse. **";
break;
case "106" :
_local2 = _local2 + "** ERROR: You have not set up Fuse correctly. **";
_local2 = _local2 + (_local5 + "You must now use the following commands (PennerEasing is optional).");
_local2 = _local2 + (_local5 + "\timport com.mosesSupposes.fuse.*;");
_local2 = _local2 + ((_local5 + "\tZigoEngine.simpleSetup(Shortcuts, PennerEasing, Fuse);") + _local5);
break;
case "107" :
_local2 = _local2 + "** Fuse :: id not found - Aborting open(). **";
break;
case "108" :
_local2 = _local2 + "** Fuse.startRecent: No recent Fuse found to start! **";
break;
case "109" :
_local2 = _local2 + (("** Command \"" + _local3) + "\" discarded. ");
if (_local4 == true) {
_local2 = _local2 + "Not allowed within a group. **";
} else if (_local6 == true) {
_local2 = _local2 + (("Not supported in Object Syntax, use the " + _local3) + " property instead. **");
} else {
_local2 = _local2 + "The command may be unrecognized or missing an argument. **";
}
break;
case "110" :
_local2 = _local2 + (((("** " + _local3) + " illegal Fuse property discarded:\"") + _local4) + "\". Bezier keywords other than x and y cannot be set as start values. **");
break;
case "112" :
_local2 = _local2 + "** Fuse: missing com.mosesSupposes.fuse.ZigoEngine! Cannot tween. **";
break;
case "113" :
_local2 = _local2 + "** FuseItem: A callback has been discarded. Actions with a command may only contain: label, delay, scope, args. **";
break;
case "115" :
_local2 = _local2 + ((_local3 + " overlapping prop discarded: ") + _local4);
break;
case "116" :
_local2 = _local2 + ("** FuseItem Error: Delays within groups (arrays) and start/update callbacks are not supported when using Fuse without ZigoEngine. Although you need to restructure your Fuse, it should be possible to achieve the same results. **" + _local5);
break;
case "117" :
_local2 = _local2 + (("** " + _local3) + ": infinite cycles are not allowed within Fuses - discarded. **");
break;
case "118" :
_local2 = _local2 + ((("** " + _local3) + ": No targets found!") + ((_local4 == true) ? " [Unable to set start props] **" : " [Skipping tween parameters in this action] **"));
break;
case "119" :
_local2 = _local2 + ((((("** " + _local3) + ": ") + ((_local4 == 1) ? "" : (_local4 + " actions in the group"))) + " missing targets") + ((_local6 == true) ? " during setStartProps **" : " **"));
break;
case "120" :
_local2 = _local2 + (((("** " + _local3) + ": conflict with \"") + _local4) + "\". Property might be doubled within a grouped-action array. **");
break;
case "121" :
_local2 = _local2 + "** Fuse timecode formatting requires \"00:\" formatting (example:\"01:01:33\" yields 61.33 seconds.) **";
break;
case "122" :
_local2 = _local2 + (("** Event \"" + _local3) + "\" reserved by Fuse. **");
break;
case "123" :
_local2 = _local2 + (("** A Fuse event parameter failed in " + _local3) + " **");
break;
case "124" :
_local2 = _local2 + (((("** " + _local3) + ": trigger:") + _local4) + " ignored - only one trigger is allowed per action **");
break;
case "125" :
_local2 = _local2 + (_local3 + " Warning - fastForward hit an item during its tween cycle, may malfunction.");
break;
case "201" :
_local2 = _local2 + (("**** FuseFMP cannot initialize argument " + _local3) + " (BitmapFilters cannot be applied to this object type) ****");
break;
case "202" :
_local2 = _local2 + (((("** FuseFMP error: A " + _local3) + " could not be created for ") + _local4) + " **");
break;
case "203" :
_local2 = _local2 + (("** FuseFMP.setFilterProps - too few arguments passed (" + _local3) + ") - minimum 2 required. **");
break;
case "204" :
_local2 = _local2 + (("** FuseFMP.setFilterProps could not locate the filter passed. (" + _local3) + ") **");
}
output(_local2);
}
static function parseCallback(callback, targets, outputLevel, callerIsEngine, addprefix) {
if (callback._vcb == true) {
return(callback);
}
var validCBs = {_vcb:true, skipLevel:_global.com.mosesSupposes.fuse.ZigoEngine.SKIP_LEVEL, cycles:1};
if (callback == undefined) {
return(validCBs);
}
var cbErrors = [];
if (typeof(callback) == "object") {
if (((callback.skipLevel != undefined) && (typeof(callback.skipLevel) == "number")) && (callback.skipLevel != _global.com.mosesSupposes.fuse.ZigoEngine.SKIP_LEVEL)) {
if ((callback.skipLevel >= 0) && (callback.skipLevel <= 2)) {
validCBs.skipLevel = callback.skipLevel;
}
}
if (callback.cycles != undefined) {
if ((typeof(callback.cycles) == "number") && (callback.cycles > -1)) {
validCBs.cycles = callback.cycles;
} else if (callback.cycles.toUpperCase() == "LOOP") {
validCBs.cycles = 0;
}
}
if (callback.extra1 != undefined) {
validCBs.extra1 = callback.extra1;
}
if (callback.extra2 != undefined) {
validCBs.extra2 = callback.extra2;
}
if ((callback.roundResults === true) || (callback.roundResults === false)) {
validCBs.roundResults = callback.roundResults;
}
} else {
callback = {func:callback};
}
var prefixes = ["start", "upd", ""];
var easyfuncparse = _global.com.mosesSupposes.fuse.Shortcuts.parseStringTypeCallback;
for (var i in prefixes) {
var prefix = prefixes[i];
var fstr = callback[prefix + "func"];
if (((fstr != undefined) && (typeof(fstr) == "string")) && (fstr.indexOf("(") > -1)) {
if (easyfuncparse != undefined) {
var efc = easyfuncparse(fstr);
if (efc.func != undefined) {
callback[prefix + "scope"] = efc.scope;
callback[prefix + "func"] = efc.func;
callback[prefix + "args"] = efc.args;
}
} else if (outputLevel > 0) {
error("008");
}
}
}
var basescope = callback.scope;
for (var i in callback) {
var fi = i.toLowerCase().indexOf("func");
if (fi > -1) {
var prefix = i.slice(0, fi);
var func = callback[i];
var args = callback[prefix + "args"];
var scope = ((callback[prefix + "scope"] == undefined) ? (basescope) : (callback[prefix + "scope"]));
if ((typeof(func) == "string") && (scope[func] == undefined)) {
for (var j in targets) {
var targ = targets[j];
if (typeof(targ[func]) == "function") {
scope = targ;
break;
}
if (typeof(targ._parent[func]) == "function") {
scope = targ._parent;
break;
}
}
if ((scope == undefined) && (_level0[func] != undefined)) {
scope = _level0;
}
if ((scope == undefined) && (_global[func] != undefined)) {
scope = _global;
}
}
if (typeof(func) != "function") {
if (typeof(scope[String(func)]) == "function") {
func = scope[String(func)];
} else {
func = eval (String(func));
}
}
if (func == undefined) {
cbErrors.push(String((((((((addprefix == null) ? (i) : (addprefix + i)) + ":") + ((typeof(callback[i]) == "string") ? (("\"" + callback[i]) + "\"") : (callback[i]))) + "/") + prefix) + "scope:") + scope));
} else {
if ((args != undefined) && (!(args instanceof Array))) {
args = [args];
}
if (prefix == "") {
prefix = "end";
}
validCBs[prefix] = {s:scope, f:func, a:args};
if (callerIsEngine == true) {
validCBs[prefix].id = ++cbTicker;
}
if (prefix == "start") {
validCBs.start.fired = false;
}
}
} else if (_cbprops().indexOf(("|" + i) + "|") == -1) {
error("009", i);
}
}
if ((cbErrors.length > 0) && (outputLevel > 0)) {
if (outputLevel > 0) {
error("010", callerIsEngine, cbErrors.length, cbErrors.toString());
}
}
return(validCBs);
}
static var VERSION = "Fuse Kit 2.1.4 Copyright (c) 2006 Moses Gunesch, MosesSupposes.com under MIT Open Source License";
static var VERBOSE = true;
static var ALL = "ALL";
static var ALLCOLOR = "ALLCOLOR";
static var cbTicker = 0;
}
Symbol 2650 MovieClip [__Packages.com.mosesSupposes.fuse.ZigoEngine] Frame 0
class com.mosesSupposes.fuse.ZigoEngine
{
static var extensions, updateTime, tweenHolder, instance, _listeners, broadcastMessage, updateIntId;
function ZigoEngine () {
}
static function addListener(handler) {
AsBroadcaster.initialize(com.mosesSupposes.fuse.ZigoEngine);
addListener(handler);
}
static function removeListener(handler) {
}
static function isPlaying() {
return(_playing);
}
static function simpleSetup(shortcutsClass) {
if (arguments.length > 0) {
register.apply(com.mosesSupposes.fuse.ZigoEngine, arguments);
}
_global.ZigoEngine = com.mosesSupposes.fuse.ZigoEngine;
if (extensions.fuse != undefined) {
_global.Fuse = extensions.fuse;
}
if (extensions.fuseFMP != undefined) {
extensions.fuseFMP.simpleSetup();
}
initialize(MovieClip.prototype, Button.prototype, TextField.prototype);
if (extensions.shortcuts == undefined) {
com.mosesSupposes.fuse.FuseKitCommon.error("001");
}
}
static function register(classReference) {
if (extensions == undefined) {
extensions = {};
}
var _local3 = "|fuse|fuseItem|fuseFMP|shortcuts|pennerEasing|customEasing|";
for (var _local4 in arguments) {
var _local2 = arguments[_local4].registryKey;
if ((extensions[_local2] == undefined) && (_local3.indexOf(("|" + _local2) + "|") > -1)) {
extensions[_local2] = arguments[_local4];
if ((_local2 == "fuseFMP") || (_local2 == "shortcuts")) {
Object(extensions[_local2]).initialize();
}
}
}
}
static function initialize(target) {
if (arguments.length > 0) {
initializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine, arguments);
if (extensions.shortcuts != undefined) {
extensions.shortcuts.addShortcutsTo.apply(extensions.shortcuts, arguments);
}
}
}
static function deinitialize(target) {
if ((arguments.length == 0) || (target == null)) {
arguments.push(MovieClip.prototype, Button.prototype, TextField.prototype);
}
deinitializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine, arguments);
if (extensions.shortcuts != undefined) {
extensions.shortcuts.removeShortcutsFrom.apply(extensions.shortcuts, arguments);
}
}
static function getUpdateInterval() {
return(updateTime);
}
static function setUpdateInterval(time) {
if (_playing) {
setup(true);
updateTime = time;
setup();
} else {
updateTime = time;
}
}
static function getControllerDepth() {
return(tweenHolder.getDepth());
}
static function setControllerDepth(depth) {
if ((depth == null) || (_global.isNaN(depth) == true)) {
depth = 6789;
}
if (Object(tweenHolder).proof != null) {
tweenHolder.swapDepths(depth);
} else {
tweenHolder = _root.createEmptyMovieClip("ZigoEnginePulse", depth);
}
}
static function doShortcut(targets, methodName) {
if (extensions.shortcuts == undefined) {
if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("002");
}
return(null);
}
return(extensions.shortcuts.doShortcut.apply(extensions.shortcuts, arguments));
}
static function doTween(targets, props, endvals, seconds, ease, delay, callback) {
if (extensions.fuse.addBuildItem(arguments) == true) {
return(null);
}
if (TIME_MULTIPLIER != prevTimeMult) {
TIME_MULTIPLIER = Math.abs(TIME_MULTIPLIER);
if (_global.isNaN(TIME_MULTIPLIER) == true) {
TIME_MULTIPLIER = 1;
}
if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("016", TIME_MULTIPLIER);
}
prevTimeMult = TIME_MULTIPLIER;
}
if ((instance == undefined) || ((Object(tweenHolder).proof == undefined) && (updateTime == undefined))) {
if ((MovieClip.prototype.tween != null) && (typeof(_global.$tweenManager) == "object")) {
com.mosesSupposes.fuse.FuseKitCommon.error("003");
}
instance = new com.mosesSupposes.fuse.ZManager();
_playing = false;
}
var _local4 = instance.paramsObj(targets, props, endvals, true);
var _local7 = (((_local4.tg[0] == null) || (_local4.tg.length == 0)) ? undefined : (_local4.tg));
if (((_local4.pa == undefined) || (_local7 == undefined)) || (arguments.length < 3)) {
if (((extensions.fuseItem != null) && (arguments.length == 1)) && (typeof(arguments[0]) == "object")) {
return(extensions.fuseItem.doTween(arguments[0]));
}
if (OUTPUT_LEVEL > 0) {
if (arguments.length < 3) {
com.mosesSupposes.fuse.FuseKitCommon.error("004", (((arguments.length == 1) && (arguments[0] == null)) ? "1 (null)" : (String(arguments.length))), Boolean(extensions.fuseItem == null));
} else {
com.mosesSupposes.fuse.FuseKitCommon.error("005", _local7.toString(), _local4.pa.toString());
}
}
return(null);
}
if (_playing != true) {
setup();
}
if ((seconds == null) || (_global.isNaN(seconds) == true)) {
seconds = DURATION || 1;
} else if (seconds < 0.01) {
seconds = 0;
}
seconds = seconds * TIME_MULTIPLIER;
if (((delay < 0.01) || (delay == null)) || (_global.isNaN(delay) == true)) {
delay = 0;
}
delay = delay * TIME_MULTIPLIER;
var _local12 = com.mosesSupposes.fuse.FuseKitCommon.parseCallback(callback, _local7, OUTPUT_LEVEL, true);
var _local9;
if (typeof(ease) == "function") {
if (typeof(Function(ease).call(null, 1, 1, 1, 1)) == "number") {
_local9 = Function(ease);
} else if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("014", ease);
}
} else if ((ease == null) || (ease == "")) {
if (EASING instanceof Function) {
_local9 = Function(EASING);
} else if (extensions.pennerEasing != undefined) {
ease = EASING;
}
}
if ((typeof(ease) == "string") && (ease != "")) {
if (extensions.pennerEasing[ease] != undefined) {
_local9 = extensions.pennerEasing[ease];
} else if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("006", ease);
}
} else if (ease instanceof Array) {
if (extensions.customEasing != undefined) {
_local12.extra1 = ease;
if (typeof(ease[0]) == "number") {
_local9 = extensions.customEasing.precalced;
} else {
_local9 = extensions.customEasing.fromCurve;
}
} else if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("015", ease);
}
}
if (typeof(_local9) != "function") {
_local9 = function (t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
};
}
if (_listeners.length > 0) {
broadcastMessage.call(com.mosesSupposes.fuse.ZigoEngine, "onTweenAdd", _local7, _local4.pa, _local4.va, seconds, _local9, delay, _local12);
}
var _local6 = "";
for (var _local13 in _local7) {
var _local3 = _local7[_local13];
if (_local3.__zigoID__ == null) {
initializeTargets(_local3);
} else if (instance.getStatus("locked", _local3) == true) {
if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("007", ((_local3._name != undefined) ? (_local3._name) : (_local3.toString())), _local4.pa.toString());
}
continue;
}
var _local5 = instance.addTween(_local3, _local4.pa, _local4.va, seconds, _local9, delay, _local12);
_local6 = ((_local5 == null) ? "|" : (_local5 + "|")) + _local6;
}
_local6 = _local6.slice(0, -1);
return((((_local6 == "") || (_local6 == "|")) ? null : (_local6)));
}
static function removeTween(targs, props) {
instance.removeTween(targs, props);
}
static function isTweening(targ, prop) {
return(Boolean(instance.getStatus("active", targ, prop)));
}
static function getTweens(targ) {
if (instance == undefined) {
return(0);
}
return(Number(instance.getStatus("count", targ)));
}
static function lockTween(targ, setLocked) {
instance.alterTweens("lock", targ, setLocked == true);
}
static function isTweenLocked(targ) {
return(Boolean(instance.getStatus("locked", targ)));
}
static function ffTween(targs, props, suppressEndEvents) {
instance.alterTweens("ff", targs, props, null, suppressEndEvents);
}
static function skipTweenTo(seconds, targs, props) {
instance.alterTweens("skipTo", targs, props, false, false, seconds);
}
static function rewTween(targs, props, pauseFlag, suppressStartEvents) {
instance.alterTweens("rewind", targs, props, pauseFlag, suppressStartEvents);
}
static function isTweenPaused(targ, prop) {
return(Boolean(instance.getStatus("paused", targ, prop)));
}
static function pauseTween(targs, props) {
instance.alterTweens("pause", targs, props);
}
static function unpauseTween(targs, props) {
instance.alterTweens("unpause", targs, props);
}
static function resumeTween(targs, props) {
instance.alterTweens("unpause", targs, props);
}
static function setColorByKey(targetObj, type, amt, rgb) {
new Color(targetObj).setTransform(getColorTransObj(type, amt, rgb));
}
static function getColorTransObj(type, amt, rgb) {
switch (type) {
case "brightness" :
var _local3 = 100 - Math.abs(amt);
var _local4 = ((amt > 0) ? (255 * (amt / 100)) : 0);
return({ra:_local3, rb:_local4, ga:_local3, gb:_local4, ba:_local3, bb:_local4});
case "brightOffset" :
return({ra:100, rb:255 * (amt / 100), ga:100, gb:255 * (amt / 100), ba:100, bb:255 * (amt / 100)});
case "contrast" :
return({ra:amt, rb:128 - (1.28 * amt), ga:amt, gb:128 - (1.28 * amt), ba:amt, bb:128 - (1.28 * amt)});
case "invertColor" :
return({ra:100 - (2 * amt), rb:amt * 2.55, ga:100 - (2 * amt), gb:amt * 2.55, ba:100 - (2 * amt), bb:amt * 2.55});
case "tint" :
if (rgb == null) {
break;
}
var _local5;
if (typeof(rgb) == "string") {
if (rgb.charAt(0) == "#") {
rgb = rgb.slice(1);
}
rgb = ((rgb.charAt(1).toLowerCase() != "x") ? ("0x" + rgb) : (rgb));
}
_local5 = Number(rgb);
return({ra:100 - amt, rb:(_local5 >> 16) * (amt / 100), ga:100 - amt, gb:((_local5 >> 8) & 255) * (amt / 100), ba:100 - amt, bb:(_local5 & 255) * (amt / 100)});
}
return({rb:0, ra:100, gb:0, ga:100, bb:0, ba:100});
}
static function getColorKeysObj(targOrTransObj) {
var _local1 = ((targOrTransObj.ra != undefined) ? (targOrTransObj) : (new Color(targOrTransObj).getTransform()));
var _local6 = (_local1.ra == _local1.ga) && (_local1.ga == _local1.ba);
var _local8 = (_local1.rb == _local1.gb) && (_local1.gb == _local1.bb);
var _local3 = {tintPercent:Number(((_local6 == true) ? (100 - _local1.ra) : 0))};
if (_local3.tintPercent != 0) {
var _local5 = 100 / _local3.tintPercent;
_local3.tint = (((_local1.rb * _local5) << 16) | ((_local1.gb * _local5) << 8)) | (_local1.bb * _local5);
var _local2 = _local3.tint.toString(16);
var _local4 = 6 - _local2.length;
while ((_local4--) > 0) {
_local2 = "0" + _local2;
}
_local3.tintString = "0x" + _local2.toUpperCase();
}
if ((_local6 == true) && (_local8 == true)) {
if (_local1.ra < 0) {
_local3.invertColor = _local1.rb * 0.392156862745098;
} else if ((_local1.ra == 100) && (_local1.rb != 0)) {
_local3.brightOffset = _local1.rb * 0.392156862745098;
}
if (_local1.ra != 100) {
if ((_local1.rb == 0) || ((_local1.rb != 0) && (((255 * ((100 - _local1.ra) / 100)) - _local1.rb) <= 1))) {
_local3.brightness = ((_local1.rb != 0) ? (100 - _local1.ra) : (_local1.ra - 100));
}
if (((128 - (1.28 * _local1.ra)) - _local1.rb) <= 1) {
_local3.contrast = _local1.ra;
}
}
}
return(_local3);
}
static function initializeTargets() {
for (var _local5 in arguments) {
var _local4 = arguments[_local5];
if ((((_local4 == MovieClip.prototype) || (_local4 == Button.prototype)) || (_local4 == TextField.prototype)) || (_local4 == Object.prototype)) {
if (_local4.oldAddListener == undefined) {
if (_local4 == TextField.prototype) {
_local4.oldAddListener = _local4.addListener;
_global.ASSetPropFlags(_local4, "oldAddListener", 7, 1);
}
_local4.addListener = function (o) {
if (this.__zigoID__ == undefined) {
com.mosesSupposes.fuse.ZigoEngine.initializeTargets(this);
}
if (this instanceof TextField) {
Function(this.oldAddListener).call(this, o);
} else {
this.addListener(o);
}
};
if (_local4 == MovieClip.prototype) {
_global.ASSetPropFlags(_local4, "addListener", 7, 1);
}
}
} else if (_local4.__zigoID__ == undefined) {
_local4.__zigoID__ = zigoIDs;
_global.ASSetPropFlags(_local4, "__zigoID__", 7, 1);
zigoIDs++;
if ((_local4._listeners == null) || (_local4.addListener == null)) {
AsBroadcaster.initialize(_local4);
}
}
}
}
static function deinitializeTargets() {
for (var _local4 in arguments) {
var _local3 = arguments[_local4];
if (_local3.__zigoID__ != undefined) {
_global.ASSetPropFlags(_local3, "__zigoID__,_listeners,broadcastMessage,addListener,removeListener", 0, 2);
delete _local3.__zigoID__;
delete _local3._listeners;
delete _local3.broadcastMessage;
delete _local3.addListener;
delete _local3.removeListener;
}
if (_local3.oldAddListener != undefined) {
_global.ASSetPropFlags(_local3, "oldAddListener", 0, 2);
_local3.addListener = _local3.oldAddListener;
delete _local3.oldAddListener;
}
}
}
static function __mgrRelay(inst, method, args) {
if (inst == instance) {
Function(com.mosesSupposes.fuse.ZigoEngine[method]).apply(com.mosesSupposes.fuse.ZigoEngine, args);
}
}
static function setup(deinitFlag) {
if (deinitFlag == true) {
_playing = false;
clearInterval(updateIntId);
delete tweenHolder.onEnterFrame;
return(undefined);
}
instance.cleanUp();
clearInterval(updateIntId);
delete updateIntId;
if ((updateTime != null) && (updateTime > 0)) {
updateIntId = setInterval(instance, "update", updateTime);
} else {
if (Object(tweenHolder).proof == null) {
setControllerDepth(6789);
Object(tweenHolder).proof = 1;
}
var _inst = instance;
tweenHolder.onEnterFrame = function () {
_inst.update.call(_inst);
};
}
_playing = true;
instance.now = getTimer();
}
static var VERSION = com.mosesSupposes.fuse.FuseKitCommon.VERSION + ", ZigoEngine based on concepts by L.Zigo";
static var EASING = "easeOutQuint";
static var DURATION = 1;
static var TIME_MULTIPLIER = 1;
static var ROUND_RESULTS = false;
static var OUTPUT_LEVEL = 1;
static var AUTOSTOP = false;
static var SKIP_LEVEL = 0;
static var _playing = false;
static var zigoIDs = 0;
static var prevTimeMult = 1;
}
Symbol 2651 MovieClip [__Packages.com.mosesSupposes.fuse.ZManager] Frame 0
class com.mosesSupposes.fuse.ZManager
{
var tweens, now;
function ZManager () {
tweens = {};
numTweens = 0;
}
function addTween(obj, props, endvals, seconds, ease, delay, callback) {
var _local24 = ((callback.skipLevel == undefined) ? 0 : (callback.skipLevel));
var _local44 = ((callback.cycles == undefined) ? 1 : (callback.cycles));
var _local30 = callback.extra1;
var _local29 = callback.extra2;
var _local23 = [];
var _local14 = _global.com.mosesSupposes.fuse.FuseFMP;
var _local43 = String(("|" + _local14.getAllShortcuts().join("|")) + "|");
var _local42 = com.mosesSupposes.fuse.FuseKitCommon._cts();
var _local25 = "";
var _local28 = "";
var _local22 = obj.__zigoID__;
var _local7 = tweens[String(_local22)];
if ((_local7 != undefined) && (com.mosesSupposes.fuse.ZigoEngine.AUTOSTOP == true)) {
if (obj._listeners.length > 0) {
for (var _local40 in _local7.props) {
_local23.unshift(_local40);
}
}
_local7.numProps = 0;
cleanUp(true);
}
for (var _local47 in props) {
var _local5 = props[_local47];
var _local4 = endvals[_local47];
var _local15 = 0;
if (_local5 == "_fade") {
_local5 = "_alpha";
_local15 = ((_local4 < 50) ? -1 : 1);
}
var _local16 = _local42.indexOf(("|" + _local5) + "|") > -1;
var _local18 = _local7.colorProp;
if (_local7 != undefined) {
if ((_local16 == true) && (_local18 != undefined)) {
_local23.unshift(_local18);
delete _local7.props[_local18];
delete _local7.colorProp;
_local7.numProps--;
} else if (_local7.props[_local5] != undefined) {
_local23.unshift(_local5);
delete _local7[_local5];
_local7.numProps--;
}
}
var _local3 = {c:-1, fmp:-1, complex:-1};
var _local11 = ((_local24 == 0) && ((seconds + delay) == 0)) || ((_local24 > 0) && (seconds == 0));
var _local10 = false;
var _local13 = (_local14 != undefined) && (_local43.indexOf(("|" + _local5) + "|") > -1);
var _local19 = (_local5.toLowerCase().indexOf("colors") > -1) && (_local4 instanceof Array);
var _local27 = ((_local13 == true) && (_local5.indexOf("lor") > -1)) && (_local5.charAt(2) != "l");
if (_local13 == true) {
_local3.fmp = _local14;
_local3.ps = _local14.getFilterProp(obj, _local5, true);
_local3.special = true;
}
if (((_local16 == true) || (_local19 == true)) || (_local27 && (_local11 == false))) {
_local3.complex = 1;
if (_local16 == true) {
_local3.c = new Color(obj);
_local3.ps = Color(_local3.c).getTransform();
var _local17 = ((((_local5 == "_tint") || (_local5 == "_tintPercent")) || (_local5 == "_colorReset")) ? "tint" : (_local5.slice(1)));
var _local9 = null;
var _local12 = null;
if (_local5 != "_colorTransform") {
if (_local17 == "tint") {
if (typeof(_local4) == "object") {
_local12 = _local4.tint;
_local9 = ((_global.isNaN(_local4.percent) == true) ? 100 : (_local4.percent));
} else if ((_local5 == "_tintPercent") || (_local5 == "_colorReset")) {
var _local20 = com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(obj).tintPercent;
if (_local5 == "_colorReset") {
_local9 = Math.min(_local20, 100 - Math.abs(Number(_local4)));
} else {
_local9 = ((typeof(_local4) == "string") ? ((_local20 || 0) + Number(_local4)) : Number(_local4));
}
_local9 = Math.max(0, Math.min(_local9, 100));
_local12 = com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(obj).tint || 0;
} else {
_local12 = _local4;
_local9 = 100;
}
} else {
_local9 = ((typeof(_local4) == "string") ? ((com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(obj)[_local17] || 0) + Number(_local4)) : (_local4));
}
_local4 = com.mosesSupposes.fuse.ZigoEngine.getColorTransObj(_local17, _local9, _local12);
}
if (_local11 == true) {
if (_local5 == "_colorTransform") {
Color(_local3.c).setTransform(_local4);
} else {
com.mosesSupposes.fuse.ZigoEngine.setColorByKey(obj, _local17, _local9, _local12);
}
} else {
var _local21 = getChangeObj(_local3.ps, _local4, false, false);
_local3.ch = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
}
} else if (_local11 == true) {
_local14.setFilterProp(obj, _local5, _local4);
} else if (_local19 == true) {
_local3.c = 2;
_local3.ch = [];
for (var _local40 in _local4) {
if (_local4[_local40] != null) {
if (_local3.ps == null) {
_local3.ps = [];
}
_local3.ps[_local40] = com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, ((_local3.ps[_local40] == null) ? obj[_local5][_local40] : _local3.ps[_local40]));
var _local21 = getChangeObj(_local3.ps[_local40], com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, _local4[_local40]), true, false);
_local3.ch[_local40] = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
}
}
} else {
_local3.c = 1;
_local3.ps = com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, _local3.ps);
var _local21 = getChangeObj(_local3.ps, com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, _local4), true, false);
_local3.ch = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
}
} else if (_local5 == "_bezier_") {
removeTween(obj, "_x,_y", true);
if (_local11 == true) {
if ((_local4.x != null) && (_global.isNaN(Number(_local4.x)) == false)) {
obj._x = ((typeof(_local4.x) == "string") ? (obj._x + Number(_local4.x)) : (_local4.x));
}
if ((_local4.y != null) && (_global.isNaN(Number(_local4.y)) == false)) {
obj._y = ((typeof(_local4.y) == "string") ? (obj._y + Number(_local4.y)) : (_local4.y));
}
} else {
_local3.special = true;
_local3.ps = 0;
_local3.ch = 1;
_local3.bz = {sx:obj._x, sy:obj._y};
if ((_local4.x == null) || (_global.isNaN(Number(_local4.x)))) {
_local4.x = _local3.bz.sx;
}
if ((_local4.y == null) || (_global.isNaN(Number(_local4.y)))) {
_local4.y = _local3.bz.sy;
}
_local3.bz.chx = ((typeof(_local4.x) == "string") ? (Number(_local4.x)) : (_local4.x - _local3.bz.sx));
if (_global.isNaN(_local3.bz.chx) == true) {
_local3.bx.chx = 0;
}
_local3.bz.chy = ((typeof(_local4.y) == "string") ? (Number(_local4.y)) : (_local4.y - _local3.bz.sy));
if (_global.isNaN(_local3.bz.chy) == true) {
_local3.bx.chy = 0;
}
if ((_local4.controlX == null) || (_global.isNaN(Number(_local4.controlX)))) {
_local3.bz.ctrlx = _local3.bz.sx + (_local3.bz.chx / 2);
} else {
_local3.bz.ctrlx = ((typeof(_local4.controlX) == "string") ? (_local3.bz.sx + Number(_local4.controlX)) : (_local4.controlX));
}
if ((_local4.controlY == null) || (_global.isNaN(Number(_local4.controlY)))) {
_local3.bz.ctrly = _local3.bz.sy + (_local3.bz.chy / 2);
} else {
_local3.bz.ctrly = ((typeof(_local4.controlY) == "string") ? (_local3.bz.sy + Number(_local4.controlY)) : (_local4.controlY));
}
_local3.bz.ctrlx = _local3.bz.ctrlx - _local3.bz.sx;
_local3.bz.ctrly = _local3.bz.ctrly - _local3.bz.sy;
_local10 = (_local3.bz.chx + _local3.bz.chy) != 0;
}
} else {
if (typeof(_local4) == "object") {
_local3.complex = ((_local4 instanceof Array) ? 0 : 1);
}
if ((_local5 == "_x") || (_local5 == "_y")) {
removeTween(obj, "_bezier_", true);
}
if ((_local5 == "_frame") && (typeof(obj) == "movieclip")) {
_local3.ps = obj._currentframe;
_local3.special = true;
} else if (_local13 == false) {
if (_local3.complex > -1) {
_local3.ps = ((_local3.complex == 0) ? ([]) : ({}));
for (var _local40 in _local4) {
_local3.ps[_local40] = obj[_local5][_local40];
}
} else {
_local3.ps = obj[_local5];
}
}
if (_local11 == true) {
if (_local13 == true) {
_local14.setFilterProp(obj, _local5, ((typeof(_local4) == "string") ? (_local3.ps + Number(_local4)) : (_local4)));
} else if (_local3.complex > -1) {
for (var _local40 in _local4) {
if ((_local4[_local40] != null) && (_global.isNaN(Number(_local4[_local40])) == false)) {
obj[_local5][_local40] = ((typeof(_local4[_local40]) == "string") ? (_local3.ps[_local40] + Number(_local4[_local40])) : _local4[_local40]);
if (_global.isNaN(obj[_local5][_local40]) == true) {
obj[_local5][_local40] = 0;
}
}
}
} else {
obj[_local5] = ((typeof(_local4) == "string") ? (_local3.ps + Number(_local4)) : (_local4));
if (_local15 == 1) {
obj._visible = true;
} else if (_local15 == -1) {
obj._visible = false;
}
}
} else if (_local3.complex > -1) {
var _local21 = getChangeObj(_local3.ps, _local4, _local13, _local3.complex == 0);
_local3.ch = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
} else {
if ((_local4 == null) || (_global.isNaN(Number(_local4)))) {
_local4 = _local3.ps;
}
_local3.ch = ((typeof(_local4) == "string") ? (Number(_local4)) : (Number(_local4) - _local3.ps));
if (_global.isNaN(_local3.ch) == true) {
_local3.ch = 0;
}
_local10 = _local3.ch != 0;
}
}
if (((_local24 == 0) && ((_local10 == true) || (_local11 == false))) || ((_local10 == true) && (_local11 == false))) {
if ((_local3.complex > -1) && (!(_local3.c === 2))) {
_local3.ps = [_local3.ps];
_local3.ch = [_local3.ch];
}
_local3.ts = now + (delay * 1000);
_local3.pt = -1;
_local3.d = seconds * 1000;
_local3.ef = ease;
_local3.sf = false;
_local3.cycles = _local44;
if (_local30 != undefined) {
_local3.e1 = _local30;
}
if (_local29 != undefined) {
_local3.e2 = _local29;
}
_local3.v = _local15;
if (callback.start != undefined) {
_local3.scb = callback.start;
}
if (callback.upd != undefined) {
_local3.ucb = callback.upd;
}
if (callback.end != undefined) {
_local3.ecb = callback.end;
}
if (callback.roundResults != undefined) {
_local3.rr = callback.roundResults;
}
if (tweens[String(_local22)] == undefined) {
_local7 = (tweens[String(_local22)] = {numProps:0, locked:false, targ:obj, targID:String(("\"" + ((obj._name != undefined) ? (obj._name) : (obj.toString()))) + "\""), targZID:_local22, props:{}});
numTweens++;
}
if (_local16 == true) {
_local7.colorProp = _local5;
}
_local7.props[_local5] = _local3;
_local7.numProps++;
_local25 = (_local5 + ",") + _local25;
_local28 = (((typeof(_local4) == "string") ? (("\"" + _local4) + "\"") : (_local4)) + ",") + _local28;
}
_local3 = undefined;
}
if ((_local7 == undefined) || (_local7.numProps <= 0)) {
cleanUp();
}
if ((_local23.length > 0) && (com.mosesSupposes.fuse.ZigoEngine._listeners.length > 0)) {
com.mosesSupposes.fuse.ZigoEngine.broadcastMessage("onTweenInterrupt", {target:obj, props:_local23, __zigoID__:_local22, during:"add"});
}
if (_local25 == "") {
if (_local24 == 2) {
if (com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL == 2) {
com.mosesSupposes.fuse.FuseKitCommon.error("011", ((obj._name != undefined) ? (obj._name) : (obj.toString())), props.toString());
}
} else {
var _local48 = obj._listeners.length > 0;
if (_local48 == true) {
obj.broadcastMessage("onTweenStart", {target:obj, props:props});
}
if (callback.start != undefined) {
callback.start.f.apply(callback.start.s, callback.start.a);
}
if (_local48 == true) {
obj.broadcastMessage("onTweenUpdate", {target:obj, props:props});
}
if (callback.upd != undefined) {
callback.upd.f.apply(callback.upd.s, callback.upd.a);
}
if (_local48 == true) {
obj.broadcastMessage("onTweenEnd", {target:obj, props:props});
}
if (callback.end != undefined) {
callback.end.f.apply(callback.end.s, callback.end.a);
}
}
cleanUp();
}
if (com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL == 2) {
if (_local25 == "") {
com.mosesSupposes.fuse.FuseKitCommon.error("012", ((obj._name != undefined) ? (obj._name) : (obj.toString())), props.toString(), endvals.toString());
} else {
com.mosesSupposes.fuse.FuseKitCommon.error("013", ((obj._name != undefined) ? (obj._name) : (obj.toString())), _local25.slice(0, -1), _local28.slice(0, -1));
}
}
return(((_local25 == "") ? null : (_local25.slice(0, -1))));
}
function removeTween(targs, props, noInit) {
var _local4 = {};
var _local12 = paramsObj(targs, props);
if (_local12.none == true) {
return(undefined);
}
var _local16 = _local12.all;
var _local17 = _local12.allprops;
var _local9 = ((_local16 == true) ? (tweens) : (Object(_local12.tg)));
var _local8 = false;
for (var _local20 in _local9) {
var _local3 = ((_local16 == true) ? (_local20) : (String(_local9[_local20].__zigoID__)));
var _local2 = tweens[_local3];
var _local6 = ((_local17 == true) ? (_local2.props) : (_local12.props));
for (var _local14 in _local6) {
var _local5 = (_local14 == com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR) && (_local2.colorProp != undefined);
if ((_local2.props[_local14] != undefined) || (_local5 == true)) {
if (_local4[_local3] == null) {
_local4[_local3] = [];
}
_local4[_local3].unshift(_local14);
if ((_local14 == _local2.colorProp) || (_local5 == true)) {
delete _local2.props[_local2.colorProp];
delete _local2.colorProp;
} else {
delete _local2.props[_local14];
}
_local2.numProps--;
if (_local2.numProps <= 0) {
_local8 = true;
break;
}
}
}
}
if (com.mosesSupposes.fuse.ZigoEngine._listeners.length > 0) {
for (var _local19 in _local4) {
var _local7 = tweens[_local19].targ;
com.mosesSupposes.fuse.ZigoEngine.broadcastMessage("onTweenInterrupt", {target:((typeof(_local7.addProperty) == "function") ? (_local7) : (("[MISSING(\"" + tweens[_local19].targID) + "\")]")), props:_local4[_local19], __zigoID__:tweens[_local19].targZID, during:((noInit == true) ? "add" : "remove")});
}
}
if (_local8 == true) {
cleanUp(noInit);
}
}
function alterTweens(type, targs, props, pauseFlag, noEvents, skipTo) {
if (type == "lock") {
tweens[String(targs.__zigoID__)].locked = props;
return(undefined);
}
var _local11 = paramsObj(targs, props);
if (_local11.none == true) {
return(undefined);
}
var _local14 = _local11.all;
var _local15 = _local11.allprops;
var _local9 = ((_local14 == true) ? (tweens) : (Object(_local11.tg)));
var _local8 = 0;
for (var _local16 in _local9) {
var _local7 = ((_local14 == true) ? (_local16) : (String(_local9[_local16].__zigoID__)));
var _local5 = tweens[_local7];
var _local4 = ((_local15 == true) ? (_local5.props) : (_local11.props));
if (_local4.ALLCOLOR == true) {
_local4[_local5.colorProp] = true;
delete _local4.ALLCOLOR;
}
for (var _local10 in _local4) {
_local8++;
var _local2 = _local5.props[_local10];
if (type == "rewind") {
if (pauseFlag == true) {
_local2.pt = now;
}
_local2.ts = now;
if (noEvents != true) {
_local2.sf = false;
if (_local2.scb != undefined) {
_local2.scb.fired = false;
}
}
} else if (type == "ff") {
if (noEvents == true) {
_local2.suppressEnd = true;
}
_local2.o = true;
_local2.pt = -1;
_local2.ts = now - _local2.d;
} else if (type == "skipTo") {
_local2.ts = Math.min(now, (_local2.ts + (now - _local2.ts)) - (skipTo * 1000));
} else if (type == "pause") {
if (_local2.pt == -1) {
_local2.pt = now;
}
} else if (type == "unpause") {
if (_local2.pt != -1) {
_local2.ts = now - (_local2.pt - _local2.ts);
_local2.pt = -1;
}
}
}
}
if ((type == "ff") && (_local8 > 0)) {
update();
} else if ((type == "rewind") && (_local8 > 0)) {
update(true);
}
}
function getStatus(type, targ, param) {
if (targ == null) {
return(null);
}
var _local8 = String(targ).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALL;
var _local4 = tweens[String(targ.__zigoID__)];
switch (type) {
case "paused" :
var _local2 = _local4.props;
if (param != null) {
if (_local2[String(param)] == undefined) {
return(false);
}
return(Boolean(_local2[String(param)].pt != -1));
}
for (var _local6 in _local2) {
if (_local2[_local6].pt != -1) {
return(true);
}
}
return(false);
case "active" :
if (param == null) {
return(Boolean(_local4 != undefined));
}
if (String(param).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR) {
return(Boolean(_local4.colorProp != undefined));
}
return(Boolean(_local4.props[String(param)] != undefined));
case "count" :
if (!_local8) {
return(_local4.numProps);
}
var _local3 = 0;
for (var _local6 in tweens) {
_local3 = _local3 + tweens[_local6].numProps;
}
return(_local3);
case "locked" :
return(_local4.locked);
}
}
function update(force) {
var _local22 = {};
var _local24 = {};
var _local23 = {};
var _local15 = {};
var _local13 = {};
var _local14 = {};
var _local26 = false;
var _local20 = com.mosesSupposes.fuse.ZigoEngine.ROUND_RESULTS;
for (var _local35 in tweens) {
var _local12 = tweens[_local35];
var _local5 = _local12.targ;
var _local34 = _local12.props;
var _local21 = _local5._listeners.length > 0;
if (_local5.__zigoID__ == undefined) {
_local26 = true;
if (com.mosesSupposes.fuse.ZigoEngine._listeners.length > 0) {
var _local25 = [];
for (var _local30 in _local34) {
_local25.unshift(_local30);
}
com.mosesSupposes.fuse.ZigoEngine.broadcastMessage("onTweenInterrupt", {target:((typeof(_local5.addProperty) == "function") ? (_local5) : (("[MISSING:" + _local12.targID) + "]")), props:_local25, __zigoID__:_local12.targZID, during:"update"});
}
continue;
}
for (var _local30 in _local34) {
var _local3 = _local34[_local30];
if (((_local3.ts > now) || (_local3.pt != -1)) && (force != true)) {
continue;
}
var _local9 = now >= (_local3.ts + _local3.d);
if (_local3.complex == -1) {
var _local6;
if (_local9 == true) {
_local6 = _local3.ps + _local3.ch;
if ((_local3.cycles > 1) || (_local3.cycles == 0)) {
if (_local3.cycles > 1) {
_local3.cycles--;
}
_local3.ps = _local6;
_local3.ch = -_local3.ch;
_local3.ts = now;
_local9 = false;
}
} else {
_local6 = _local3.ef(now - _local3.ts, _local3.ps, _local3.ch, _local3.d, _local3.e1, _local3.e2);
}
if (_global.isNaN(_local6) == false) {
if ((_local30 != "_bezier_") && ((_local3.rr == true) || ((_local20 == true) && (!(_local3.rr === false))))) {
_local6 = Math.round(Number(_local6));
}
if (_local3.special != true) {
_local5[_local30] = _local6;
} else if (_local3.fmp != -1) {
_local3.fmp.setFilterProp(_local5, _local30, _local6);
} else if (_local30 == "_bezier_") {
var _local10 = _local3.bz;
var _local18 = _local10.sx + (_local6 * (((2 * (1 - _local6)) * _local10.ctrlx) + (_local6 * _local10.chx)));
var _local17 = _local10.sy + (_local6 * (((2 * (1 - _local6)) * _local10.ctrly) + (_local6 * _local10.chy)));
if ((_local3.rr == true) || ((_local20 == true) && (!(_local3.rr === false)))) {
_local18 = Math.round(Number(_local18));
_local17 = Math.round(Number(_local17));
}
_local5._x = _local18;
_local5._y = _local17;
} else if (_local30 == "_frame") {
MovieClip(_local5).gotoAndStop(Math.ceil(_local6));
}
}
} else {
var _local16 = (_local9 == true) && ((_local3.cycles > 1) || (_local3.cycles == 0));
var _local7 = [];
for (var _local27 in _local3.ch) {
var _local4 = ((_local3.complex == 0) ? ([]) : ({}));
for (var _local28 in _local3.ch[_local27]) {
var _local8 = _local3.ch[_local27][_local28];
var _local11 = _local3.ps[_local27][_local28];
if (_local9 == true) {
_local4[_local28] = _local11 + _local8;
if (_local16 == true) {
_local3.ch[_local27][_local28] = -_local8;
}
} else {
_local4[_local28] = _local3.ef(now - _local3.ts, _local11, _local8, _local3.d, _local3.e1, _local3.e2);
}
if (_global.isNaN(_local4[_local28]) == false) {
if ((_local3.rr == true) || ((_local20 == true) && (!(_local3.rr === false)))) {
_local4[_local28] = Math.round(_local4[_local28]);
}
}
if ((_local3.fmp == -1) && (_local3.c == -1)) {
_local5[_local30][_local28] = _local4[_local28];
}
}
_local7.push(_local4);
if ((_local3.fmp == -1) && (_local3.c == 2)) {
_local5[_local30][_local27] = Number(((_local4.rb << 16) | (_local4.gb << 8)) | _local4.bb);
}
}
if (_local3.fmp != -1) {
if (_local3.c == 1) {
_local3.fmp.setFilterProp(_local5, _local30, ((_local7[0].rb << 16) | (_local7[0].gb << 8)) | _local7[0].bb);
} else if (_local3.c == 2) {
var _local19 = [];
for (var _local28 in _local7) {
_local19.unshift(((_local7[_local28].rb << 16) | (_local7[_local28].gb << 8)) | _local7[_local28].bb);
}
_local3.fmp.setFilterProp(_local5, _local30, _local19);
} else {
_local3.fmp.setFilterProp(_local5, _local30, _local7[0]);
}
} else if (_local3.c != -1) {
_local3.c.setTransform(_local7[0]);
}
if (_local16 == true) {
if (_local3.cycles > 1) {
_local3.cycles--;
}
_local9 = false;
_local3.ts = now;
_local3.ps = _local7;
}
}
if (_local3.sf == false) {
if (_local3.v != 0) {
_local5._visible = true;
}
if (_local21 == true) {
if (_local15[_local35] == undefined) {
_local15[_local35] = [_local5, []];
}
_local15[_local35][1].unshift(_local30);
}
_local3.sf = true;
}
if (_local3.scb.fired == false) {
_local22[String(_local3.scb.id)] = _local3.scb;
_local3.scb.fired = true;
}
if (_local21 == true) {
if (_local13[_local35] == undefined) {
_local13[_local35] = [_local5, []];
}
_local13[_local35][1].unshift(_local30);
}
if (_local3.ucb != undefined) {
_local24[String(_local3.ucb.id)] = _local3.ucb;
}
if (_local9 == true) {
if (_local3.v === -1) {
_local5._visible = false;
}
if (_local3.suppressEnd != true) {
if (_local21 == true) {
if (_local14[_local35] == undefined) {
_local14[_local35] = [_local5, []];
}
_local14[_local35][1].unshift(_local30);
}
if (_local3.ecb != undefined) {
_local23[String(_local3.ecb.id)] = _local3.ecb;
}
}
delete _local34[_local30];
if (_local30 == _local12.colorProp) {
delete _local12.colorProp;
}
_local12.numProps--;
if (_local12.numProps <= 0) {
_local26 = true;
}
}
delete _local3.suppressEnd;
}
}
for (var _local35 in _local15) {
_local15[_local35][0].broadcastMessage("onTweenStart", {target:_local15[_local35][0], props:_local15[_local35][1]});
}
for (var _local35 in _local22) {
_local22[_local35].f.apply(_local22[_local35].s, _local22[_local35].a);
}
for (var _local35 in _local13) {
_local13[_local35][0].broadcastMessage("onTweenUpdate", {target:_local13[_local35][0], props:_local13[_local35][1]});
}
for (var _local35 in _local24) {
_local24[_local35].f.apply(_local24[_local35].s, _local24[_local35].a);
}
for (var _local35 in _local14) {
_local14[_local35][0].broadcastMessage("onTweenEnd", {target:_local14[_local35][0], props:_local14[_local35][1]});
}
for (var _local35 in _local23) {
_local23[_local35].f.apply(_local23[_local35].s, _local23[_local35].a);
}
if (_local26) {
cleanUp();
}
now = getTimer();
}
function cleanUp(noInit) {
for (var _local4 in tweens) {
var _local2 = tweens[_local4].targ;
if ((tweens[_local4].numProps <= 0) || (_local2.__zigoID__ == undefined)) {
if ((((_local2 != undefined) && (_local2.tween == undefined)) && (noInit != true)) && (_local2._listeners.length <= 0)) {
com.mosesSupposes.fuse.ZigoEngine.deinitializeTargets(_local2);
}
delete tweens[_local4];
numTweens--;
}
}
if (numTweens <= 0) {
numTweens = 0;
delete tweens;
tweens = {};
if (noInit != true) {
com.mosesSupposes.fuse.ZigoEngine.__mgrRelay(this, "setup", [true]);
}
}
}
function paramsObj(targs, props, endvals, retainFade) {
var _local6 = {};
_local6.all = String(targs).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALL;
_local6.none = Boolean(targs == null);
if (_local6.all == true) {
_local6.tg = [null];
} else {
_local6.tg = ((targs instanceof Array) ? (targs) : ([targs]));
for (var _local11 in _local6.tg) {
var _local7 = _local6.tg[_local11];
if ((_local7 == null) || (!((typeof(_local7) == "object") || (typeof(_local7) == "movieclip")))) {
_local6.tg.splice(Number(_local11), 1);
}
}
}
_local6.allprops = props == null;
var _local1;
var _local4;
var _local3 = {};
if (_local6.allprops == false) {
if ((typeof(props) == "string") && ((String(props).indexOf(" ") > -1) || (String(props).indexOf(",") > -1))) {
props = String(props.split(" ").join("")).split(",");
}
_local1 = ((props instanceof Array) ? (props.slice()) : ([props]));
if (endvals != undefined) {
if ((typeof(endvals) == "string") && ((String(endvals).indexOf(" ") > -1) || (String(endvals).indexOf(",") > -1))) {
endvals = String(endvals.split(" ").join("")).split(",");
}
_local4 = ((endvals instanceof Array) ? (endvals.slice()) : ([endvals]));
while (_local4.length < _local1.length) {
_local4.push(_local4[_local4.length - 1]);
}
_local4.splice(_local1.length, _local4.length - _local1.length);
}
for (var _local11 in _local1) {
var _local2 = Number(_local11);
if ((_local1[_local11] != "_scale") && (_local1[_local11] != "_size")) {
if (_local3[_local1[_local11]] == undefined) {
if ((_local1[_local11] == "_fade") && (retainFade != true)) {
_local1[_local11] = "_alpha";
}
if (String(_local1[_local11]).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR) {
_local1[_local11] = com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR;
}
_local3[_local1[_local11]] = true;
} else {
_local1.splice(_local2, 1);
_local4.splice(_local2, 1);
}
} else {
var _local8 = String(_local1.splice(_local2, 1)[0]);
var _local5 = _local4.splice(_local2, 1)[0];
if (_local8 == "_scale") {
if (_local3._xscale == undefined) {
_local1.splice(_local2, 0, "_xscale");
_local4.splice(_local2, 0, _local5);
_local3._xscale = true;
_local2++;
}
if (_local3._yscale == undefined) {
_local1.splice(_local2, 0, "_yscale");
_local4.splice(_local2, 0, _local5);
_local3._yscale = true;
}
}
if (_local8 == "_size") {
if (_local3._width == undefined) {
_local1.splice(_local2, 0, "_width");
_local4.splice(_local2, 0, _local5);
_local3._width = true;
_local2++;
}
if (_local3._yscale == undefined) {
_local1.splice(_local2, 0, "_height");
_local4.splice(_local2, 0, _local5);
_local3._height = true;
}
}
}
}
for (var _local11 in _local1) {
if (((_local1[_local11] == "_xscale") && (_local3._width == true)) || ((_local1[_local11] == "_yscale") && (_local3._height == true))) {
_local1.splice(Number(_local11), 1);
_local4.splice(Number(_local11), 1);
delete _local3[_local1[_local11]];
}
}
}
_local6.pa = _local1;
_local6.va = _local4;
_local6.props = _local3;
return(_local6);
}
function getChangeObj(ps, ep, isFMP, useArray) {
var _local3 = {map:((useArray == true) ? ([]) : ({})), changed:false};
for (var _local7 in ep) {
if ((((((isFMP == true) && (_local7.charAt(1) == "b")) || (ep[_local7] != ps[_local7])) || (useArray == true)) && (ep[_local7] != null)) && (_global.isNaN(Number(ep[_local7])) == false)) {
_local3.map[_local7] = ((typeof(ep[_local7]) == "string") ? (Number(ep[_local7])) : (ep[_local7] - ps[_local7]));
if (_global.isNaN(_local3.map[_local7]) == true) {
_local3.map[_local7] = 0;
} else if (_local3.map[_local7] != 0) {
_local3.changed = true;
}
}
}
return(_local3);
}
var numTweens = 0;
}
Symbol 2652 MovieClip [__Packages.com.mosesSupposes.fuse.PennerEasing] Frame 0
class com.mosesSupposes.fuse.PennerEasing
{
function PennerEasing () {
}
static function linear(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInQuad(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOutQuad(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOutQuad(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static function easeInExpo(t, b, c, d) {
return(((t == 0) ? (b) : ((c * Math.pow(2, 10 * ((t / d) - 1))) + b)));
}
static function easeOutExpo(t, b, c, d) {
return(((t == d) ? (b + c) : ((c * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
}
static function easeInOutExpo(t, b, c, d) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * Math.pow(2, 10 * (t - 1))) + b);
}
t--;
return(((c / 2) * ((-Math.pow(2, -10 * t)) + 2)) + b);
}
static function easeOutInExpo(t, b, c, d) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * ((-Math.pow(2, -10 * t)) + 1)) + b);
}
return(((c / 2) * (Math.pow(2, 10 * (t - 2)) + 1)) + b);
}
static function easeInElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p))) + b);
}
static function easeOutElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOutElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (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) - _local5) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static function easeOutInElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
return(((0.5 * ((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p))) + (c / 2)) + b);
}
return(((c / 2) + (0.5 * ((a * Math.pow(2, 10 * (t - 2))) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)))) + b);
}
static function easeInBack(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 easeOutBack(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 easeInOutBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static function easeOutInBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
t--;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
t--;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) - s)) + 1)) + b);
}
static function easeOutBounce(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 easeInBounce(t, b, c, d) {
return((c - easeOutBounce(d - t, 0, c, d)) + b);
}
static function easeInOutBounce(t, b, c, d) {
if (t < (d / 2)) {
return((easeInBounce(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOutBounce((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeOutInBounce(t, b, c, d) {
if (t < (d / 2)) {
return((easeOutBounce(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeInBounce((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeInCubic(t, b, c, d) {
t = t / d;
return((((c * t) * t) * t) + b);
}
static function easeOutCubic(t, b, c, d) {
t = (t / d) - 1;
return((c * (((t * t) * t) + 1)) + b);
}
static function easeInOutCubic(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((t * t) * t) + 2)) + b);
}
static function easeOutInCubic(t, b, c, d) {
t = t / (d / 2);
t--;
return(((c / 2) * (((t * t) * t) + 1)) + b);
}
static function easeInQuart(t, b, c, d) {
t = t / d;
return(((((c * t) * t) * t) * t) + b);
}
static function easeOutQuart(t, b, c, d) {
t = (t / d) - 1;
return(((-c) * ((((t * t) * t) * t) - 1)) + b);
}
static function easeInOutQuart(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
t = t - 2;
return((((-c) / 2) * ((((t * t) * t) * t) - 2)) + b);
}
static function easeOutInQuart(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
t--;
return((((-c) / 2) * ((((t * t) * t) * t) - 1)) + b);
}
t--;
return(((c / 2) * ((((t * t) * t) * t) + 1)) + b);
}
static function easeInQuint(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOutQuint(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOutQuint(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static function easeOutInQuint(t, b, c, d) {
t = t / (d / 2);
t--;
return(((c / 2) * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInSine(t, b, c, d) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
}
static function easeOutSine(t, b, c, d) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
}
static function easeInOutSine(t, b, c, d) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
}
static function easeOutInSine(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * Math.sin((Math.PI * t) / 2)) + b);
}
t--;
return((((-c) / 2) * (Math.cos((Math.PI * t) / 2) - 2)) + b);
}
static function easeInCirc(t, b, c, d) {
t = t / d;
return(((-c) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
static function easeOutCirc(t, b, c, d) {
t = (t / d) - 1;
return((c * Math.sqrt(1 - (t * t))) + b);
}
static function easeInOutCirc(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
t = t - 2;
return(((c / 2) * (Math.sqrt(1 - (t * t)) + 1)) + b);
}
static function easeOutInCirc(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
t--;
return(((c / 2) * Math.sqrt(1 - (t * t))) + b);
}
t--;
return(((c / 2) * (2 - Math.sqrt(1 - (t * t)))) + b);
}
static var registryKey = "pennerEasing";
}
Symbol 2653 MovieClip [__Packages.com.deeperbeige.utils.CompareSpelling] Frame 0
class com.deeperbeige.utils.CompareSpelling
{
function CompareSpelling () {
}
static function matches(correct, attempt, allowIncomplete) {
if (allowIncomplete == undefined) {
allowIncomplete = false;
}
var _local2 = _reduceString(correct);
var _local1 = _reduceString(attempt);
if (allowIncomplete) {
if (_local1.indexOf(_local2) != -1) {
return(true);
}
} else if (_local2 == _local1) {
return(true);
}
return(false);
}
static function _reduceString(input) {
var _local5 = "";
input = input.toLowerCase();
var _local3 = " ";
var _local2 = 0;
while (_local2 < input.length) {
var _local1 = input.charAt(_local2);
if ((_local1 == " ") && (_local3 == " ")) {
} else {
switch (_local1) {
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
case "g" :
case "h" :
case "i" :
case "j" :
case "k" :
case "l" :
case "m" :
case "n" :
case "o" :
case "p" :
case "q" :
case "r" :
case "s" :
case "t" :
case "u" :
case "v" :
case "w" :
case "x" :
case "y" :
case "z" :
case " " :
break;
default :
// unexpected jump
}
_local5 = _local5 + _local1;
_local3 = _local1;
}
_local2++;
}
if (_local3 == " ") {
_local5 = _local5.substr(0, _local5.length - 1);
}
return(_local5);
}
}
Symbol 2654 MovieClip [__Packages.com.deeperbeige.utils.Profiler] Frame 0
class com.deeperbeige.utils.Profiler
{
static var clip;
function Profiler () {
}
static function label(strLabel) {
var _local2 = getTimer();
var _local1 = _local2 - time_start;
if (!active) {
return(undefined);
}
calls++;
if ((clip == undefined) && (traceEvery == 1)) {
trace(((("PROFILE: " + strLabel) + ": ") + _local1) + "ms");
} else {
if (nextLabel != null) {
if (arrTimes[nextLabel] == undefined) {
arrTimes[nextLabel] = 0;
}
arrTimes[nextLabel] = arrTimes[nextLabel] + _local1;
if (arrHits[nextLabel] == undefined) {
arrHits[nextLabel] = 0;
}
arrHits[nextLabel]++;
}
nextLabel = strLabel;
if ((clip == undefined) && ((calls % traceEvery) == 0)) {
traceResults();
}
}
time_start = getTimer();
}
static function setTraceEvery(labelCalls) {
traceEvery = labelCalls;
}
static function setActive(enabled) {
active = enabled;
clip._visible = enabled;
}
static function setTracing(enabled) {
tracing = enabled;
}
static function setClip(fpsClip, frameRate, traceFrames) {
if (fpsClip == undefined) {
trace("Profiler: FPS clip is undefined");
}
if (frameRate == undefined) {
frameRate = 30;
}
if (traceFrames == undefined) {
traceFrames = 5 * frameRate;
}
clip = fpsClip;
traceEvery = traceFrames;
intendedFrameRate = frameRate;
clip.onEnterFrame = function () {
com.deeperbeige.utils.Profiler.evtEnterFrame();
};
}
static function evtEnterFrame() {
if (!active) {
return(undefined);
}
frames++;
if ((frames % fpsBarFrames) == 0) {
var _local1 = Math.ceil((1000 * fpsBarFrames) / (getTimer() - lastBarTime));
clip.gotoAndStop(Math.ceil((100 * _local1) / intendedFrameRate));
lastBarTime = getTimer();
}
if ((frames % fpsTxtFrames) == 0) {
var _local1 = Math.ceil((1000 * fpsTxtFrames) / (getTimer() - lastTxtTime));
clip.txtFPS.text = _local1;
lastTxtTime = getTimer();
}
if ((frames % traceEvery) == 0) {
traceResults();
}
}
static function traceResults() {
if (!active) {
return(undefined);
}
if (!tracing) {
return(undefined);
}
var _local2 = 0;
for (var _local4 in arrTimes) {
_local2 = _local2 + arrTimes[_local4];
}
trace("");
trace(("PROFILE TOTAL: " + _local2) + "ms");
var _local3 = "";
for (var _local4 in arrTimes) {
var _local1 = (arrTimes[_local4] * 100) / _local2;
_local3 = (((((((com.deeperbeige.utils.Format.number(_local1, 2, 1) + "%: ") + _local4) + " (") + arrTimes[_local4]) + "ms, ") + arrHits[_local4]) + " hits)\n") + _local3;
arrTimes[_local4] = 0;
arrHits[_local4] = 0;
}
trace(_local3);
}
static var traceEvery = 100;
static var fpsBarFrames = 3;
static var fpsTxtFrames = 24;
static var time_start = getTimer();
static var lastBarTime = getTimer();
static var lastTxtTime = getTimer();
static var arrTimes = {};
static var arrHits = {};
static var calls = 0;
static var frames = 0;
static var intendedFrameRate = 30;
static var nextLabel = null;
static var active = true;
static var tracing = true;
}
Symbol 2655 MovieClip [__Packages.com.deeperbeige.utils.Format] Frame 0
class com.deeperbeige.utils.Format
{
function Format () {
}
static function number(num, leadingDigits, decimalDigits) {
var _local2 = "" + Math.floor(num);
while (_local2.length < leadingDigits) {
_local2 = "0" + _local2;
}
if (decimalDigits != undefined) {
var _local1 = Math.abs(num) - Math.floor(Math.abs(num));
_local1 = _local1 * Math.pow(10, decimalDigits);
_local1 = Math.floor(_local1);
_local1 = "" + _local1;
while (_local1.length < decimalDigits) {
_local1 = _local1 + "0";
}
_local2 = (_local2 + ".") + _local1;
}
return(_local2);
}
}
Symbol 163 MovieClip Frame 1
siteButton.onRelease = function () {
var _local1 = flash.external.ExternalInterface.call("eval", "document.location.href");
if (_local1.indexOf("facebook") == 1) {
getURL ("http://apps.facebook.com/addictinggames", "_blank");
} else {
getURL ("http://www.addictinggames.com", "_blank");
}
};
Symbol 163 MovieClip Frame 95
stop();
_root.objTrans.goto("intro", undefined, false);
Symbol 167 MovieClip [explosion] Frame 6
this.removeMovieClip();
Symbol 178 MovieClip [gooball] Frame 1
this.gotoAndStop(_root.Maths.randomInt(2, this._totalframes));
Symbol 202 MovieClip [spark] Frame 20
this.removeMovieClip();
Symbol 212 MovieClip [smoke] Frame 50
this.removeMovieClip();
Symbol 216 MovieClip [spangle] Frame 13
this.removeMovieClip();
Symbol 220 MovieClip [jetsmoke] Frame 50
this.removeMovieClip();
Symbol 231 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 238 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 248 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 256 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 257 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 267 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 277 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 289 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 292 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 293 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 297 MovieClip [trailGfx] Frame 10
this.removeMovieClip();
Symbol 301 MovieClip Frame 1
gotoAndPlay(_root.Maths.randomInt(11, 16));
Symbol 301 MovieClip Frame 17
gotoAndPlay ("loop");
Symbol 302 MovieClip [burstGfx] Frame 57
this.removeMovieClip();
Symbol 303 Button
on (release) {
_root.gotoSponsor();
}
Symbol 315 MovieClip Frame 1
stop();
Symbol 320 MovieClip Frame 1
stop();
Symbol 324 MovieClip Frame 1
stop();
Symbol 327 MovieClip Frame 1
stop();
Symbol 336 MovieClip [message] Frame 1
stop();
Symbol 347 MovieClip [refQuizRow] Frame 1
stop();
Symbol 355 MovieClip Frame 1
stop();
Symbol 589 MovieClip Frame 1
stop();
Symbol 610 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
_root.startMusic();
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 615 MovieClip Frame 10
stop();
Symbol 616 MovieClip Frame 1
gotoAndStop ("off");
Symbol 616 MovieClip Frame 11
stop();
Symbol 630 MovieClip Frame 1
this._visible = false;
Symbol 643 MovieClip Frame 1
this._visible = false;
Instance of Symbol 641 MovieClip "beam" in Symbol 644 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 685 MovieClip Frame 1
stop();
Symbol 685 MovieClip Frame 25
_root.objSounds.play("achievement");
Symbol 685 MovieClip Frame 111
gotoAndStop ("idle");
Symbol 690 Button
on (release) {
_root.objTrans.goto("wipeprogress");
}
Symbol 694 Button
on (release) {
_root.arrLevels = undefined;
var objSO = SharedObject.getLocal("hannainachoppa2");
objSO.data.arrLevels = undefined;
objSO.flush();
_root.objTrans.goto("intro");
}
Symbol 698 Button
on (release) {
_root.arrAchievements = undefined;
var objSO = SharedObject.getLocal("hannainachoppa2");
objSO.data.arrAchievements = undefined;
objSO.flush();
_root.objTrans.goto("intro");
}
Symbol 701 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("achievements");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 726 Button
on (release) {
_root.showHelpFor("lifter");
}
Symbol 728 Button
on (release) {
_root.showHelpFor("saucer");
}
Symbol 730 Button
on (release) {
_root.showHelpFor("jetpack");
}
Symbol 732 Button
on (release) {
_root.showHelpFor("classic");
}
Symbol 734 Button
on (release) {
_root.showHelpFor("tardis");
}
Symbol 736 Button
on (release) {
_root.showHelpFor("balloon");
}
Symbol 738 Button
on (release) {
_root.showHelpFor("joust");
}
Symbol 740 Button
on (release) {
_root.showHelpFor("vtol");
}
Symbol 742 Button
on (release) {
_root.showHelpFor("biplane");
}
Symbol 745 Button
on (release) {
_root.showHelpFor("zorb");
}
Symbol 747 Button
on (release) {
_root.showHelpFor("sam");
}
Symbol 749 Button
on (release) {
_root.showHelpFor("perfect");
}
Symbol 751 Button
on (release) {
_root.showHelpFor("fast");
}
Symbol 753 Button
on (release) {
_root.showHelpFor("secret");
}
Symbol 757 Button
on (release) {
_root.backToMenu = false;
_root.objTrans.goto("vehicles");
}
Symbol 761 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("quiz");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 764 Button
on (release) {
_root.objTrans.goto("rewards");
}
Symbol 766 Button
on (release) {
_root.gotoWalkthrough();
}
Symbol 772 MovieClip Frame 4
stop();
Symbol 776 Button
on (release) {
_root.objTrans.goto("feedback");
}
Symbol 784 Button
on (release) {
_root.objTrans.goto("picklevel");
}
Symbol 792 Button
on (release) {
_root.downloadPDF("lifter-choppa.pdf");
_root.trackPoint("Downloaded_lifter");
}
Symbol 798 Button
on (release) {
_root.downloadPDF("classic-choppa.pdf");
_root.trackPoint("Downloaded_classic");
}
Symbol 804 Button
on (release) {
_root.downloadPDF("one-ton-weight.pdf");
_root.trackPoint("Downloaded_oneton");
}
Symbol 810 Button
on (release) {
_root.downloadPDF("emo-button.pdf");
_root.trackPoint("Downloaded_button");
}
Symbol 814 Button
on (release) {
_root.arrLevels = undefined;
_root.arrAchievements = undefined;
var objSO = SharedObject.getLocal("hannainachoppa2");
objSO.clear();
objSO.flush();
_root.objSounds.stop("music");
_root.workingOnLevel = undefined;
_root.runOnceDone = false;
_root.objTrans.goto("intro");
}
Symbol 818 Button
on (release) {
_root.objTrans.goto("picklevel");
}
Instance of Symbol 828 MovieClip "beam" in Symbol 868 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 874 MovieClip Frame 10
stop();
Symbol 875 MovieClip Frame 1
gotoAndStop ("off");
Symbol 875 MovieClip Frame 11
stop();
Symbol 896 MovieClip Frame 1
_visible = false;
Symbol 906 MovieClip Frame 1
stop();
Instance of Symbol 897 MovieClip "beam" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 939 MovieClip Frame 1
stop();
Symbol 1062 MovieClip Frame 1
stop();
Symbol 1074 MovieClip Frame 1
function checkValid() {
if ((txtFeedback.text == defaultText) || (txtFeedback.text == "")) {
defaultText = "No no no, you're meant to write in this box. Over here!";
txtFeedback.text = defaultText;
return(false);
}
return(true);
}
stop();
var objDatacap = (new _root.Datacap("HannaInAChoppa2_feedback", "stf"));
objDatacap.registerTextbox("feedback", txtFeedback);
objDatacap.setHiddenValue("email", "noreply@deeperbeige.com");
objDatacap.setHiddenValue("femail", "hannainachoppa@deeperbeige.com");
objDatacap.registerSubmit("submit", btnSubmit, "submit");
objDatacap.registerFrames("sending", "success", "failure", this);
objDatacap.registerCallbacks(checkValid);
this.errFeedback._visible = false;
defaultText = "Tap out some text here, then hit submit";
txtFeedback.text = defaultText;
txtFeedback.onSetFocus = function () {
if (txtFeedback.text == defaultText) {
txtFeedback.text = "";
}
};
txtFeedback.onKillFocus = function () {
defaultText = "No no no, you're meant to write in this box. Over here!";
if (txtFeedback.text == "") {
txtFeedback.text = defaultText;
}
};
Symbol 1074 MovieClip Frame 21
_root.trackPoint("Feedback_success");
Symbol 1074 MovieClip Frame 31
_root.trackPoint("Feedback_failure");
Symbol 1075 Button
on (release) {
if (neverPress.buttonStage == "song") {
var objSO = SharedObject.getLocal("hannainachoppa2");
objSO.data.buttonStage = "pokePrep";
objSO.flush();
}
_root.objTrans.goto("picklevel");
}
Symbol 1079 Button
on (release) {
_root.gotoAuthor();
}
Symbol 1090 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 1090 MovieClip Frame 50
_parent.btnNeverPress.enabled = true;
gotoAndStop ("idle");
Symbol 1091 MovieClip Frame 1
_root.setupNeverPress(this);
Symbol 1095 MovieClip Frame 11
stop();
Symbol 1095 MovieClip Frame 21
this.frame = 0;
this.onEnterFrame = function () {
this.frame++;
if ((this.frame % 20) > 0) {
return(undefined);
}
var _local3 = new Color(bg);
var _local5 = _root.Maths.randomInt(0, 128);
var _local6 = _root.Maths.randomInt(0, 128);
var _local4 = _root.Maths.randomInt(0, 128);
_local3.setTransform({ra:0, rb:_local5, ga:0, gb:_local6, ba:0, bb:_local4, aa:100, ab:0});
};
Symbol 1116 Button
on (release) {
_root.gotoSponsor();
}
Symbol 1123 MovieClip Frame 1
stop();
Symbol 1123 MovieClip Frame 9
stop();
Symbol 1132 MovieClip Frame 1
stop();
Symbol 1157 MovieClip Frame 1
_visible = false;
Symbol 1159 MovieClip Frame 1
stop();
this.state = "off";
Symbol 1159 MovieClip Frame 11
this.state = "on";
Symbol 1172 MovieClip Frame 1
_visible = false;
Symbol 1196 MovieClip Frame 1
stop();
Symbol 1196 MovieClip Frame 11
stop();
Symbol 1196 MovieClip Frame 21
stop();
Symbol 1220 MovieClip Frame 1
stop();
Symbol 1220 MovieClip Frame 19
_root.objSounds.play("bleep");
Symbol 1220 MovieClip Frame 27
_root.objSounds.play("servo");
Symbol 1220 MovieClip Frame 50
gotoAndPlay ("loop");
_root.objSounds.play("servo");
Symbol 1224 MovieClip Frame 1
_visible = false;
Symbol 1225 MovieClip Frame 1
stop();
Symbol 1225 MovieClip Frame 16
_root.objSounds.play("servo1");
Symbol 1225 MovieClip Frame 47
stop();
probulator.play();
_root.showDelayedRef();
_root.objSounds.play("moo-distress");
Symbol 1296 MovieClip Frame 1
gotoAndPlay(_root.Maths.randomInt(2, _totalframes));
Symbol 1296 MovieClip Frame 9
gotoAndPlay ("loop");
Symbol 1301 MovieClip Frame 1
gotoAndPlay(_root.Maths.randomInt(2, _totalframes));
Symbol 1301 MovieClip Frame 9
gotoAndPlay ("loop");
Symbol 1306 MovieClip Frame 1
gotoAndPlay(_root.Maths.randomInt(2, _totalframes));
Symbol 1306 MovieClip Frame 9
gotoAndPlay ("loop");
Symbol 1401 MovieClip Frame 1
stop();
this.stopped = true;
Symbol 1401 MovieClip Frame 40
this.stopped = true;
Symbol 1401 MovieClip Frame 153
this.stopped = true;
Symbol 1401 MovieClip Frame 266
this.stopped = true;
Symbol 1401 MovieClip Frame 305
this.stopped = true;
Symbol 1401 MovieClip Frame 344
this.stopped = true;
Symbol 1401 MovieClip Frame 383
this.stopped = true;
Symbol 1430 MovieClip Frame 1
_visible = false;
Symbol 1450 MovieClip Frame 56
stop();
Symbol 1450 MovieClip Frame 81
stop();
Symbol 1450 MovieClip Frame 106
stop();
Symbol 1450 MovieClip Frame 132
stop();
Symbol 1450 MovieClip Frame 155
stop();
Symbol 1457 MovieClip Frame 1
stop();
Symbol 1472 MovieClip Frame 1
if (this.stopping) {
this.stopped = true;
this._parent.flag._y = this._parent.flag.origY;
_root.objGame.flagAppeared();
_root.objSounds.stop("loop-machine");
_root.foundSecret();
}
Symbol 1472 MovieClip Frame 126
if (this.stopping) {
this.stopped = true;
this._parent.flag._y = this._parent.flag.origY;
_root.objGame.flagAppeared();
_root.objSounds.stop("loop-machine");
}
Symbol 1472 MovieClip Frame 250
if (this.stopping) {
this.stopped = true;
this._parent.flag._y = this._parent.flag.origY;
_root.objSounds.stop("loop-machine");
_root.objGame.flagAppeared();
}
Symbol 1472 MovieClip Frame 375
if (this.stopping) {
this.stopped = true;
this._parent.flag._y = this._parent.flag.origY;
_root.objSounds.stop("loop-machine");
_root.objGame.flagAppeared();
}
Symbol 1544 MovieClip Frame 1
stop();
this.state = "idle";
Symbol 1544 MovieClip Frame 2
this.state = "active";
Symbol 1544 MovieClip Frame 151
stop();
this.state = "idle";
Symbol 1544 MovieClip Frame 152
this.state = "active";
Symbol 1544 MovieClip Frame 301
stop();
this.state = "idle";
Symbol 1544 MovieClip Frame 302
this.state = "active";
Symbol 1544 MovieClip Frame 1123
stop();
this.state = "idle";
_parent.b3.gotoAndStop("plinky");
Symbol 1544 MovieClip Frame 1124
stop();
_root.foundSecret();
this.state = "active";
Symbol 1549 MovieClip Frame 1
stop();
Symbol 1568 MovieClip Frame 1
stop();
Symbol 1605 MovieClip Frame 1
stop();
Symbol 1605 MovieClip Frame 5
this.surface.removeSurface();
Symbol 1634 MovieClip Frame 30
gotoAndPlay ("loopRuined");
Symbol 1634 MovieClip Frame 60
gotoAndPlay ("saved");
Symbol 1642 MovieClip Frame 1
stop();
Symbol 1703 MovieClip Frame 60
stop();
Symbol 1704 MovieClip Frame 1
stop();
_visible = false;
Symbol 1719 MovieClip Frame 881
stop();
this.stopped = true;
Symbol 1719 MovieClip Frame 882
play();
this.stopped = false;
Symbol 1719 MovieClip Frame 888
stop();
this.stopped = true;
Symbol 1750 MovieClip Frame 1
_visible = false;
Symbol 1762 MovieClip Frame 1
gotoAndPlay(Math.floor(Math.random() * (this._totalframes - 3)) + 2);
Symbol 1762 MovieClip Frame 38
gotoAndPlay ("loop");
Symbol 1769 MovieClip Frame 1
stop();
Symbol 1769 MovieClip Frame 3
_root.objSounds.play("punch");
Symbol 1779 MovieClip Frame 6
_root.objSounds.play("punch", 60);
Symbol 1781 MovieClip Frame 1
_visible = false;
Symbol 1815 MovieClip Frame 1
gotoAndPlay(_root.Maths.randomInt(2, 80));
Symbol 1815 MovieClip Frame 82
gotoAndPlay ("walkloop");
Symbol 1815 MovieClip Frame 93
stop();
Symbol 1825 MovieClip Frame 1
_visible = false;
Symbol 1829 MovieClip Frame 1
stop();
Symbol 1829 MovieClip Frame 2
_root.objSounds.play("targetbreak");
Symbol 1829 MovieClip Frame 3
_root.objSounds.play("targetbreak");
Symbol 1829 MovieClip Frame 4
_root.objSounds.play("gate-unlock");
_root.objSounds.play("targetbreak");
Symbol 1840 MovieClip Frame 1
stop();
Symbol 1853 MovieClip Frame 1
stop();
this.state = "idle";
Symbol 1853 MovieClip Frame 11
this.state = "fire";
Symbol 1889 MovieClip Frame 1
stop();
_visible = false;
Symbol 1889 MovieClip Frame 20
stop();
Symbol 1897 MovieClip Frame 1
this.painting = true;
Symbol 1897 MovieClip Frame 953
stop();
this.painting = false;
Symbol 1903 MovieClip Frame 1
stop();
Symbol 1903 MovieClip Frame 10
stop();
Symbol 1906 MovieClip Frame 1
stop();
Symbol 1906 MovieClip Frame 20
stop();
Symbol 1917 MovieClip Frame 1
stop();
Symbol 1917 MovieClip Frame 10
stop();
Symbol 1933 MovieClip Frame 1
stop();
Symbol 1933 MovieClip Frame 41
_root.objSounds.play("ghostdie");
Symbol 1933 MovieClip Frame 70
stop();
Symbol 1952 MovieClip Frame 1
_visible = false;
Symbol 1981 MovieClip Frame 1
_visible = false;
Symbol 1999 MovieClip Frame 1
stop();
this.idle = true;
Symbol 1999 MovieClip Frame 11
this.idle = false;
Symbol 2011 MovieClip Frame 1
_visible = false;
Symbol 2025 MovieClip Frame 1
gotoAndPlay(Math.floor(Math.random() * (this._totalframes - 2)) + 2);
Symbol 2038 MovieClip Frame 1
_root.objSounds.play("loop-countdown", 100, true);
Symbol 2038 MovieClip Frame 1324
stop();
hand.stop();
_root.objGame.doomsdayNow();
_root.objSounds.stop("loop-countdown");
Symbol 2047 MovieClip Frame 30
stop();
Symbol 2051 MovieClip Frame 30
stop();
Symbol 2052 MovieClip Frame 1
stop();
Symbol 2060 MovieClip Frame 1
gotoAndPlay (2);
Symbol 2060 MovieClip Frame 60
stop();
Symbol 2061 MovieClip Frame 1
stop();
Symbol 2066 MovieClip Frame 1
stop();
Symbol 2066 MovieClip Frame 2
_root.showDelayedRef();
Symbol 2072 MovieClip Frame 1
_visible = false;
Symbol 2080 MovieClip Frame 1
stop();
Symbol 2080 MovieClip Frame 63
stop();
Symbol 2112 MovieClip Frame 1
stop();
Symbol 2112 MovieClip Frame 120
stop();
Symbol 2127 MovieClip Frame 1
stop();
this.idle = true;
Symbol 2127 MovieClip Frame 11
this.idle = false;
_root.objSounds.play("fuse");
Symbol 2127 MovieClip Frame 135
if (!_root.objGame.noMoreFuses) {
_parent.b1.gotoAndStop("off");
}
Symbol 2130 MovieClip Frame 1
stop();
Symbol 2133 MovieClip Frame 1
stop();
Symbol 2136 MovieClip Frame 1
stop();
Symbol 2139 MovieClip Frame 1
stop();
Symbol 2142 MovieClip Frame 1
stop();
Symbol 2197 MovieClip Frame 420
stop();
_parent._parent.b1._x = _parent._parent.b1._x + 6000;
_parent._parent.b1._visible = true;
Symbol 2198 MovieClip Frame 1
stop();
hit._visible = false;
Symbol 2256 MovieClip Frame 1
this._visible = false;
Symbol 2270 MovieClip Frame 2
gotoAndPlay (1);
Symbol 2270 MovieClip Frame 30
stop();
Symbol 2279 MovieClip Frame 1
stop();
Symbol 2337 MovieClip Frame 935
stop();
Symbol 2357 MovieClip Frame 600
_parent.b4._x = _parent.b4._x + 1000;
Symbol 2357 MovieClip Frame 693
_parent.b4._x = _parent.b4._x - 1000;
Symbol 2357 MovieClip Frame 855
stop();
_root.objSounds.stop("ratchet-loop");
Symbol 2380 MovieClip Frame 1
stop();
Symbol 2384 MovieClip Frame 1
this.hit._visible = false;
Symbol 2387 MovieClip Frame 1
gotoAndPlay(_root.Maths.randomInt(2, this._totalframes));
Symbol 2387 MovieClip Frame 41
gotoAndPlay ("loop");
Symbol 2399 MovieClip Frame 1
this._visible = false;
Symbol 2426 MovieClip Frame 1
stop();
Symbol 2426 MovieClip Frame 48
stop();
Symbol 2426 MovieClip Frame 63
stop();
Symbol 2439 MovieClip Frame 1
this.hit._visible = false;
Symbol 2452 MovieClip Frame 1
hit._visible = false;
p0._visible = false;
p1._visible = false;
Symbol 2470 MovieClip Frame 1
stop();
Symbol 2475 MovieClip Frame 10
_root.objSounds.play("scissors");
Symbol 2476 MovieClip Frame 1
stop();
Symbol 2488 MovieClip Frame 1
_root.objSounds.play("crushotron-rumble");
Symbol 2488 MovieClip Frame 91
_root.objSounds.play("crushotron-bang");
Symbol 2488 MovieClip Frame 121
_root.objSounds.play("crushotron-rumble");
Symbol 2495 MovieClip Frame 1
this._visible = false;
Symbol 2501 MovieClip Frame 1
stop();
Symbol 2501 MovieClip Frame 30
stop();
Symbol 2530 MovieClip Frame 1
gotoAndStop ("unbaked");
Instance of Symbol 2524 MovieClip "hit" in Symbol 2530 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
this.required = ["eggs", "flour", "butter", "sugar", "chocolate"];
this.evtItemHit = function (itemClip) {
var _local3 = 0;
while (_local3 < this.required.length) {
if (this.required[_local3] == itemClip.ingredient) {
this.required.splice(_local3, 1);
trace("got " + itemClip.ingredient);
_root.objSounds.play("voice-" + itemClip.ingredient);
if (this.required.length == 0) {
trace("all items collected");
this._parent.gotoAndPlay("baked");
}
return(undefined);
}
_local3++;
}
};
}
Symbol 2530 MovieClip Frame 21
_parent.sign.gotoAndPlay("hide");
Symbol 2530 MovieClip Frame 40
_root.objSounds.play("cake-mix");
Symbol 2530 MovieClip Frame 120
stop();
_root.objGame.raiseHandle();
Symbol 2530 MovieClip Frame 121
this.startFrame = this._currentframe;
this.range = this._totalframes - this.startFrame;
Symbol 2530 MovieClip Frame 620
stop();
this.startFrame = undefined;
this.range = undefined;
_root.objGame.handleComplete();
_root.objSounds.play("voice-cake");
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 2
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[12];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.doorA.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b2" in Symbol 2544 MovieClip Frame 2
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[5];
this.evtTriggered = function (objMass) {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.doorB.fadeOut(0.5);
if (objMass.isWinch) {
_root.foundSecret();
}
};
}
Instance of Symbol 1190 MovieClip "b3" in Symbol 2544 MovieClip Frame 4
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (this._parent.b0._currentframe != 1) {
return(undefined);
}
if (objMass.isChoppa) {
_root.foundSecret();
}
};
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 4
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.b0.play();
};
}
Instance of Symbol 1159 MovieClip "b2" in Symbol 2544 MovieClip Frame 4
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.b0.play();
};
}
Instance of Symbol 1236 MovieClip "b3" in Symbol 2544 MovieClip Frame 5
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1236 MovieClip "b2" in Symbol 2544 MovieClip Frame 5
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1236 MovieClip "b1" in Symbol 2544 MovieClip Frame 5
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1236 MovieClip "b0" in Symbol 2544 MovieClip Frame 5
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1275 MovieClip "b5" in Symbol 2544 MovieClip Frame 6
onClipEvent (load) {
if (_root.vehicleID == "balloon") {
this._x = this._x - 130;
}
var level = this._parent;
_root.objSounds.registerSources(level.choppa, [level.b5, level.b4, level.b3.hub, level.b2.hub, level.b1.hub], "loop-machine", 200);
}
Instance of Symbol 1159 MovieClip "b2" in Symbol 2544 MovieClip Frame 7
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[1];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.hellsgate.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 7
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[5];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.exitBlock.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 7
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.findunlock.fadeOut(0.5);
};
}
Instance of Symbol 1401 MovieClip "b0" in Symbol 2544 MovieClip Frame 10
onClipEvent (load) {
this.stopped = true;
}
Instance of Symbol 1190 MovieClip "b1" in Symbol 2544 MovieClip Frame 10
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa && (this._parent.b0.stopped)) {
_root.objSounds.play("crushotron-rumble");
this._parent.b2.active = true;
this._parent.b0.stopped = false;
this.massTouching = undefined;
}
};
}
Instance of Symbol 1403 MovieClip "b2" in Symbol 2544 MovieClip Frame 10
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if ((this.active && (objMass.isChoppa)) && (this._parent.b0.stopped)) {
_root.objSounds.play("crushotron-rumble");
this._parent.b3.active = true;
this._parent.b0.stopped = false;
this.massTouching = undefined;
}
};
}
Instance of Symbol 1404 MovieClip "b3" in Symbol 2544 MovieClip Frame 10
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if ((this.active && (objMass.isChoppa)) && (this._parent.b0.stopped)) {
_root.objSounds.play("crushotron-rumble");
this._parent.b4.active = true;
this._parent.b0.stopped = false;
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b4" in Symbol 2544 MovieClip Frame 10
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if ((this.active && (objMass.isChoppa)) && (this._parent.b0.stopped)) {
_root.objSounds.play("crushotron-rumble");
this._parent.b5.active = true;
this._parent.b0.stopped = false;
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b5" in Symbol 2544 MovieClip Frame 10
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if ((this.active && (objMass.isChoppa)) && (this._parent.b0.stopped)) {
_root.objSounds.play("crushotron-rumble");
this._parent.b6.active = true;
this._parent.b0.stopped = false;
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b6" in Symbol 2544 MovieClip Frame 10
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if ((this.active && (objMass.isChoppa)) && (this._parent.b0.stopped)) {
_root.objSounds.play("crushotron-rumble");
this._parent.b0.stopped = false;
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b0" in Symbol 2544 MovieClip Frame 12
onClipEvent (load) {
this._visible = false;
this.active = false;
this._parent.flag._y = this._parent.flag._y + 1000;
_root.objGame.nextCheckPoint = 0;
_root.objGame.laps = -1;
this.surface = this._parent._parent.objGame.objPhysics.surfaces[13];
this.massTouching = function (objMass) {
if (!objMass.isChoppa) {
return(undefined);
}
if (_root.objGame.nextCheckPoint == 0) {
_root.objGame.nextCheckPoint = 1;
_root.objGame.laps++;
switch (_root.objGame.laps) {
case 4 :
this._parent.flag._y = this._parent.flag._y - 1000;
this.surface.removeSurface();
_root.objGame.flagAppeared();
case 1 :
case 2 :
case 3 :
this._parent.instructions.play();
this._parent.selfReference.nextFrame();
_root.objSounds.play("strangeloop" + _root.objGame.laps);
}
}
};
}
Instance of Symbol 1190 MovieClip "b2" in Symbol 2544 MovieClip Frame 12
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (_root.objGame.nextCheckPoint == 2) {
_root.objGame.nextCheckPoint = 0;
}
};
}
Instance of Symbol 1190 MovieClip "b1" in Symbol 2544 MovieClip Frame 12
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (_root.objGame.nextCheckPoint == 1) {
_root.objGame.nextCheckPoint = 2;
}
};
}
Instance of Symbol 1472 MovieClip "b3" in Symbol 2544 MovieClip Frame 13
onClipEvent (load) {
_root.objSounds.play("loop-machine", 50, true);
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 13
onClipEvent (load) {
_root.objGame.stopCount = 2;
this._parent.flag._y = this._parent.flag._y + 1000;
this.evtTriggered = function (objMass) {
_root.objGame.stopCount--;
if (_root.objGame.stopCount <= 0) {
this._parent.b3.stopping = true;
}
};
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 13
onClipEvent (load) {
_root.objGame.stopCount = 2;
this._parent.flag._y = this._parent.flag._y + 1000;
this.evtTriggered = function (objMass) {
_root.objGame.stopCount--;
if (_root.objGame.stopCount <= 0) {
this._parent.b3.stopping = true;
}
};
}
Instance of Symbol 1190 MovieClip "b9" in Symbol 2544 MovieClip Frame 14
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (objMass.isCaravel) {
var _local4 = this._parent._parent.objGame.objPhysics.surfaces[4];
_local4.removeSurface();
_parent.flag._y = _parent.flag._y - 1000;
_root.objGame.flagAppeared();
this.massTouching = undefined;
}
};
}
Instance of Symbol 1519 MovieClip "b0" in Symbol 2544 MovieClip Frame 14
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1571 MovieClip "b5" in Symbol 2544 MovieClip Frame 15
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (_parent.joke.state != "idle") {
return(undefined);
}
_root.objGame.checkDonkey(objMass);
};
}
Instance of Symbol 1190 MovieClip "b7" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(6);
}
};
}
Instance of Symbol 1190 MovieClip "b5" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(4);
}
};
}
Instance of Symbol 1190 MovieClip "b4" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(3);
}
};
}
Instance of Symbol 1190 MovieClip "b3" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(2);
}
};
}
Instance of Symbol 1190 MovieClip "b2" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(1);
}
};
}
Instance of Symbol 1190 MovieClip "b1" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(1.5);
}
};
}
Instance of Symbol 1190 MovieClip "b0" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(1.2);
}
};
}
Instance of Symbol 1190 MovieClip "b6" in Symbol 2544 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.setMosaicScale(8);
_root.foundSecret();
}
};
}
Instance of Symbol 1605 MovieClip "exitBlock" in Symbol 2544 MovieClip Frame 17
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
}
Instance of Symbol 1159 MovieClip "b4" in Symbol 2544 MovieClip Frame 17
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.exitBlock.nextFrame();
_root.objSounds.play("gate-unlock");
};
}
Instance of Symbol 1159 MovieClip "b3" in Symbol 2544 MovieClip Frame 17
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.exitBlock.nextFrame();
_root.objSounds.play("gate-unlock");
};
}
Instance of Symbol 1159 MovieClip "b2" in Symbol 2544 MovieClip Frame 17
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.exitBlock.nextFrame();
_root.objSounds.play("gate-unlock");
};
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 17
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.exitBlock.nextFrame();
_root.objSounds.play("gate-unlock");
};
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 17
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.b5.playingBackwards = true;
};
}
Instance of Symbol 1614 MovieClip "b5" in Symbol 2544 MovieClip Frame 17
onClipEvent (load) {
var level = this._parent;
_root.objSounds.registerSources(level.choppa, [level.b5], "loop-machine", 350);
}
Instance of Symbol 1190 MovieClip "b2" in Symbol 2544 MovieClip Frame 18
onClipEvent (load) {
this._visible = false;
this._parent.flag._y = this._parent.flag._y + 130;
this.massTouching = function (objMass) {
if (objMass.isVan) {
_parent.flag._y = _parent.flag._y - 130;
_root.objGame.flagAppeared();
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b3" in Symbol 2544 MovieClip Frame 18
onClipEvent (load) {
this._visible = false;
_root.objGame.secretEligible = true;
this.massTouching = function (objMass) {
if (objMass.clip.item == "bridgepart") {
_root.objGame.secretEligible = false;
}
if ((objMass.clip.item == "van") && (_root.objGame.secretEligible)) {
_root.foundSecret();
}
};
}
Instance of Symbol 1719 MovieClip "b1" in Symbol 2544 MovieClip Frame 20
onClipEvent (load) {
var level = this._parent;
_root.objSounds.registerSources(level.choppa, [level.b1], "loop-machine", 400);
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 20
onClipEvent (load) {
this.evtTriggered = function (objMass) {
_root.objGame.clip.level.b1.gotoAndPlay("secret");
_root.foundSecret();
};
}
Instance of Symbol 1769 MovieClip "b2" in Symbol 2544 MovieClip Frame 22
onClipEvent (load) {
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.createExplosion(this._x, this._y, 20, 500);
_root.objGame.choppaCrashed();
}
};
}
Instance of Symbol 1779 MovieClip "b0" in Symbol 2544 MovieClip Frame 22
onClipEvent (load) {
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.createExplosion(this._x, this._y, 20, 500);
_root.objGame.choppaCrashed();
}
};
}
Instance of Symbol 1190 MovieClip "b1" in Symbol 2544 MovieClip Frame 22
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
this._parent.b2.play();
}
};
}
Instance of Symbol 1190 MovieClip "b3" in Symbol 2544 MovieClip Frame 22
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa) {
_root.objGame.gotToFinish = true;
this._parent.notHunting._visible = true;
}
};
}
Instance of Symbol 1190 MovieClip "b4" in Symbol 2544 MovieClip Frame 22
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (objMass.isChoppa && (_root.objGame.gotToFinish)) {
_root.foundSecret();
}
};
}
Instance of Symbol 1869 MovieClip "b8" in Symbol 2544 MovieClip Frame 25
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1872 MovieClip "b6" in Symbol 2544 MovieClip Frame 25
onClipEvent (load) {
this.playingBackwards = true;
}
Instance of Symbol 1872 MovieClip "b5" in Symbol 2544 MovieClip Frame 25
onClipEvent (load) {
this.playingBackwards = true;
}
Instance of Symbol 1872 MovieClip "b3" in Symbol 2544 MovieClip Frame 25
onClipEvent (load) {
this.playingBackwards = true;
}
Instance of Symbol 1872 MovieClip "b1" in Symbol 2544 MovieClip Frame 25
onClipEvent (load) {
this.playingBackwards = true;
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 25
onClipEvent (load) {
this.evtTriggered = function (objMass) {
var _local3 = 0;
var _local2 = _root.objGame.clip.level["b" + _local3];
while (_local2 != undefined) {
if (_local2.item == "movingsurface") {
_local2.playingBackwards = !_local2.playingBackwards;
}
_local3++;
_local2 = _root.objGame.clip.level["b" + _local3];
}
};
}
Instance of Symbol 1190 MovieClip "b4" in Symbol 2544 MovieClip Frame 26
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if (objMass.owner.item == "sponge") {
objMass.owner.gotoAndPlay("full");
}
};
}
Instance of Symbol 1190 MovieClip "b3" in Symbol 2544 MovieClip Frame 26
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if ((objMass.owner.item == "sponge") && (objMass.owner.painting)) {
_root.objGame.paintedItem(this._parent.field);
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b2" in Symbol 2544 MovieClip Frame 26
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if ((objMass.owner.item == "sponge") && (objMass.owner.painting)) {
_root.objGame.paintedItem(this._parent.sub);
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b1" in Symbol 2544 MovieClip Frame 26
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if (((objMass.owner.item == "sponge") && (objMass.owner.painting)) && (objMass.owner._visible)) {
_root.objGame.paintedItem(this._parent.door);
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b0" in Symbol 2544 MovieClip Frame 26
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if (((objMass.owner.item == "sponge") && (objMass.owner.painting)) && (this._parent.raven._visible)) {
_root.objGame.paintedItem(this._parent.raven);
this.massTouching = undefined;
}
};
}
Instance of Symbol 1190 MovieClip "b2" in Symbol 2544 MovieClip Frame 29
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if (objMass.clip.item == "biffo") {
_root.objGame.biffoInCage = true;
}
};
}
Instance of Symbol 1190 MovieClip "b1" in Symbol 2544 MovieClip Frame 29
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if (objMass.clip.item == "cagedoor") {
_root.objGame.doorLeftClosed = true;
}
};
}
Instance of Symbol 1190 MovieClip "b0" in Symbol 2544 MovieClip Frame 29
onClipEvent (load) {
this._visible = false;
this.active = true;
this.massTouching = function (objMass) {
if (objMass.clip.item == "cagedoor") {
_root.objGame.doorRightClosed = true;
}
};
}
Instance of Symbol 1190 MovieClip "b6" in Symbol 2544 MovieClip Frame 30
onClipEvent (load) {
this._visible = false;
this.active = false;
this.cogCount = 0;
this.massTouching = function (objMass) {
if (objMass.clip.cog && (!objMass.clip.cogDisposed)) {
this.cogCount++;
objMass.clip.cogDisposed = true;
if (this.cogCount == 5) {
_root.foundSecret();
}
}
};
}
Instance of Symbol 1159 MovieClip "b11" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
_root.objGame.OXOreset();
this.evtTriggered = function () {
_root.objGame.OXOreset();
var _local2 = ["TRY AGAIN, YOU WON'T WIN", "TRY YOUR LUCK AGAIN", "OXOBOT WELCOMES YOUR CHALLENGE", "OXOBOT LAUGHS AT YOUR ATTEMPTS", "OXOBOT IS UNBEATABLE", "OXOBOT ALWAYS WINS", "NOBODY HAS BEATEN OXOBOT", "YOU WON'T WIN, BUT DO TRY", "YOUR INTELLECT IS TINY", "COME ON, TRY HARDER", "FAILURE IS ALWAYS AN OPTION", "GIVE UP, YOU CAN'T BEAT ME", "HERE COMES A NEW CHALLENGER"];
_root.objGame.clip.level.oxoBot.txt.text = _local2[_root.Maths.randomInt(0, _local2.length - 1)];
};
}
Instance of Symbol 1159 MovieClip "b8" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b7" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b6" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b5" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b4" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b3" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b2" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 31
onClipEvent (load) {
this.evtTriggered = function () {
_root.objGame.makeMove(this.idx);
};
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 32
onClipEvent (load) {
this._parent.flag._y = this._parent.flag._y + 250;
this.evtTriggered = function (objMass) {
if (_parent.b0.idle) {
_parent.b0.gotoAndPlay("burn");
}
};
}
Instance of Symbol 2205 MovieClip "b1" in Symbol 2544 MovieClip Frame 33
onClipEvent (load) {
this._x = this._x - 6000;
}
Instance of Symbol 2233 MovieClip "b2" in Symbol 2544 MovieClip Frame 36
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (!objMass.isChoppa) {
this._y = this._y + 1000;
this._parent.b3._x = this._parent.b3._x + 1000;
this._parent.b3._visible = true;
}
};
}
Instance of Symbol 2236 MovieClip "b3" in Symbol 2544 MovieClip Frame 36
onClipEvent (load) {
this._x = this._x - 1000;
}
Instance of Symbol 1869 MovieClip "b0" in Symbol 2544 MovieClip Frame 36
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 37
onClipEvent (load) {
_root.exitSecretEnabled = true;
this.evtTriggered = function () {
var _local3 = this._parent._parent.objGame.objPhysics.surfaces[15];
_local3.removeSurface();
this._parent.exitBlock.fadeOut(0.5);
_root.objSounds.play("gate-unlock");
_root.exitSecretEnabled = false;
};
}
Instance of Symbol 1283 MovieClip "b9" in Symbol 2544 MovieClip Frame 38
onClipEvent (load) {
this._x = this._x - 1000;
}
Instance of Symbol 1159 MovieClip "b8" in Symbol 2544 MovieClip Frame 38
onClipEvent (load) {
this.evtTriggered = function (objMass) {
var _local3 = this._parent._parent.objGame.objPhysics.surfaces[13];
_local3.removeSurface();
this._parent.exitBlock.fadeOut(0.5);
_root.objSounds.play("gate-unlock");
if (objMass.isChoppa) {
this._parent.secret._visible = true;
this._parent.b9._x = this._parent.b9._x + 1000;
}
};
}
Instance of Symbol 1190 MovieClip "b7" in Symbol 2544 MovieClip Frame 39
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (objMass.clip.item == "bee") {
this._parent.secret._visible = true;
_root.foundSecret();
}
};
}
Instance of Symbol 2263 MovieClip "secret" in Symbol 2544 MovieClip Frame 39
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1190 MovieClip "b11" in Symbol 2544 MovieClip Frame 40
onClipEvent (load) {
_root.lapStage = 0;
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (!objMass.isChoppa) {
return(undefined);
}
switch (_root.lapStage) {
case 1 :
_root.lapStage = 2;
break;
case 2 :
break;
case 4 :
_root.lapStage = 5;
break;
case 5 :
break;
default :
_root.lapStage = 0;
}
};
}
Instance of Symbol 1190 MovieClip "b10" in Symbol 2544 MovieClip Frame 40
onClipEvent (load) {
_root.lapStage = 0;
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (!objMass.isChoppa) {
return(undefined);
}
switch (_root.lapStage) {
case 0 :
_root.lapStage = 1;
break;
case 1 :
break;
case 3 :
_root.lapStage = 4;
break;
case 4 :
break;
default :
_root.lapStage = 0;
}
};
}
Instance of Symbol 1190 MovieClip "b12" in Symbol 2544 MovieClip Frame 40
onClipEvent (load) {
_root.lapStage = 0;
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (!objMass.isChoppa) {
return(undefined);
}
switch (_root.lapStage) {
case 2 :
_root.lapStage = 3;
break;
case 3 :
break;
case 5 :
_root.lapStage = 6;
_root.foundSecret();
this._parent.secret.gotoAndStop("secret");
break;
default :
_root.lapStage = 0;
}
};
}
Instance of Symbol 1869 MovieClip "b0" in Symbol 2544 MovieClip Frame 40
onClipEvent (load) {
this.fanStrength = 0.8;
}
Instance of Symbol 1869 MovieClip "b1" in Symbol 2544 MovieClip Frame 40
onClipEvent (load) {
this.fanStrength = 1;
}
Instance of Symbol 1869 MovieClip "b2" in Symbol 2544 MovieClip Frame 40
onClipEvent (load) {
this.fanStrength = 1;
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 41
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[23];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.ballsBlock.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b3" in Symbol 2544 MovieClip Frame 41
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[22];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.exitBlock.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 42
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[9];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.door9.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b3" in Symbol 2544 MovieClip Frame 42
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[8];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.door8.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b2" in Symbol 2544 MovieClip Frame 42
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[10];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.door10.fadeOut(0.5);
};
}
Instance of Symbol 2330 MovieClip "secret" in Symbol 2544 MovieClip Frame 43
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 2350 MovieClip "b3" in Symbol 2544 MovieClip Frame 44
onClipEvent (load) {
this._y = this._y - 1000;
}
Instance of Symbol 1190 MovieClip "b4" in Symbol 2544 MovieClip Frame 44
onClipEvent (load) {
this._x = this._x - 1000;
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (!objMass.isChoppa) {
return(undefined);
}
if (this.active) {
return(undefined);
}
this.active = true;
this._parent.b3._y = this._parent.b3._y + 1000;
this._parent.b3._visible = true;
this._x = this._x - 1000;
};
}
Instance of Symbol 2367 MovieClip "b4" in Symbol 2544 MovieClip Frame 45
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (objMass.clip.item == "magnet") {
this._parent.secret._visible = true;
_root.foundSecret();
}
};
}
Instance of Symbol 2369 MovieClip "secret" in Symbol 2544 MovieClip Frame 45
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1159 MovieClip "b0" in Symbol 2544 MovieClip Frame 45
onClipEvent (load) {
this.evtTriggered = function () {
var _local3 = this._parent._parent.objGame.objPhysics.surfaces[17];
_local3.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.exitDoor.fadeOut(0.5);
};
}
Instance of Symbol 2384 MovieClip "b5" in Symbol 2544 MovieClip Frame 46
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[13];
this.triggered = false;
this.sheepDeposited = function (totalSheep) {
if ((totalSheep >= 4) && (!this.triggered)) {
this.triggered = true;
this.surface.removeSurface();
this._parent.exitDoor.fadeOut(0.5);
_root.objSounds.play("gate-unlock");
}
if (totalSheep == 5) {
this._parent.secret.gotoAndStop("secret");
_root.foundSecret();
}
};
}
Instance of Symbol 2439 MovieClip "b10" in Symbol 2544 MovieClip Frame 48
onClipEvent (load) {
this.triggered = false;
this.sailorsDeposited = function (sailors) {
if ((sailors >= 3) && (!this.triggered)) {
this.triggered = true;
this._parent.sign.gotoAndPlay("saveboat");
this._parent.b7.objMass.removeMass();
this._parent.b8.objMass.removeMass();
this._parent.b9.objMass.removeMass();
this._parent.b7.fadeOut(0.5, undefined, 0.25);
this._parent.b8.fadeOut(0.5, undefined, 0.75);
this._parent.b9.fadeOut(0.5, undefined, 1.25);
_root.objGame.menSaved = true;
}
};
}
Instance of Symbol 2440 MovieClip "b11" in Symbol 2544 MovieClip Frame 48
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (objMass.isBoatFront) {
_root.objGame.boatPositioned++;
}
};
}
Instance of Symbol 2440 MovieClip "b12" in Symbol 2544 MovieClip Frame 48
onClipEvent (load) {
this._visible = false;
this.active = false;
this.massTouching = function (objMass) {
if (objMass.isBoatRear) {
_root.objGame.boatPositioned++;
}
};
}
Instance of Symbol 1159 MovieClip "b1" in Symbol 2544 MovieClip Frame 51
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[7];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.door7.fadeOut(0.5);
};
}
Instance of Symbol 1159 MovieClip "b2" in Symbol 2544 MovieClip Frame 51
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[6];
this.evtTriggered = function () {
this.surface.removeSurface();
_root.objSounds.play("gate-unlock");
this._parent.door6.fadeOut(0.5);
};
}
Instance of Symbol 2522 MovieClip "b0" in Symbol 2544 MovieClip Frame 53
onClipEvent (load) {
this.angleChanged = function (dr) {
if (this._parent.b1.startFrame == undefined) {
return(undefined);
}
if (dr >= 0) {
return(undefined);
}
var _local3 = _root.objGame.clip.level.b1;
var _local4 = _local3._currentframe + Math.floor(-dr);
if (_local4 > _local3._totalframes) {
_local4 = _local3._totalframes;
}
_local3.gotoAndStop(_local4);
};
}
Instance of Symbol 2533 MovieClip "b3" in Symbol 2544 MovieClip Frame 53
onClipEvent (load) {
this.ingredient = "sugar";
this.objMass.collisionSound = undefined;
}
Instance of Symbol 2535 MovieClip "b4" in Symbol 2544 MovieClip Frame 53
onClipEvent (load) {
this.ingredient = "butter";
this.objMass.collisionSound = undefined;
}
Instance of Symbol 2537 MovieClip "b5" in Symbol 2544 MovieClip Frame 53
onClipEvent (load) {
this.ingredient = "eggs";
this.objMass.collisionSound = undefined;
}
Instance of Symbol 2539 MovieClip "b2" in Symbol 2544 MovieClip Frame 53
onClipEvent (load) {
this.ingredient = "flour";
this.objMass.collisionSound = undefined;
}
Instance of Symbol 2541 MovieClip "b6" in Symbol 2544 MovieClip Frame 53
onClipEvent (load) {
this.ingredient = "chocolate";
this.objMass.collisionSound = undefined;
}
Symbol 2558 MovieClip Frame 1
this.gotoAndStop(_root.Maths.randomInt(2, this._totalframes));
Symbol 2589 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 2601 MovieClip Frame 11
stop();
Symbol 2601 MovieClip Frame 21
this.onEnterFrame = function () {
darken._alpha = _root.Maths.randomInt(50, 80);
};
Symbol 2606 Button
on (release) {
_root.objSounds.play("rollover-tick");
Key.removeListener(_root.objGame);
_root.objTrans.goto("picklevel");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 2609 Button
on (release) {
_root.objSounds.play("rollover-tick");
Key.removeListener(_root.objGame);
_root.objTrans.goto("restart");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 2614 MovieClip Frame 1
stop();
Symbol 2626 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
_root.menuFireworks = true;
}
Symbol 2647 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
_root.menuFireworks = true;
}