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() {
var _local2 = new ContextMenu();
_local2.hideBuiltInItems();
_root.menu = _local2;
}
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
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);
};
var objPreloader = new Preloader(_root);
objPreloader.onUpdate = function () {
_root.txtLoaded.text = this.percentLoaded;
};
objPreloader.onLoaded = function () {
_root.gotoAndStop("intro_once");
};
setupRightClickMenu();
__com_mochibot__("913c95c1", this, 10301, true);
Frame 2
gs.TweenFilterLite.from(bg, 1.5, {tint:0, ease:gs.easing.Quad.easeIn, overwrite:false});
gs.TweenFilterLite.to(star, 1.5, {alpha:0, ease:gs.easing.Quad.easeIn, overwrite:false});
Frame 3
stop();
Frame 21
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 ParticleEngine(baseClip, rect) {
this.baseClip = baseClip;
this.point = point;
this.rect = rect;
this.baseClip.engine = this;
this.frame = 0;
this.generators = [];
this.baseClip.onEnterFrame = this.evtEnterFrame;
}
function ParticleGenerator(x, y, gravityX, gravityY, dutyCycle, particlesPerCycle, startRunning, newParticleCallback, headLinkage, tailLinkage, engine) {
this.engine = engine;
this.newParticleCallback = newParticleCallback;
this.x = x;
this.y = y;
this.gravityX = gravityX;
this.gravityY = gravityY;
this.running = startRunning;
this.dutyCycle = dutyCycle;
this.particlesPerCycle = particlesPerCycle;
this.particles = [];
this.frame = -1;
this.stopAfterFrame = 0;
this.garbageDutyCycle = 10;
this.linkageHead = headLinkage;
this.linkageTail = tailLinkage;
this.tailEffect = fadeOut;
this.paint = simplePaint;
this.checkLifeOver = offEdgeTest;
this.vxMin = -5;
this.vxMax = 5;
this.vyMin = -12;
this.vyMax = -8;
this.dxMin = 0;
this.dxMax = 0;
this.dyMin = 0;
this.dyMax = 0;
this.scaleMin = 100;
this.scaleMax = 100;
this.scaleMultMin = 1;
this.scaleMultMax = 1;
this.growFrames = 0;
this.rMin = 0;
this.rMax = 360;
this.vrMin = 0;
this.vrMax = 0;
this.depth = this.engine.generators.length;
this.clip = this.engine.baseClip.createEmptyMovieClip("gen" + this.depth, this.depth);
this.workClip = this.clip.createEmptyMovieClip("work", 0);
this.tailClip = this.clip.createEmptyMovieClip("tail", 1);
this.headClip = this.clip.createEmptyMovieClip("head", 2);
this.objBmp = new flash.display.BitmapData(this.engine.rect.width, this.engine.rect.height, true, 0);
this.tailClip.attachBitmap(this.objBmp, 0, "never", false);
this.workClip._visible = false;
this.workClip.attachMovie(this.linkageTail, "tail", 0);
this.colourMatrix = new Array();
this.colourMatrix = this.colourMatrix.concat([0.91, 0, 0, 0, 0]);
this.colourMatrix = this.colourMatrix.concat([0, 0.85, 0, 0, 0]);
this.colourMatrix = this.colourMatrix.concat([0, 0, 0.8, 0, 0]);
this.colourMatrix = this.colourMatrix.concat([0, 0, 0, 0.9, 0]);
this.filter = new flash.filters.ColorMatrixFilter(this.colourMatrix);
this.engine.generators.push(this);
}
function makeSimpleGravityParticle(objGenerator, objEngine) {
var _local2 = {};
_local2.frame = 0;
_local2.engine = objEngine;
_local2.generator = objGenerator;
_local2.x = _local2.generator.x + Maths.randomNum(_local2.generator.dxMin, _local2.generator.dxMax);
_local2.y = _local2.generator.y + Maths.randomNum(_local2.generator.dyMin, _local2.generator.dyMax);
_local2.vx = Maths.randomNum(_local2.generator.vxMin, _local2.generator.vxMax);
_local2.vy = Maths.randomNum(_local2.generator.vyMin, _local2.generator.vyMax);
_local2.scale = Maths.randomNum(_local2.generator.scaleMin, _local2.generator.scaleMax);
_local2.origScale = _local2.scale;
_local2.rDeg = Maths.randomNum(_local2.generator.rMin, _local2.generator.rMax);
_local2.vrDeg = Maths.randomNum(_local2.generator.vrMin, _local2.generator.vrMax);
_local2.scaleMult = Maths.randomNum(_local2.generator.scaleMultMin, _local2.generator.scaleMultMax);
_local2.deathFrame = 10000000 /* 0x989680 */;
_local2.growFrames = _local2.generator.growFrames;
var _local3 = _local2.generator.headClip.getNextHighestDepth();
_local2.generator.headClip.attachMovie(_local2.generator.linkageHead, "head" + _local3, _local3);
_local2.headClip = _local2.generator.headClip["head" + _local3];
_local2.evtEnterFrame = function () {
this.frame++;
this.lifePct = this.frame / this.deathFrame;
this.vx = this.vx + this.generator.gravityX;
this.vy = this.vy + this.generator.gravityY;
this.rDeg = this.rDeg + this.vrDeg;
if ((this.growFrames > 0) && (this.frame <= this.growFrames)) {
this.scale = (this.origScale * this.frame) / this.growFrames;
} else {
this.scale = this.scale * this.scaleMult;
}
this.x = this.x + this.vx;
this.y = this.y + this.vy;
this.rHeadingRad = Math.atan2(this.vy, this.vx);
this.rHeadingDeg = Maths.radToDeg(this.rHeadingRad);
this.paint();
};
_local2.paint = _local2.generator.paint;
_local2.checkLifeOver = _local2.generator.checkLifeOver;
_local2.evtEnterFrame();
return(_local2);
}
function makeLifespanGravityParticle(objGenerator, objEngine) {
var _local1 = makeSimpleGravityParticle(objGenerator, objEngine);
_local1.deathFrame = _local1.generator.particleLifespan;
_local1.evtEnterFrame();
return(_local1);
}
function simplePaint() {
this.headClip._x = this.x;
this.headClip._y = this.y;
this.headClip._xscale = (this.headClip._yscale = this.scale);
this.headClip._rotation = this.rDeg;
this.generator.workClip.tail._x = this.x;
this.generator.workClip.tail._y = this.y;
this.generator.workClip.tail._xscale = (this.generator.workClip.tail._yscale = this.scale);
this.generator.workClip.tail._rotation = this.rDeg;
this.generator.objBmp.draw(this.generator.workClip);
}
function tailRotationPaint() {
this.headClip._x = this.x;
this.headClip._y = this.y;
this.headClip._xscale = (this.headClip._yscale = this.scale);
this.generator.workClip.tail._x = this.x;
this.generator.workClip.tail._y = this.y;
this.generator.workClip.tail._rotation = this.rHeadingDeg;
this.generator.workClip.tail._xscale = (this.generator.workClip.tail._yscale = this.scale);
this.generator.objBmp.draw(this.generator.workClip);
}
function simpleFadePaint() {
this.headClip._x = this.x;
this.headClip._y = this.y;
this.headClip._alpha = 100 - (this.lifePct * 100);
this.headClip._xscale = (this.headClip._yscale = this.scale);
this.headClip._rotation = this.rDeg;
this.generator.workClip.tail._x = this.x;
this.generator.workClip.tail._y = this.y;
this.generator.workClip.tail._xscale = (this.generator.workClip.tail._yscale = this.scale);
this.generator.workClip.tail._alpha = 100 - (this.lifePct * 100);
this.generator.workClip.tail._rotation = this.rDeg;
this.generator.objBmp.draw(this.generator.workClip);
}
function tailRotationFadePaint() {
this.headClip._x = this.x;
this.headClip._y = this.y;
this.headClip._alpha = 100 - (this.lifePct * 100);
this.headClip._xscale = (this.headClip._yscale = this.scale);
this.generator.workClip.tail._x = this.x;
this.generator.workClip.tail._y = this.y;
this.generator.workClip.tail._rotation = this.rHeadingDeg;
this.generator.workClip.tail._alpha = 100 - (this.lifePct * 100);
this.generator.workClip.tail._xscale = (this.generator.workClip.tail._yscale = this.scale);
this.generator.objBmp.draw(this.generator.workClip);
}
function headRotationPaint() {
this.headClip._x = this.x;
this.headClip._y = this.y;
this.headClip._rotation = this.rHeadingDeg;
this.headClip._xscale = (this.headClip._yscale = this.scale);
this.generator.workClip.tail._x = this.x;
this.generator.workClip.tail._y = this.y;
this.generator.workClip.tail._xscale = (this.generator.workClip.tail._yscale = this.scale);
this.generator.objBmp.draw(this.generator.workClip);
}
function tailLinePaint() {
this.headClip._x = this.x;
this.headClip._y = this.y;
this.headClip._xscale = (this.headClip._yscale = this.scale);
this.headClip._rotation = this.rDeg;
this.generator.workClip.clear();
this.generator.workClip.lineStyle(this.generator.lineThickness, this.generator.lineColour, this.generator.lineAlpha);
this.generator.workClip.moveTo(this.x, this.y);
this.generator.workClip.lineTo(this.x - this.vx, this.y - this.vy);
this.generator.objBmp.draw(this.generator.workClip);
}
function tailLineFadePaint() {
this.headClip._x = this.x;
this.headClip._y = this.y;
this.headClip._xscale = (this.headClip._yscale = this.scale);
this.headClip._rotation = this.rDeg;
this.headClip._alpha = 100 - (this.lifePct * 100);
this.generator.workClip.clear();
this.generator.workClip.lineStyle((1 - this.lifePct) * this.generator.lineThickness, this.generator.lineColour, 100 - (this.lifePct * this.generator.lineAlpha));
this.generator.workClip.moveTo(this.x, this.y);
this.generator.workClip.lineTo(this.x - this.vx, this.y - this.vy);
this.generator.objBmp.draw(this.generator.workClip);
}
function offEdgeTest() {
if ((((this.x < this.engine.rect.left) || (this.x > this.engine.rect.right)) || (this.y < this.engine.rect.top)) || (this.y > this.engine.rect.bottom)) {
return(true);
}
return(false);
}
function offBottomTest() {
if (this.y > this.engine.rect.bottom) {
return(true);
}
return(false);
}
function lifespanTest() {
if (this.frame > this.deathFrame) {
return(true);
}
return(false);
}
function fadeOut() {
this.objBmp.applyFilter(this.objBmp, this.engine.rect, this.engine.rect.topLeft, this.filter);
}
function explosionFade() {
this.objBmp.applyFilter(this.objBmp, this.engine.rect, this.engine.rect.topLeft, this.glowFilter);
this.objBmp.applyFilter(this.objBmp, this.engine.rect, this.engine.rect.topLeft, this.filter);
}
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);
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 * (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.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.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);
};
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.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)));
}
}
}
};
ParticleEngine.prototype.evtEnterFrame = function () {
var _local3 = this.engine;
_local3.frame++;
var _local2 = 0;
while (_local2 < _local3.generators.length) {
_local3.generators[_local2].evtEnterFrame();
_local2++;
}
};
ParticleGenerator.prototype.evtEnterFrame = function () {
if ((this.prevRunning == false) && (this.running == true)) {
this.frame = -1;
}
this.frame++;
if ((this.stopAfterFrame > 0) && (this.frame > this.stopAfterFrame)) {
this.running = false;
}
if ((this.engine.frame % this.garbageDutyCycle) == 0) {
var _local2 = 0;
while (_local2 < this.particles.length) {
if (this.particles[_local2].checkLifeOver()) {
this.particles[_local2].headClip.removeMovieClip();
this.particles[_local2] = undefined;
}
_local2++;
}
this.garbageCollect();
}
this.updateParticles();
};
ParticleGenerator.prototype.updateParticles = function () {
var _local2 = 0;
while (_local2 < this.particles.length) {
this.particles[_local2].evtEnterFrame();
_local2++;
}
};
ParticleGenerator.prototype.generateParticles = function () {
var _local2 = 0;
while (_local2 < this.particlesPerCycle) {
var _local3 = this.newParticleCallback(this, this.engine);
this.particles.push(_local3);
_local2++;
}
};
ParticleGenerator.prototype.garbageCollect = function () {
var _local2 = 0;
while (_local2 < this.particles.length) {
if (this.particles[_local2] == undefined) {
this.particles.splice(_local2, 1);
_local2--;
}
_local2++;
}
};
var gameID = "59ed2cfb30d9e32a";
var boardID = "46137a8de2d488ce";
mochi.MochiServices.connect(gameID);
var wallaceVolume = 50;
var objSounds = new Sounds(_root.soundHolder);
objSounds.registerSound("all-this-hard-work-05", wallaceVolume);
objSounds.registerSound("can-you-smell-burning-01", wallaceVolume);
objSounds.registerSound("come-on-boy-07", wallaceVolume);
objSounds.registerSound("gromit-fire-fire-03", wallaceVolume);
objSounds.registerSound("here-comes-another-batch-02", wallaceVolume);
objSounds.registerSound("keep-them-buns-coming-07", wallaceVolume);
objSounds.registerSound("more-bread-for-them-06", wallaceVolume);
objSounds.registerSound("no-rest-for-the-wicked-06", wallaceVolume);
objSounds.registerSound("the-more-the-merrier-06", wallaceVolume);
objSounds.registerSound("phew-04", wallaceVolume);
objSounds.registerSound("phew-06", wallaceVolume);
objSounds.registerSound("general-whistling-02");
objSounds.registerSound("general-whistling-04");
objSounds.registerSound("bread-done", 50);
objSounds.registerSound("bread-into-van-2");
objSounds.registerSound("dough-land-no-bowl");
objSounds.registerSound("error-honk", 50);
objSounds.registerSound("forklift-forward-roll");
objSounds.registerSound("forklift-up_down");
objSounds.registerSound("ingredient-request-2", 40);
objSounds.registerSound("switch-on-oven", 60);
objSounds.registerSound("van-door-close-2");
objSounds.registerSound("van-door-open");
objSounds.registerSound("newspaper-turn-single-page-03", 30);
objSounds.registerSound("newspaper-turn-single-page-05", 30);
objSounds.registerGroup("phew", ["phew-04", "phew-06"]);
objSounds.registerSound("loop_alternative");
objSounds.registerSound("loop_main");
objSounds.registerSound("loop_quiet");
objSounds.registerSound("loop_theme", 30);
objSounds.registerSound("background-loop", 30);
var music = new Music();
music.start();
objSounds.play("background-loop", 0, true);
gs.TweenFilterLite.to(bg.poster, 0.5, {_alpha:0, ease:gs.easing.Quad.easeIn, overwrite:false});
gs.TweenLite.delayedCall(0.5, function () {
_root.gotoAndStop("Menu");
});
Frame 31
stop();
ba.removeMovieClip();
bb.removeMovieClip();
bc.removeMovieClip();
bd.removeMovieClip();
music.setLoop("theme");
Frame 41
if (game == undefined) {
var game = new Game();
} else {
game.init();
}
gs.TweenLite.to(marco, 1, {autoAlpha:100, ease:gs.easing.Back.easeOut, delay:0.3});
music.setLoop("quiet");
tut0._visible = false;
tut1._visible = false;
tut2._visible = false;
tut3._visible = false;
tut4._visible = false;
tut5._visible = false;
tut6._visible = false;
Instance of Symbol 176 MovieClip "i1" in Frame 41
onClipEvent (load) {
this.tipo = 0;
}
Instance of Symbol 176 MovieClip "i2" in Frame 41
onClipEvent (load) {
this.tipo = 0;
}
Instance of Symbol 176 MovieClip "i3" in Frame 41
onClipEvent (load) {
this.tipo = 0;
}
Instance of Symbol 176 MovieClip "i4" in Frame 41
onClipEvent (load) {
this.tipo = 0;
}
Symbol 642 MovieClip [__Packages.gs.easing.Quad] Frame 0
class gs.easing.Quad
{
function Quad () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
}
Symbol 643 MovieClip [__Packages.gs.TweenLite] Frame 0
class gs.TweenLite
{
static var _e, _classInitted, _curTime, _gc, overwriteManager, _listening;
var vars, duration, delay, _timeScale, _active, target, tweens, _subTweens, _hst, _initted, initTime, startTime, tweenID, endTargetID, _hasUpdate;
function TweenLite ($target, $duration, $vars) {
if ((_e._visible != false) || (!_classInitted)) {
_curTime = getTimer();
var _local3 = 999;
while (_root.getInstanceAtDepth(_local3) != undefined) {
_local3++;
}
_e = _root.createEmptyMovieClip("__tweenLite_mc", _local3);
_e._visible = false;
clearInterval(_gc);
_gc = setInterval(killGarbage, 2000);
_e.onEnterFrame = executeAll;
if (overwriteManager == undefined) {
overwriteManager = {mode:1, enabled:false};
}
_classInitted = true;
}
vars = $vars;
duration = $duration || 0.001;
delay = $vars.delay || 0;
_timeScale = $vars.timeScale || 1;
_active = ($duration == 0) && (delay == 0);
target = $target;
if (typeof(vars.ease) != "function") {
vars.ease = defaultEase;
}
if (vars.easeParams != undefined) {
vars.proxiedEase = vars.ease;
vars.ease = easeProxy;
}
if (typeof(vars.autoAlpha) == "number") {
vars._alpha = vars.autoAlpha;
vars._visible = vars._alpha > 0;
}
tweens = [];
_subTweens = [];
_hst = (_initted = false);
initTime = _curTime;
startTime = initTime + (delay * 1000);
_cnt++;
tweenID = "tw" + _cnt;
endTargetID = getID($target, true);
var _local5 = ((($vars.overwrite == undefined) || ((!overwriteManager.enabled) && ($vars.overwrite > 1))) ? (overwriteManager.mode) : (Number($vars.overwrite)));
if ((_local5 == 1) && ($target != undefined)) {
delete _all[endTargetID];
_all[endTargetID] = {info:[$target, endTargetID]};
} else if ((_local5 > 1) && (delay == 0)) {
overwriteManager.manageOverwrites(this, _all[endTargetID]);
}
_all[endTargetID][tweenID] = this;
if (_active || ((vars.runBackwards == true) && (vars.renderOnStart != true))) {
initTweenVals();
if (_active) {
render(startTime + 1);
} else {
render(startTime);
}
if ((vars._visible != undefined) && (vars.runBackwards == true)) {
target._visible = vars._visible;
}
}
if ((!_active) && (!_listening)) {
_listening = true;
}
}
function initTweenVals($hrp, $reservedProps) {
var _local9 = typeof(target) == "movieclip";
var _local3;
var _local2;
if ((($hrp != true) && (delay != 0)) && (overwriteManager.enabled)) {
overwriteManager.manageOverwrites(this, _all[endTargetID]);
}
if (target instanceof Array) {
var _local5 = vars.endArray || ([]);
_local2 = 0;
while (_local2 < _local5.length) {
if ((target[_local2] != _local5[_local2]) && (target[_local2] != undefined)) {
tweens[tweens.length] = {o:target, p:_local2.toString(), s:target[_local2], c:_local5[_local2] - target[_local2], name:_local2.toString()};
}
_local2++;
}
} else {
if (((vars.tint != undefined) || (vars.removeTint == true)) && (_local9 || (target instanceof TextField))) {
var _local14 = new Color(target);
var _local11 = vars._alpha;
if (_local11 != undefined) {
delete vars._alpha;
} else {
_local11 = target._alpha;
}
if (((vars.removeTint == true) || (vars.tint == null)) || (vars.tint == "")) {
addSubTween("tint", tintProxy, _local14.getTransform(), {rb:0, gb:0, bb:0, ab:0, ra:_local11, ga:_local11, ba:_local11, aa:_local11}, {color:_local14});
} else {
addSubTween("tint", tintProxy, _local14.getTransform(), {rb:vars.tint >> 16, gb:(vars.tint >> 8) & 255, bb:vars.tint & 255, ra:0, ga:0, ba:0, aa:_local11}, {color:_local14});
}
}
if ((vars.frame != undefined) && (_local9)) {
addSubTween("frame", frameProxy, {frame:target._currentframe}, {frame:vars.frame}, {mc:target});
}
if ((vars.volume != undefined) && (_local9 || (target instanceof Sound))) {
var _local15;
if (_local9) {
_local15 = new Sound(target);
} else {
_local15 = Sound(target);
}
addSubTween("volume", volumeProxy, {volume:_local15.getVolume()}, {volume:vars.volume}, {sound:_local15});
}
for (_local3 in vars) {
if ((((((((((((((((((((_local3 == "ease") || (_local3 == "delay")) || (_local3 == "overwrite")) || (_local3 == "onComplete")) || (_local3 == "onCompleteParams")) || (_local3 == "onCompleteScope")) || (_local3 == "runBackwards")) || (_local3 == "onUpdate")) || (_local3 == "onUpdateParams")) || (_local3 == "onUpdateScope")) || (_local3 == "persist")) || (_local3 == "volume")) || (_local3 == "timeScale")) || (_local3 == "onStart")) || (_local3 == "onStartParams")) || (_local3 == "onStartScope")) || (_local3 == "renderOnStart")) || (_local3 == "proxiedEase")) || (_local3 == "easeParams")) || ($hrp && ($reservedProps.indexOf((" " + _local3) + " ") != -1))) {
} else if ((!(_local9 && (((((_local3 == "_visible") || (_local3 == "autoAlpha")) || (_local3 == "tint")) || (_local3 == "removeTint")) || (_local3 == "frame")))) && (target[_local3] != undefined)) {
if (typeof(vars[_local3]) == "number") {
tweens[tweens.length] = {o:target, p:_local3, s:target[_local3], c:vars[_local3] - target[_local3], name:_local3};
} else {
tweens[tweens.length] = {o:target, p:_local3, s:target[_local3], c:Number(vars[_local3]), name:_local3};
}
}
}
}
if (vars.runBackwards == true) {
var _local4;
_local2 = tweens.length - 1;
while (_local2 > -1) {
_local4 = tweens[_local2];
_local4.s = _local4.s + _local4.c;
_local4.c = _local4.c * -1;
_local2--;
}
}
if (vars._visible == true) {
target._visible = true;
}
if (vars.onUpdate != null) {
_hasUpdate = true;
}
_initted = true;
}
function addSubTween($name, $proxy, $target, $props, $info) {
var _local7 = {name:$name, proxy:$proxy, target:$target, info:$info};
_subTweens[_subTweens.length] = _local7;
for (var _local10 in $props) {
if (typeof($props[_local10]) == "number") {
tweens[tweens.length] = {o:$target, p:_local10, s:$target[_local10], c:$props[_local10] - $target[_local10], sub:_local7, name:$name};
} else {
tweens[tweens.length] = {o:$target, p:_local10, s:$target[_local10], c:Number($props[_local10]), sub:_local7, name:$name};
}
}
_hst = true;
}
static function to($target, $duration, $vars) {
return(new gs.TweenLite($target, $duration, $vars));
}
static function from($target, $duration, $vars) {
$vars.runBackwards = true;
return(new gs.TweenLite($target, $duration, $vars));
}
static function delayedCall($delay, $onComplete, $onCompleteParams, $onCompleteScope) {
return(new gs.TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, onCompleteScope:$onCompleteScope, overwrite:0}));
}
function render($t) {
var _local5 = ($t - startTime) / 1000;
var _local4;
var _local3;
var _local2;
if (_local5 >= duration) {
_local5 = duration;
_local4 = 1;
} else {
_local4 = vars.ease(_local5, 0, 1, duration);
}
_local2 = tweens.length - 1;
while (_local2 > -1) {
_local3 = tweens[_local2];
_local3.o[_local3.p] = _local3.s + (_local4 * _local3.c);
_local2--;
}
if (_hst) {
_local2 = _subTweens.length - 1;
while (_local2 > -1) {
_subTweens[_local2].proxy(_subTweens[_local2]);
_local2--;
}
}
if (_hasUpdate) {
vars.onUpdate.apply(vars.onUpdateScope, vars.onUpdateParams);
}
if (_local5 == duration) {
complete(true);
}
}
static function executeAll() {
var _local5 = (_curTime = getTimer());
if (_listening) {
var _local2 = _all;
var _local1;
var _local4;
var _local3;
for (_local3 in _local2) {
for (_local4 in _local2[_local3]) {
_local1 = _local2[_local3][_local4];
if (_local1.active) {
_local1.render(_local5);
}
}
}
}
}
static function removeTween($t) {
_all[$t.endTargetID][$t.tweenID] = {active:false};
delete _all[$t.endTargetID][$t.tweenID];
}
static function killTweensOf($tg, $complete) {
var _local3 = getID($tg, true);
if ($complete) {
var _local1 = _all[_local3];
for (var _local2 in _local1) {
_local1[_local2].complete(false);
}
}
delete _all[_local3];
}
function complete($skipRender) {
if ($skipRender != true) {
if (!_initted) {
initTweenVals();
}
startTime = _curTime - ((duration * 1000) / _timeScale);
render(_curTime);
return(undefined);
}
if (vars._visible != undefined) {
if ((vars.autoAlpha != undefined) && (target._alpha == 0)) {
target._visible = false;
} else if (vars.runBackwards != true) {
target._visible = vars._visible;
}
}
if (vars.onComplete) {
vars.onComplete.apply(vars.onCompleteScope, vars.onCompleteParams);
}
if (vars.persist != true) {
removeTween(this);
}
}
function killVars($vars) {
if (overwriteManager.enabled) {
overwriteManager.killVars($vars, vars, tweens, _subTweens, []);
}
}
static function getID($tg, $lookup) {
var _local3;
if ($lookup) {
var _local1 = _all;
if (typeof($tg) == "movieclip") {
if (_local1[String($tg)] != undefined) {
return(String($tg));
}
_local3 = String($tg);
_all[_local3] = {info:[$tg, _local3]};
return(_local3);
}
for (var _local4 in _local1) {
if (_local1[_local4].info[0] == $tg) {
return(_local4);
}
}
}
_cnt++;
_local3 = "t" + _cnt;
_all[_local3] = {info:[$tg, _local3]};
return(_local3);
}
static function killGarbage() {
if (_listening) {
var _local1 = _all;
var _local2;
var _local3;
var _local5;
var _local6 = 0;
var _local4 = 0;
for (_local3 in _local1) {
_local4 = 0;
for (_local5 in _local1[_local3]) {
_local2 = _local1[_local3][_local5];
if (_local2.tweens == undefined) {
} else {
_local4++;
}
}
if (_local4 == 0) {
delete _local1[_local3];
} else {
_local6++;
}
}
if (_local6 == 0) {
_listening = false;
}
}
}
static function defaultEase($t, $b, $c, $d) {
$t = $t / $d;
return((((-$c) * $t) * ($t - 2)) + $b);
}
function easeProxy($t, $b, $c, $d) {
var _local3 = this;
return(_local3.proxiedEase.apply(null, arguments.concat(_local3.easeParams)));
}
static function tintProxy($o) {
$o.info.color.setTransform($o.target);
}
static function frameProxy($o) {
$o.info.mc.gotoAndStop(Math.round($o.target.frame));
}
static function volumeProxy($o) {
$o.info.sound.setVolume($o.target.volume);
}
function get active() {
if (_active) {
return(true);
}
if (_curTime >= startTime) {
_active = true;
if (!_initted) {
initTweenVals();
} else if (vars._visible != undefined) {
target._visible = true;
}
if (duration == 0.001) {
startTime = startTime - 1;
}
if (vars.onStart != undefined) {
vars.onStart.apply(vars.onStartScope, vars.onStartParams);
}
return(true);
}
return(false);
}
static var version = 8.15;
static var killDelayedCallsTo = killTweensOf;
static var _all = new Object();
static var _cnt = -16000;
static var _hrp = false;
}
Symbol 644 MovieClip [__Packages.gs.TweenFilterLite] Frame 0
class gs.TweenFilterLite extends gs.TweenLite
{
var _originalEase, vars, delay, endTargetID, _clrsa, _filters, _matrix, target, _cmf, _endMatrix, tweens, _timeScale, startTime, duration, _hst, _subTweens, _hasUpdate, complete, _initted, initTime;
function TweenFilterLite ($target, $duration, $vars) {
super($target, $duration, $vars);
_originalEase = vars.ease;
if (gs.TweenLite.version < 8.15) {
trace("TweenFilterLite error: Please update your TweenLite class or try clearing your ASO files. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
}
if ($vars.type != undefined) {
trace(("TweenFilterLite warning: " + $target) + " appears to be using deprecated syntax. Please update to the new syntax. See http://www.TweenFilterLite.com for details.");
}
}
static function to($target, $duration, $vars) {
return(new gs.TweenFilterLite($target, $duration, $vars));
}
static function from($target, $duration, $vars) {
$vars.runBackwards = true;
return(new gs.TweenFilterLite($target, $duration, $vars));
}
function initTweenVals($hrp, $reservedProps) {
if ((($hrp != true) && (delay != 0)) && (gs.TweenLite.overwriteManager.enabled)) {
gs.TweenLite.overwriteManager.manageOverwrites(this, gs.TweenLite._all[endTargetID]);
}
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
$reservedProps = $reservedProps || "";
$reservedProps = $reservedProps + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter ";
if ((typeof(target) == "movieclip") || (target instanceof TextField)) {
var _local4;
var _local5;
if (vars.blurFilter != undefined) {
_local5 = vars.blurFilter;
addFilter("blurFilter", _local5, flash.filters.BlurFilter, ["blurX", "blurY", "quality"], new flash.filters.BlurFilter(0, 0, _local5.quality || 2));
}
if (vars.glowFilter != undefined) {
_local5 = vars.glowFilter;
addFilter("glowFilter", _local5, flash.filters.GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new flash.filters.GlowFilter(16777215, 0, 0, 0, _local5.strength || 1, _local5.quality || 2, _local5.inner, _local5.knockout));
}
if (vars.colorMatrixFilter != undefined) {
_local5 = vars.colorMatrixFilter;
var _local12 = addFilter("colorMatrixFilter", _local5, flash.filters.ColorMatrixFilter, [], new flash.filters.ColorMatrixFilter(_matrix));
_cmf = _local12.filter;
_matrix = _cmf.matrix;
if ((_local5.matrix != undefined) && (_local5.matrix instanceof Array)) {
_endMatrix = _local5.matrix;
} else {
if (_local5.relative == true) {
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
}
_endMatrix = setBrightness(_endMatrix, _local5.brightness);
_endMatrix = setContrast(_endMatrix, _local5.contrast);
_endMatrix = setHue(_endMatrix, _local5.hue);
_endMatrix = setSaturation(_endMatrix, _local5.saturation);
_endMatrix = setThreshold(_endMatrix, _local5.threshold);
if (!isNaN(_local5.colorize)) {
_endMatrix = colorize(_endMatrix, _local5.colorize, _local5.amount);
} else if (!isNaN(_local5.color)) {
_endMatrix = colorize(_endMatrix, _local5.color, _local5.amount);
}
}
_local4 = 0;
while (_local4 < _endMatrix.length) {
if ((_matrix[_local4] != _endMatrix[_local4]) && (_matrix[_local4] != undefined)) {
tweens[tweens.length] = {o:_matrix, p:_local4.toString(), s:_matrix[_local4], c:_endMatrix[_local4] - _matrix[_local4], name:"colorMatrixFilter"};
}
_local4++;
}
}
if (vars.dropShadowFilter != undefined) {
_local5 = vars.dropShadowFilter;
addFilter("dropShadowFilter", _local5, flash.filters.DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new flash.filters.DropShadowFilter(0, 45, 0, 0, 0, 0, 1, _local5.quality || 2, _local5.inner, _local5.knockout, _local5.hideObject));
}
if (vars.bevelFilter != undefined) {
_local5 = vars.bevelFilter;
addFilter("bevelFilter", _local5, flash.filters.BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new flash.filters.BevelFilter(0, 0, 16777215, 0.5, 0, 0.5, 2, 2, 0, _local5.quality || 2));
}
if (vars.runBackwards == true) {
var _local3;
_local4 = 0;
while (_local4 < _clrsa.length) {
_local3 = _clrsa[_local4];
_local3.sr = _local3.sr + _local3.cr;
_local3.cr = _local3.cr * -1;
_local3.sg = _local3.sg + _local3.cg;
_local3.cg = _local3.cg * -1;
_local3.sb = _local3.sb + _local3.cb;
_local3.cb = _local3.cb * -1;
_local3.f[_local3.p] = ((_local3.sr << 16) | (_local3.sg << 8)) | _local3.sb;
_local4++;
}
}
super.initTweenVals(true, $reservedProps);
} else {
super.initTweenVals($hrp, $reservedProps);
}
}
function addFilter($name, $fv, $filterType, $props, $defaultFilter) {
var _local5 = {type:$filterType, name:$name};
var _local8 = target.filters;
var _local3;
var _local2;
var _local9;
var _local4;
var _local7;
_local3 = 0;
while (_local3 < _local8.length) {
if (_local8[_local3] instanceof $filterType) {
_local5.filter = _local8[_local3];
break;
}
_local3++;
}
if (_local5.filter == undefined) {
_local5.filter = $defaultFilter;
_local8[_local8.length] = _local5.filter;
target.filters = _local8;
}
_local3 = 0;
while (_local3 < $props.length) {
_local2 = $props[_local3];
if ($fv[_local2] != undefined) {
if (((_local2 == "color") || (_local2 == "highlightColor")) || (_local2 == "shadowColor")) {
_local4 = HEXtoRGB(_local5.filter[_local2]);
_local7 = HEXtoRGB($fv[_local2]);
_clrsa[_clrsa.length] = {f:_local5.filter, p:_local2, sr:_local4.rb, cr:_local7.rb - _local4.rb, sg:_local4.gb, cg:_local7.gb - _local4.gb, sb:_local4.bb, cb:_local7.bb - _local4.bb};
} else if ((((_local2 == "quality") || (_local2 == "inner")) || (_local2 == "knockout")) || (_local2 == "hideObject")) {
_local5.filter[_local2] = $fv[_local2];
} else {
if (typeof($fv[_local2]) == "number") {
_local9 = $fv[_local2] - _local5.filter[_local2];
} else {
_local9 = Number($fv[_local2]);
}
tweens[tweens.length] = {o:_local5.filter, p:_local2, s:_local5.filter[_local2], c:_local9, name:$name};
}
}
_local3++;
}
_filters[_filters.length] = _local5;
_hf = true;
return(_local5);
}
function render($t) {
var _local10 = (($t - startTime) / 1000) * _timeScale;
var _local6;
var _local3;
var _local2;
if (_local10 >= duration) {
_local10 = duration;
_local6 = (((_originalEase == vars.ease) || (duration == 0.001)) ? 1 : 0);
} else {
_local6 = vars.ease(_local10, 0, 1, duration);
}
_local2 = tweens.length - 1;
while (_local2 > -1) {
_local3 = tweens[_local2];
_local3.o[_local3.p] = _local3.s + (_local6 * _local3.c);
_local2--;
}
if (_hf) {
var _local4;
var _local8;
var _local9;
var _local7;
_local2 = _clrsa.length - 1;
while (_local2 > -1) {
_local3 = _clrsa[_local2];
_local8 = _local3.sr + (_local6 * _local3.cr);
_local9 = _local3.sg + (_local6 * _local3.cg);
_local7 = _local3.sb + (_local6 * _local3.cb);
_local3.f[_local3.p] = ((_local8 << 16) | (_local9 << 8)) | _local7;
_local2--;
}
if (_cmf) {
_cmf.matrix = _matrix;
}
var _local5 = target.filters;
_local2 = 0;
while (_local2 < _filters.length) {
_local4 = _local5.length - 1;
while (_local4 > -1) {
if (_local5[_local4] instanceof _filters[_local2].type) {
_local5.splice(_local4, 1, _filters[_local2].filter);
break;
}
_local4--;
}
_local2++;
}
target.filters = _local5;
}
if (_hst) {
_local2 = _subTweens.length - 1;
while (_local2 > -1) {
_subTweens[_local2].proxy(_subTweens[_local2]);
_local2--;
}
}
if (_hasUpdate) {
vars.onUpdate.apply(vars.onUpdateScope, vars.onUpdateParams);
}
if (_local10 == duration) {
complete(true);
}
}
function killVars($vars) {
if (gs.TweenLite.overwriteManager.enabled) {
gs.TweenLite.overwriteManager.killVars($vars, vars, tweens, _subTweens, _filters);
}
}
function HEXtoRGB($n) {
return({rb:$n >> 16, gb:($n >> 8) & 255, bb:$n & 255});
}
static function colorize($m, $color, $amount) {
if (($color == undefined) || (isNaN($color))) {
return($m);
}
if ($amount == undefined) {
$amount = 1;
}
var _local3 = (($color >> 16) & 255) / 255;
var _local5 = (($color >> 8) & 255) / 255;
var _local2 = ($color & 255) / 255;
var _local4 = 1 - $amount;
var _local7 = [_local4 + (($amount * _local3) * _lumR), ($amount * _local3) * _lumG, ($amount * _local3) * _lumB, 0, 0, ($amount * _local5) * _lumR, _local4 + (($amount * _local5) * _lumG), ($amount * _local5) * _lumB, 0, 0, ($amount * _local2) * _lumR, ($amount * _local2) * _lumG, _local4 + (($amount * _local2) * _lumB), 0, 0, 0, 0, 0, 1, 0];
return(applyMatrix(_local7, $m));
}
static function setThreshold($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
var _local2 = [_lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, _lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, _lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, 0, 0, 0, 1, 0];
return(applyMatrix(_local2, $m));
}
static function setHue($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = $n * (Math.PI/180);
var _local1 = Math.cos($n);
var _local2 = Math.sin($n);
var _local4 = [(_lumR + (_local1 * (1 - _lumR))) + (_local2 * (-_lumR)), (_lumG + (_local1 * (-_lumG))) + (_local2 * (-_lumG)), (_lumB + (_local1 * (-_lumB))) + (_local2 * (1 - _lumB)), 0, 0, (_lumR + (_local1 * (-_lumR))) + (_local2 * 0.143), (_lumG + (_local1 * (1 - _lumG))) + (_local2 * 0.14), (_lumB + (_local1 * (-_lumB))) + (_local2 * -0.283), 0, 0, (_lumR + (_local1 * (-_lumR))) + (_local2 * (-(1 - _lumR))), (_lumG + (_local1 * (-_lumG))) + (_local2 * _lumG), (_lumB + (_local1 * (1 - _lumB))) + (_local2 * _lumB), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return(applyMatrix(_local4, $m));
}
static function setBrightness($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = ($n * 100) - 100;
return(applyMatrix([1, 0, 0, 0, $n, 0, 1, 0, 0, $n, 0, 0, 1, 0, $n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], $m));
}
static function setSaturation($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
var _local4 = 1 - $n;
var _local3 = _local4 * _lumR;
var _local5 = _local4 * _lumG;
var _local2 = _local4 * _lumB;
var _local6 = [_local3 + $n, _local5, _local2, 0, 0, _local3, _local5 + $n, _local2, 0, 0, _local3, _local5, _local2 + $n, 0, 0, 0, 0, 0, 1, 0];
return(applyMatrix(_local6, $m));
}
static function setContrast($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = $n + 0.01;
var _local2 = [$n, 0, 0, 0, 128 * (1 - $n), 0, $n, 0, 0, 128 * (1 - $n), 0, 0, $n, 0, 128 * (1 - $n), 0, 0, 0, 1, 0];
return(applyMatrix(_local2, $m));
}
static function applyMatrix($m, $m2) {
if (((($m == undefined) || (!($m instanceof Array))) || ($m2 == undefined)) || (!($m2 instanceof Array))) {
return($m2);
}
var _local7 = [];
var _local2 = 0;
var _local5 = 0;
var _local6;
var _local1;
_local6 = 0;
while (_local6 < 4) {
_local1 = 0;
while (_local1 < 5) {
if (_local1 == 4) {
_local5 = $m[_local2 + 4];
} else {
_local5 = 0;
}
_local7[_local2 + _local1] = (((($m[_local2] * $m2[_local1]) + ($m[_local2 + 1] * $m2[_local1 + 5])) + ($m[_local2 + 2] * $m2[_local1 + 10])) + ($m[_local2 + 3] * $m2[_local1 + 15])) + _local5;
_local1++;
}
_local2 = _local2 + 5;
_local6++;
}
return(_local7);
}
function get timeScale() {
return(_timeScale);
}
function set timeScale($n) {
if (_initted && (gs.TweenLite._curTime > (initTime + (delay * 1000)))) {
initTime = (gs.TweenLite._curTime - (((gs.TweenLite._curTime - (initTime + (delay * 1000))) * _timeScale) * (1 / $n))) - (delay * 1000);
if (startTime != 99999999999) {
startTime = initTime + (delay * 1000);
}
}
_timeScale = $n;
//return(timeScale);
}
static var version = 8.16;
static var delayedCall = gs.TweenLite.delayedCall;
static var killTweensOf = gs.TweenLite.killTweensOf;
static var killDelayedCallsTo = gs.TweenLite.killDelayedCallsTo;
static var _idMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
static var _lumR = 0.212671;
static var _lumG = 0.71516;
static var _lumB = 0.072169;
var _hf = false;
}
Symbol 645 MovieClip [__Packages.Aardman] Frame 0
class Aardman
{
function Aardman () {
trace("Aardman is a static class only");
}
static function updateClock(minutes) {
var _local3 = minutes / 540;
var _local2 = (_local3 * 360) - 90;
_root.clock.hand._rotation = _local2;
}
static function updateScore() {
_root.currentScore.txtScore.text = _root.game.totalScore + _root.game.levelScore;
_root.totalScore.txtScore.text = _root.game.levelScore;
}
static function setupFridge(owned) {
_root.wash.gotoAndStop("empty");
_root.wash.dropArea._visible = false;
_root.wash._visible = owned;
}
static function hideHints() {
_root.hint_ba._alpha = 0;
_root.hint_bb._alpha = 0;
_root.hint_bc._alpha = 0;
_root.hint_bd._alpha = 0;
_root.hint_ba._visible = false;
_root.hint_bb._visible = false;
_root.hint_bc._visible = false;
_root.hint_bd._visible = false;
_root.ba.timer._visible = false;
_root.bb.timer._visible = false;
_root.bc.timer._visible = false;
_root.bd.timer._visible = false;
_root.wash.hart._visible = false;
}
static var rolloverGlowColour = 15869952;
static var rolloverGlowAlpha = 1;
static var rolloverGlowBlur = 12;
static var rolloverGlowStrength = 1.5;
static var rolloverGlowQuality = 1;
}
Symbol 646 MovieClip [__Packages.Bomba] Frame 0
class Bomba extends MovieClip
{
var stop, auto, nivel, _visible, gotoAndStop, lamp, timer, hart;
function Bomba () {
super();
(stop());// not popped
auto = undefined;
nivel = 1;
}
function onEnterFrame() {
if (_root.game.playing) {
_visible = true;
} else {
_visible = false;
}
}
function init() {
gotoAndStop(nivel);
switch (tipo) {
case 1 :
lamp.gotoAndStop("red");
break;
case 2 :
lamp.gotoAndStop("blue");
break;
case 3 :
lamp.gotoAndStop("green");
}
lamp.lamp.gotoAndStop("off");
timer._visible = false;
hart._visible = false;
}
function addAccion() {
_root.game.cola.addAccion("walkBomba", this);
}
function iniciarLlenado() {
llenando = true;
auto.iniciarLlenado();
_root.game.finishTutorial(1);
hart._visible = true;
}
var ocupada = false;
var llenando = false;
var tipo = 1;
var instanceName = 1;
}
Symbol 647 MovieClip [__Packages.Car] Frame 0
class Car extends MovieClip
{
var gotoAndStop, tipo, mas, menos, boton, btnAuto, game, globo, burn, mano, _x, pideItem, intervalPaciencia, paciencia, hart, bomba, _y, removeMovieClip;
function Car () {
super();
}
function init() {
gotoAndStop(tipo);
mas._alpha = 0;
menos._alpha = 0;
boton = btnAuto;
game = _root.game;
globo = undefined;
burn = 0;
mano = mano;
mano._visible = false;
_x = -60;
boton.onPress = function () {
if ((this._parent.bomba == undefined) && (this._parent.tomable)) {
if (this._parent.game.carInWash == this._parent) {
_root.wash.gotoAndStop("empty");
_root.wash.hart._visible = false;
}
this._parent._alpha = 100;
this._parent.startDrag();
this._parent._alpha = 0;
this._parent.tmpX = this._parent._x;
this._parent.tmpY = this._parent._y;
this._parent.dragando = true;
_root.draggingDough.gotoAndStop(this._parent.tipo);
_root.draggingDough.hart.gotoAndStop(this._parent.paciencia);
_root.draggingDough.btnAuto._visible = false;
_root.draggingDough._x = this._parent._x;
_root.draggingDough._y = this._parent._y;
_root.draggingDough.curDough = this._parent;
_root.destacarBombas();
}
};
boton.onRelease = function () {
if (this._parent.bomba == undefined) {
this._parent.stopDrag();
this._parent._alpha = 100;
_root.draggingDough.curDough = undefined;
_root.draggingDough._x = -500;
this._parent.dragando = false;
_root.noDestacarBombas();
_root.game.dropCar(this._parent);
} else {
_root.game.cola.addAccion("walkAuto", this._parent);
}
};
boton.onRollOver = function () {
this._parent.filters = [new flash.filters.GlowFilter(Aardman.rolloverGlowColour, Aardman.rolloverGlowAlpha, Aardman.rolloverGlowBlur, Aardman.rolloverGlowBlur, Aardman.rolloverGlowStrength, Aardman.rolloverGlowQuality)];
};
boton.onRollOut = function () {
this._parent.filters = [];
};
}
function avanzar() {
if (!esperandoPista) {
if (pideItem) {
item = cerebral.cKit.randomChoice([1, 2, 3, 4]);
}
_root.wallace.doughComment();
intervalPaciencia = setInterval(this, "restarPaciencia", 500);
gs.TweenFilterLite.to(this, 0.25, {_x:68.2, overwrite:false, onComplete:setTomable, onCompleteScope:this});
game.showTutorialStep(0);
if (tipo == 2) {
game.showTutorialStep(5);
}
_root.objSounds.play("dough-land-no-bowl");
}
}
function setTomable() {
tomable = true;
}
function onEnterFrame() {
if (pagando) {
propina = paciencia;
mano.gotoAndStop(Math.round(propina / 2));
}
if (lleno) {
burn++;
}
hart.gotoAndStop(paciencia);
if (game.carInWash == this) {
_root.wash.hart.gotoAndStop(paciencia);
}
if (bomba != undefined) {
bomba.hart.gotoAndStop(paciencia);
}
if (this == _root.draggingDough.curDough) {
_root.draggingDough.hart.gotoAndStop(paciencia);
_root.draggingDough._x = _x;
_root.draggingDough._y = _y;
}
}
function noSumarPaciencia() {
clearInterval(intervalPaciencia);
}
function restarPaciencia() {
paciencia--;
if (paciencia < 1) {
paciencia = 1;
}
}
function sumarPaciencia() {
if (paciencia <= 1) {
paciencia = paciencia + 25;
} else {
paciencia = paciencia + 10;
}
if (paciencia > 100) {
paciencia = 100;
}
hart._xscale = 130;
hart._yscale = 130;
gs.TweenLite.to(hart, 0.5, {_xscale:100, _yscale:100});
}
function restarPaciencia2() {
paciencia = paciencia - 10;
if (paciencia < 1) {
paciencia = 1;
}
hart._xscale = 130;
hart._yscale = 130;
gs.TweenLite.to(hart, 0.5, {_xscale:100, _yscale:100});
}
function iniciarLlenado() {
bomba.timer._visible = true;
bomba.timer.gotoAndStop(1);
switch (bomba.nivel) {
case 1 :
gs.TweenLite.to(bomba.timer, 15, {frame:200, onComplete:finLlenado, onCompleteScope:this, ease:gs.easing.Linear.easeNone});
break;
case 2 :
gs.TweenLite.to(bomba.timer, 12, {frame:200, onComplete:finLlenado, onCompleteScope:this, ease:gs.easing.Linear.easeNone});
break;
case 3 :
gs.TweenLite.to(bomba.timer, 9, {frame:200, onComplete:finLlenado, onCompleteScope:this, ease:gs.easing.Linear.easeNone});
}
_root.objSounds.play("switch-on-oven");
bomba.lamp.lamp.gotoAndStop("on");
if (item > 0) {
gs.TweenLite.delayedCall(2, pedirItem, [], this);
}
}
function finLlenado() {
lleno = true;
_root.smoke["smoke_" + bomba.instanceName] = true;
bomba.timer._visible = false;
if (item == 0) {
pagar();
}
}
function obtenerItem() {
item = 0;
gs.TweenLite.to(globo, 0.3, {_alpha:0, onComplete:function () {
this._visible = false;
}, onCompleteScope:globo});
if (lleno) {
pagar();
}
}
function pagar() {
if (!pagando) {
mano._visible = true;
mano._rotation = 30;
mano.stop();
if (tipo == 1) {
propina = Math.round(paciencia * 0.4);
} else if (tipo == 2) {
propina = Math.round(paciencia * 0.7);
} else if (tipo == 3) {
propina = Math.round(paciencia);
}
pagando = true;
gs.TweenLite.to(mano, 1, {_rotation:0, ease:gs.easing.Elastic.easeOut});
lleno = true;
bomba.llenando = false;
bomba.manguera.gotoAndStop("cooked");
bomba.lamp.lamp.gotoAndStop("blink");
_root.smoke["smoke_" + bomba.instanceName] = true;
_root.objSounds.play("bread-done");
game.showTutorialStep(2);
}
}
function go() {
pagando = false;
game.autosListos++;
game.levelCars++;
game.checkAutos();
bomba.ocupada = false;
bomba.auto = undefined;
removeMovieClip();
}
function pedirItem() {
requestedItem = true;
_root.game.agregarItem(item);
globo = _root["hint_" + bomba.instanceName];
globo._visible = true;
globo.gfx.gotoAndStop(item);
gs.TweenLite.to(globo, 0.3, {_alpha:100});
game.showTutorialStep(4);
}
var ocupado = false;
var dragando = false;
var estado = "esperando";
var num_auto = 0;
var item = 0;
var lleno = false;
var pagando = false;
var propina = 0;
var tomable = false;
var esperandoPista = false;
var washed = false;
var requestedItem = false;
}
Symbol 648 MovieClip [__Packages.Game] Frame 0
class Game
{
var levelNumber, speedLevel, player, tutorialStep, tutorialClosed, bombas, autos, cola, item_player, levels, currentLevel, prevLevel, velocidad, carInWash;
function Game () {
init();
}
function init() {
levelNumber = 0;
speedLevel = 1;
carWash = false;
Aardman.setupFridge(carWash);
setVelocidad();
player = _root.player;
dinero = 0;
totalScore = 0;
levelScore = 0;
Aardman.updateScore();
Aardman.hideHints();
tutorialStep = 0;
tutorialClosed = 0;
offSetClips.auto = [0, 0];
offSetClips.bomba = [0, 0];
offSetClips.caja = [0, 0];
offSetClips.item = [0, 0];
offSetClips.idle = [0, 0];
offSetClips.bote = [0, 0];
bombas = new Array();
autos = new Array();
player._visible = true;
cola = new Cola();
item_player = _root.machine.carriedItem;
item_player._visible = false;
item_player.items = [];
levels = new Levels();
currentLevel = levels.levels[levelNumber];
player._visible = false;
_root.totalPlata = dinero;
_root.moneyHand = 0;
pistaAutos.push([125.1, false]);
pistaAutos.push([209.9, false]);
pistaAutos.push([294.7, false]);
prevLevel = levels.levels[levelNumber - 1];
_root.prevLevelGoal = prevLevel.goal;
}
function initLevel() {
levelNumber++;
currentLevel = levels.levels[levelNumber];
prevLevel = levels.levels[levelNumber - 1];
_root.prevLevelGoal = prevLevel.goal;
levelGoal = currentLevel.goal;
levelGoalTxt = ("<font color='#FE6C00'>Required quality: </font><font color='#000000'>" + levelGoal) + "</font>";
tiempo = 0;
_root.tiempo = "08:00";
Aardman.updateClock(tiempo);
Aardman.setupFridge(carWash);
autos.length = 0;
autos = new Array();
}
function retryLevel() {
levelNumber--;
currentLevel = levels.levels[levelNumber];
prevLevel = levels.levels[levelNumber - 1];
levelGoal = currentLevel.goal;
levelGoalTxt = ("<font color='#FE6C00'>Required quality: </font><font color='#000000'>" + levelGoal) + "</font>";
dinero = dinero - levelMoney;
totalScore = totalScore - levelScore;
Aardman.updateScore();
tiempo = 0;
_root.tiempo = "08:00";
Aardman.updateClock(tiempo);
autos.length = 0;
autos = new Array();
iniciar();
}
function iniciar() {
levelMoney = 0;
levelScore = 0;
levelCars = 0;
autosListos = 0;
levelGoal = currentLevel.goal;
levelGoalTxt = ("<font color='#FE6C00'>Required quality: </font><font color='#000000'>" + levelGoal) + "</font>";
finNivel = false;
Aardman.updateScore();
_root.music.setLoop("main");
tiempo = 0;
_root.tiempo = "08:00";
Aardman.updateClock(tiempo);
gs.TweenLite.delayedCall(0.1, tick, [], this);
player._visible = true;
var _local3 = 0;
while (_local3 < currentLevel.bombas.length) {
if (_root.ovenHolder[currentLevel.bombas[_local3][3]] == undefined) {
agregarBomba(currentLevel.bombas[_local3][0], currentLevel.bombas[_local3][1], currentLevel.bombas[_local3][2], currentLevel.bombas[_local3][3]);
} else {
_root.ovenHolder[currentLevel.bombas[_local3][3]]._x = currentLevel.bombas[_local3][0];
_root.ovenHolder[currentLevel.bombas[_local3][3]]._y = currentLevel.bombas[_local3][1];
}
_local3++;
}
_local3 = 0;
while (_local3 < currentLevel.cars.length) {
gs.TweenLite.delayedCall(currentLevel.cars[_local3][0], agregarAuto, [currentLevel.cars[_local3][2], currentLevel.cars[_local3][1], currentLevel.cars[_local3][3]], this);
_local3++;
}
gs.TweenLite.to(_root.marco, 0.3, {autoAlpha:0});
playing = true;
}
function setVelocidad() {
if (speedLevel == 1) {
velocidad = 100;
} else if (speedLevel == 2) {
velocidad = 120;
} else if (speedLevel == 3) {
velocidad = 150;
} else if (speedLevel == 4) {
velocidad = 180;
}
}
function tick() {
if (levelNumber == 0) {
tiempo = tiempo + 7;
} else {
tiempo = tiempo + 6;
}
if (tiempo > 540) {
tiempo = 540;
}
var _local5 = tiempo;
var _local3 = Math.floor(_local5 / 60);
var _local4 = _local5 - (_local3 * 60);
_root.tiempo = "";
if (_local3 < 1) {
_root.tiempo = _root.tiempo + "0";
}
_root.tiempo = _root.tiempo + ((_local3 + 9) + ":");
if (_local4 < 9) {
_root.tiempo = _root.tiempo + "0";
}
_root.tiempo = _root.tiempo + _local4;
Aardman.updateClock(tiempo);
if (_root.tiempo != "18:00") {
gs.TweenLite.delayedCall(0.8, tick, [], this);
}
}
function endNivel() {
playing = false;
gs.TweenLite.to(_root.marco, 0.3, {autoAlpha:100});
_root.music.setLoop("quiet");
if (levelMoney >= levelGoal) {
_root.marco.gotoAndStop("endwin");
} else {
_root.marco.gotoAndStop("endfail");
}
tiempo = 540;
tick();
gs.TweenLite.delayedCall(0.3, initLevel, [], this);
}
function agregarBomba(x_, y_, tipo, nombre) {
var _local3 = _root.ovenHolder.attachMovie("bomba", nombre, _root.ovenHolder.getNextHighestDepth());
_local3._x = x_;
_local3._y = y_;
_local3.tipo = tipo;
_local3.instanceName = nombre;
bombas.push(_local3);
_local3.init();
}
function agregarAuto(pideItem, tipo, paciencia) {
var _local3 = _root.doughHolder.attachMovie("auto", "auto" + autos.length, _root.doughHolder.getNextHighestDepth());
_local3.num_auto = autos.length;
autos.push(_local3);
_local3.esperandoPista = true;
_local3.pideItem = pideItem;
_local3.paciencia = paciencia;
_local3.tipo = tipo;
_local3.init();
asignarAutoPista(_local3);
}
function checkAutos() {
if (autosListos == currentLevel.cars.length) {
finNivel = true;
}
}
function asignarAutoPista(newAuto) {
if (pistaAutos[0][1] == false) {
newAuto._y = pistaAutos[0][0];
pistaAutos[0][1] = true;
newAuto.pista = 0;
newAuto.esperandoPista = false;
newAuto.avanzar();
} else if (pistaAutos[1][1] == false) {
newAuto._y = pistaAutos[1][0];
pistaAutos[1][1] = true;
newAuto.pista = 1;
newAuto.esperandoPista = false;
newAuto.avanzar();
} else if (pistaAutos[2][1] == false) {
newAuto._y = pistaAutos[2][0];
pistaAutos[2][1] = true;
newAuto.pista = 2;
newAuto.esperandoPista = false;
newAuto.avanzar();
} else {
newAuto.esperandoPista = true;
newAuto._x = -300;
}
}
function buscarAutoLibre() {
var _local2 = 0;
while (_local2 < autos.length) {
var _local3 = autos[_local2];
if (_local3.esperandoPista) {
asignarAutoPista(_local3);
break;
}
_local2++;
}
}
function dropCar(car) {
var _local6 = false;
var _local5 = 0;
while (_local5 < bombas.length) {
var _local4 = bombas[_local5];
if (car.hitTest(_local4.droparea) && (_local4.ocupada == false)) {
_local6 = true;
_local5 = bombas.length;
car._visible = false;
car._x = _local4._x;
car._y = _local4._y;
car.ocupado = true;
car.bomba = _local4;
_local4.ocupada = true;
_local4.auto = car;
pistaAutos[car.pista][1] = false;
car.pista = undefined;
car.bomba.manguera.gotoAndStop("waiting");
if (car.tipo == _local4.tipo) {
car.sumarPaciencia();
} else {
car.restarPaciencia2();
_root.objSounds.play("error-honk");
}
buscarAutoLibre();
finishTutorial(0);
if (car.tipo == 2) {
finishTutorial(5);
}
showTutorialStep(1);
if (car.washed) {
_root.wash.gotoAndStop("empty");
carInWash = undefined;
}
}
_local5++;
}
if ((car.hitTest(_root.wash.dropArea) && (carInWash == undefined)) && (carWash)) {
car._x = _root.wash._x;
car._y = _root.wash._y;
car._alpha = 0;
_local6 = true;
carInWash = car;
pistaAutos[car.pista][1] = false;
if (!car.washed) {
car.sumarPaciencia();
car.sumarPaciencia();
car.sumarPaciencia();
}
_root.wash.gotoAndStop("full");
_root.wash.hart._visible = true;
_root.wash.hart.gotoAndStop(car.paciencia);
car.washed = true;
car.pista = undefined;
pistaAutos[car.pista][1] = false;
buscarAutoLibre();
}
if (!_local6) {
car._x = car.tmpX;
car._y = car.tmpY;
if (carInWash == car) {
_root.wash.hart._visible = true;
_root.wash.hart.gotoAndStop(car.paciencia);
_root.wash.gotoAndStop("full");
car._alpha = 0;
}
}
}
function walkToClip(clip, tipo) {
var _local4 = clip._x + offSetClips[tipo][0];
var _local3 = clip._y + offSetClips[tipo][1];
var _local10 = _root.Maths.distance(_local4, _local3, player._x, player._y);
var _local9 = Math.abs(_local4 - player._x);
var _local7 = Math.abs(_local3 - player._y);
_root.objSounds.play("forklift-forward-roll", Math.min(_local9 / 3, 100));
_root.objSounds.play("forklift-up_down", Math.min(_local7 / 3, 100));
var _local5 = _local10 / velocidad;
gs.TweenFilterLite.to(player, _local5, {_x:_local4, _y:_local3, ease:gs.easing.Quart.easeInOut, overwrite:false});
gs.TweenLite.delayedCall(_local5 + 0.1, colaFinishAccion, [tipo, clip], this);
}
function colaFinishAccion(tipo, target) {
cola.finishAccion();
if (tipo == "bomba") {
var _local5 = target;
if ((_local5.ocupada && (!_local5.llenando)) && (!_local5.auto.pagando)) {
_local5.auto.sumarPaciencia();
_local5.manguera.gotoAndStop("on");
_local5.iniciarLlenado();
}
var _local3 = _local5.auto;
if ((_local3.item > 0) || (_local3.pagando)) {
if ((itemServing == _local3.item) && (_local3.requestedItem)) {
_local3.obtenerItem();
itemServing = 0;
item_player._visible = false;
_local3.sumarPaciencia();
finishTutorial(4);
}
if ((_local3.pagando && (itemServing == 5)) || (_local3.pagando && (itemServing == 0))) {
_local5.manguera.gotoAndStop("off");
_local5.lamp.lamp.gotoAndStop("off");
_root.smoke["smoke_" + _local5.instanceName] = false;
itemServing = 5;
item_player._visible = true;
item_player.gotoAndStop(5);
_local5.hart._visible = false;
var _local12 = item_player.items[item_player.items.length - 1];
var _local11 = item_player.goodsHolder.getNextHighestDepth();
var _local4 = item_player.goodsHolder.attachMovie("goods", "goods" + _local11, _local11);
var _local6 = _local12.stackPoint.holderToLocal(item_player.goodsHolder);
if (_local6.y == undefined) {
_local6 = {x:0, y:0};
}
_local4._x = _local6.x + _root.Maths.randomInt(-3, 3);
_local4._y = _local6.y;
_local4.gotoAndStop("side");
_local4.bread._visible = false;
_local4.buns._visible = false;
_local4.loaves._visible = false;
switch (_local3.tipo) {
case 1 :
_local4.gfx = _local4.bread;
break;
case 2 :
_local4.gfx = _local4.loaves;
break;
case 3 :
_local4.gfx = _local4.buns;
}
_local4.gfx._visible = true;
_local4.gfx.gotoAndStop(Math.min(Math.ceil(_local3.burn / 4), 100));
item_player.items.push(_local4);
_local3.sumarPaciencia();
var _local9 = 1;
_local9 = Math.ceil(moneyHand / 10);
if (_local9 > 8) {
_local9 = 8;
}
item_player.billetes.gotoAndStop(_local9);
moneyHand = moneyHand + (_local3.propina + 5);
_local3.noSumarPaciencia();
_local3.go();
showScore(_local3.propina + 10);
finishTutorial(2);
showTutorialStep(3);
}
}
if (cola.queueIsEmpty()) {
cola.addAccion("walkIdle", _root["idle_" + _local5.instanceName]);
}
}
if (tipo == "auto") {
trace("WARNING: Game.colaFinishAccion called with type 'auto' - investigate!");
}
if ((tipo == "item") && (itemServing == 0)) {
var _local7 = target;
itemServing = _local7.tipo;
item_player._visible = true;
item_player.gotoAndStop(_local7.tipo);
_local7.tipo = 0;
_local7._visible = false;
}
if ((tipo == "caja") && (itemServing == 5)) {
itemServing = 0;
item_player._visible = false;
dinero = dinero + moneyHand;
levelMoney = levelMoney + moneyHand;
levelScore = levelScore + moneyHand;
Aardman.updateScore();
moneyHand = 0;
finishTutorial(3);
for (var _local8 in item_player.items) {
item_player.items[_local8].removeMovieClip();
}
item_player.items = [];
_root.objSounds.play("bread-into-van-2");
_root.wallace.vanComment();
if (finNivel) {
endNivel();
}
}
if (tipo == "caja") {
_root.van.gotoAndPlay("closeDoors");
if (cola.queueIsEmpty()) {
cola.addAccion("walkIdle", _root.vanIdlePoint);
}
}
_root.totalPlata = dinero;
_root.moneyHand = moneyHand;
}
function showScore(cuanto) {
}
function showMoney(cuanto) {
}
function agregarItem(tipo) {
if (_root.i1.tipo == 0) {
_root.i1.tipo = tipo;
_root.i1.clip.gotoAndStop(tipo);
_root.i1._visible = true;
gs.TweenFilterLite.from(_root.i1, 0.25, {_y:-20, ease:gs.easing.Quad.easeIn, overwrite:false});
} else if (_root.i2.tipo == 0) {
_root.i2.tipo = tipo;
_root.i2.clip.gotoAndStop(tipo);
_root.i2._visible = true;
gs.TweenFilterLite.from(_root.i2, 0.25, {_y:-20, ease:gs.easing.Quad.easeIn, overwrite:false});
} else if (_root.i3.tipo == 0) {
_root.i3.tipo = tipo;
_root.i3.clip.gotoAndStop(tipo);
_root.i3._visible = true;
gs.TweenFilterLite.from(_root.i3, 0.25, {_y:-20, ease:gs.easing.Quad.easeIn, overwrite:false});
} else if (_root.i4.tipo == 0) {
_root.i4.tipo = tipo;
_root.i4.clip.gotoAndStop(tipo);
_root.i4._visible = true;
gs.TweenFilterLite.from(_root.i4, 0.25, {_y:-20, ease:gs.easing.Quad.easeIn, overwrite:false});
}
_root.objSounds.play("ingredient-request-2");
}
function walkY(destY, tiempo) {
gs.TweenFilterLite.to(player, tiempo, {_y:destY, ease:gs.easing.Linear.easeNone, overwrite:false});
}
function walkX(destX, tiempo) {
gs.TweenFilterLite.to(player, tiempo, {_x:destX, ease:gs.easing.Linear.easeNone, overwrite:false});
}
function showTutorialStep(step) {
if (tutorialStep == step) {
var mcTut = eval ("_root.tut" + step);
mcTut._alpha = 0;
gs.TweenLite.to(mcTut, 1, {autoAlpha:100});
mcTut.mano.gotoAndPlay(1);
}
}
function finishTutorial(step) {
if (tutorialStep == step) {
tutorialStep++;
var mcTut = eval ("_root.tut" + step);
gs.TweenLite.to(mcTut, 1, {autoAlpha:0});
}
}
function playLoop(sonido) {
if (currentLoop != sonido) {
if (currentLoop != "") {
_root.mainLoop.stop(currentLoop);
}
_root.mainLoop.attachSound(sonido);
_root.mainLoop.start(0, 3000);
currentLoop = sonido;
}
}
var dinero = 0;
var pistaAutos = new Array();
var moneyHand = 0;
var playing = false;
var finNivel = false;
var autosListos = 0;
var levelScore = 0;
var levelMoney = 0;
var levelCars = 0;
var levelGoal = 0;
var levelGoalTxt = "";
var currentLoop = "";
var totalScore = 0;
var carWash = false;
var offsetItemX = 0;
var offsetItemY = 0;
var offSetClips = new Array();
var serving = false;
var itemServing = 0;
var tiempo = 0;
var pistasExtras = false;
}
Symbol 649 MovieClip [__Packages.Cola] Frame 0
class Cola
{
var acciones, currentIndex, currentAccion;
function Cola () {
acciones = new Array();
currentIndex = 0;
}
function addAccion(nombre, target) {
var _local2 = new Accion(nombre, target);
acciones.push(_local2);
nextAccion();
}
function nextAccion() {
currentAccion = acciones[currentIndex];
if (currentIndex == (acciones.length - 1)) {
doAccion(currentAccion);
}
}
function queueIsEmpty() {
return(((currentIndex == acciones.length) ? true : false));
}
function doAccion(accion) {
switch (accion.nombre) {
case "walkBomba" :
_root.game.walkToClip(accion.target, "bomba");
break;
case "walkAuto" :
_root.game.walkToClip(accion.target, "auto");
break;
case "walkCaja" :
_root.game.walkToClip(accion.target, "caja");
if (!_root.van.doorsOpen) {
_root.van.gotoAndPlay("openDoors");
}
_root.van.doorsOpen = true;
break;
case "walkItem" :
if (!accion.target._visible) {
trace("Borkerd");
finishAccion();
} else {
_root.game.walkToClip(accion.target, "item");
}
break;
case "walkIdle" :
_root.game.walkToClip(accion.target, "idle");
break;
default :
trace("Cola.doAccion: Unknown type " + accion.nombre);
}
}
function finishAccion() {
currentAccion.terminada = true;
currentIndex++;
if (currentIndex < acciones.length) {
currentAccion = acciones[currentIndex];
doAccion(currentAccion);
}
}
}
Symbol 650 MovieClip [__Packages.Accion] Frame 0
class Accion
{
var terminada, nombre, target;
function Accion (nombre, target) {
terminada = false;
this.nombre = nombre;
this.target = target;
}
}
Symbol 651 MovieClip [__Packages.Levels] Frame 0
class Levels
{
var tmpLevel;
function Levels () {
tmpLevel = new Object();
tmpLevel.goal = 100;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"]];
tmpLevel.cars = [[2, 1, false, 100], [29, 1, true, 100], [45, 1, true, 100]];
levels.push(tmpLevel);
tmpLevel = new Object();
tmpLevel.goal = 200;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"], [381.85, 173.2, 1, "bb"]];
tmpLevel.cars = [[2, 1, false, 100], [10, 1, true, 100], [25, 1, false, 100], [40, 1, true, 70], [55, 1, false, 90], [65, 1, true, 100]];
levels.push(tmpLevel);
tmpLevel = new Object();
tmpLevel.goal = 300;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"], [381.85, 173.2, 1, "bb"]];
tmpLevel.cars = [[2, 1, true, 100], [8, 1, true, 70], [20, 1, false, 80], [30, 1, false, 70], [45, 1, true, 90], [65, 1, false, 70]];
levels.push(tmpLevel);
tmpLevel = new Object();
tmpLevel.goal = 400;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"], [381.85, 173.2, 1, "bb"], [263.45, 278.8, 2, "bc"]];
tmpLevel.cars = [[2, 2, true, 100], [5, 1, true, 70], [12, 1, false, 80], [20, 2, true, 80], [30, 1, false, 70], [38, 1, true, 90], [50, 2, false, 70], [65, 1, true, 100]];
levels.push(tmpLevel);
tmpLevel = new Object();
tmpLevel.goal = 500;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"], [381.85, 173.2, 1, "bb"], [263.45, 278.8, 2, "bc"]];
tmpLevel.cars = [[2, 2, false, 50], [7, 1, true, 70], [12, 1, false, 80], [18, 1, true, 80], [25, 1, false, 70], [32, 2, true, 90], [45, 1, false, 50], [50, 1, true, 100], [55, 2, false, 50], [65, 1, true, 100]];
levels.push(tmpLevel);
tmpLevel = new Object();
tmpLevel.goal = 550;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"], [381.85, 173.2, 1, "bb"], [263.45, 278.8, 2, "bc"], [381.85, 279.6, 3, "bd"]];
tmpLevel.cars = [[2, 1, false, 80], [3, 3, true, 70], [5, 1, false, 80], [15, 2, true, 100], [20, 1, false, 50], [32, 1, true, 60], [45, 2, true, 50], [50, 3, true, 100], [55, 2, false, 50], [65, 1, true, 100]];
levels.push(tmpLevel);
tmpLevel = new Object();
tmpLevel.goal = 600;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"], [381.85, 173.2, 1, "bb"], [263.45, 278.8, 2, "bc"], [381.85, 279.6, 3, "bd"]];
tmpLevel.cars = [[2, 3, true, 100], [5, 2, true, 70], [12, 1, false, 80], [20, 2, true, 80], [30, 1, false, 70], [38, 3, true, 90], [40, 2, false, 50], [45, 1, true, 100], [50, 2, false, 50], [60, 1, true, 60], [65, 1, true, 100]];
levels.push(tmpLevel);
tmpLevel = new Object();
tmpLevel.goal = 650;
tmpLevel.bombas = [[263.45, 173.2, 1, "ba"], [381.85, 173.2, 1, "bb"], [263.45, 278.8, 2, "bc"], [381.85, 279.6, 3, "bd"]];
tmpLevel.cars = [[2, 3, true, 60], [5, 3, true, 70], [8, 2, false, 80], [15, 1, true, 80], [20, 1, false, 70], [24, 3, true, 90], [30, 2, false, 50], [35, 1, true, 100], [38, 2, false, 50], [45, 1, true, 60], [50, 1, true, 100], [60, 1, true, 60]];
levels.push(tmpLevel);
}
var levels = new Array();
}
Symbol 652 MovieClip [__Packages.gs.easing.Quart] Frame 0
class gs.easing.Quart
{
function Quart () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((((c * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return(((-c) * ((((t * t) * t) * t) - 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
t = t - 2;
return((((-c) / 2) * ((((t * t) * t) * t) - 2)) + b);
}
}
Symbol 653 MovieClip [__Packages.gs.easing.Linear] Frame 0
class gs.easing.Linear
{
function Linear () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 654 MovieClip [__Packages.cerebral.cKit] Frame 0
class cerebral.cKit
{
function cKit () {
trace("cKit is an static class and should not be instantiated.");
}
static function blackIn(seconds) {
if (_root.dibujar == undefined) {
_root.createEmptyMovieClip("dibujar", 1);
_root.dibujar.lineStyle(0, 0, 100);
_root.dibujar.beginFill(0, 100);
_root.dibujar.moveTo(0, 0);
_root.dibujar.lineTo(0, Stage.height);
_root.dibujar.lineTo(Stage.width, Stage.height);
_root.dibujar.lineTo(Stage.width, 0);
_root.dibujar.lineTo(0, 0);
}
_root.dibujar._alpha = 0;
var _local2 = new mx.transitions.Tween(_root.dibujar, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, seconds, true);
_local2.onMotionFinished = function () {
cerebral.cKit.blackOut(seconds);
};
}
static function blackOut(seconds) {
if (_root.dibujar == undefined) {
_root.createEmptyMovieClip("dibujar", 1);
_root.dibujar.lineStyle(0, 0, 100);
_root.dibujar.beginFill(0, 100);
_root.dibujar.moveTo(0, 0);
_root.dibujar.lineTo(0, Stage.height);
_root.dibujar.lineTo(Stage.width, Stage.height);
_root.dibujar.lineTo(Stage.width, 0);
_root.dibujar.lineTo(0, 0);
}
_root.dibujar._alpha = 100;
var _local3 = new mx.transitions.Tween(_root.dibujar, "_alpha", mx.transitions.easing.Regular.easeOut, 100, 0, seconds, true);
var _local2 = 0;
while (_local2 < _root.__cKitIntervals.length) {
clearInterval(_root.__cKitIntervals[_local2]);
_local2++;
}
}
static function gotoLabel(label, seconds) {
blackIn(seconds);
_root.__cKitIntervals = new Array();
_root.__cKitIntervals.push(setInterval(_root, "gotoAndPlay", seconds * 1000, label));
}
static function fadeInSound(seconds) {
}
static function fadeOutSound(seconds) {
}
static function playSound(name) {
var _local1 = new Sound();
_local1.attachSound(name);
_local1.start(0, 0);
}
static function distance(obj1, obj2) {
var _local2 = obj1._x - obj2._x;
var _local1 = obj1._y - obj2._y;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
static function randomChoice(choices) {
return(choices[Math.floor(Math.random() * choices.length)]);
}
static function random(high, low) {
return(Math.floor(Math.random() * (high - low)) + low);
}
static function randomize(num, seed) {
var _local1 = ((Math.random() * seed) * 2) - seed;
return(Math.round(num + _local1));
}
}
Symbol 655 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 656 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 657 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 658 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 659 MovieClip [__Packages.gs.easing.Elastic] Frame 0
class gs.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / _2PI) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * _2PI) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / _2PI) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * _2PI) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / _2PI) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * _2PI) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * _2PI) / p)) * 0.5) + c) + b);
}
static var _2PI = (Math.PI*2);
}
Symbol 660 MovieClip [__Packages.Item] Frame 0
class Item extends MovieClip
{
function Item () {
super();
}
}
Symbol 661 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 662 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.35");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static function addLinkEvent(url, burl, btn, onClick) {
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
var _local3;
var _local2 = new LoadVars();
var timeout = 1500;
var t0 = getTimer();
var ping = this.createEmptyMovieClip("ping", 777);
this.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
delete this.ping;
getURL (url + s, "_blank");
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
delete this.ping;
getURL (burl, "_blank");
}
};
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
if (onClick != undefined) {
onClick();
}
};
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 663 MovieClip [__Packages.Music] Frame 0
class Music
{
var loopID;
function Music () {
loopID = "quiet";
}
function start() {
startNextLoop();
_root.objSounds.play("background-loop", 0, true);
}
function startNextLoop() {
_root.objSounds.play("loop_" + loopID);
_root.objSounds.sounds["loop_" + loopID].objMusic = this;
_root.objSounds.sounds["loop_" + loopID].onSoundComplete = function () {
this.objMusic.startNextLoop();
};
switch (loopID) {
case "quiet" :
loopID = "theme";
_root.objSounds.fadeTo("background-loop", 0, 2);
break;
case "main" :
loopID = "alternative";
_root.objSounds.fadeTo("background-loop", 30, 2);
break;
case "alternative" :
loopID = "main";
_root.objSounds.fadeTo("background-loop", 30, 2);
}
}
function setLoop(id) {
loopID = id;
}
}
Symbol 664 MovieClip [__Packages.gs.easing.Back] Frame 0
class gs.easing.Back
{
function Back () {
}
static function easeIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
}
Symbol 665 MovieClip [__Packages.Gromit] Frame 0
class Gromit extends MovieClip
{
var prevX, _x, game, frontWheelFactor, frontwheel, backWheelFactor, backwheel, onEnterFrame, gloveBase, truck, carriedItem, gromit;
function Gromit () {
super();
init();
}
function init() {
prevX = _x;
game = _root.game;
frontWheelFactor = (frontwheel._width * Math.PI) / 36;
backWheelFactor = (backwheel._width * Math.PI) / 36;
onEnterFrame = evtEnterFrame;
evtEnterFrame();
}
function evtEnterFrame() {
var _local3;
_local3 = _root.player.holderToLocal(gloveBase);
_local3.y = -_local3.y;
if (_local3.y < 1) {
_local3.y = 1;
}
if (_local3.y > truck._totalframes) {
_local3.y = truck._totalframes;
}
truck.gotoAndStop(Math.ceil(_local3.y));
_local3 = truck.arm.glovePoint.holderToLocal(_root.player);
_x = _x - _local3.x;
backwheel._rotation = _x * backWheelFactor;
frontwheel._rotation = _x * frontWheelFactor;
_local3 = truck.arm.glovePoint.holderToLocal(this);
carriedItem._x = _local3.x;
carriedItem._y = _local3.y;
var _local4 = _x - prevX;
if (_local4 < 0) {
gromit.gotoAndStop("back");
}
if (_local4 > 0) {
gromit.gotoAndStop("fore");
}
prevX = _x;
}
}
Symbol 666 MovieClip [__Packages.Wallace] Frame 0
class Wallace extends MovieClip
{
var game, idle, gotoAndStop;
function Wallace () {
super();
init();
}
function init() {
game = _root.game;
idle = true;
(gotoAndStop("idle"));// not popped
}
function playAnim(id) {
if (_root.marco._visible) {
return(false);
}
if (soundPlaying()) {
return(false);
}
if (!idle) {
return(undefined);
}
idle = false;
(gotoAndStop(id));// not popped
return(true);
}
function randomComment() {
var _local4;
var _local3;
var _local5 = _root.Maths.randomInt(1, 20);
switch (_local5) {
case 1 :
case 2 :
case 3 :
_local4 = "talklong";
_local3 = "come-on-boy-07";
break;
case 4 :
case 5 :
case 6 :
_local4 = "talklong";
_local3 = "all-this-hard-work-05";
break;
case 7 :
case 8 :
_local4 = "talkshort";
_local3 = "general-whistling-02";
break;
case 9 :
case 10 :
_local4 = "talkshort";
_local3 = "general-whistling-04";
break;
case 11 :
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
case 18 :
case 19 :
case 20 :
return(undefined);
default :
trace("randomComment: Unknown case " + _local5);
}
if (prevRandom == _local3) {
return(undefined);
}
prevRandom = _local3;
if (playAnim(_local4)) {
_root.objSounds.play(_local3);
}
}
function burningComment() {
var _local5;
var _local3;
var _local4 = _root.Maths.randomInt(1, 10);
switch (_local4) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
_local5 = "talklong";
_local3 = "can-you-smell-burning-01";
break;
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
_local5 = "talkshort";
_local3 = "gromit-fire-fire-03";
break;
default :
trace("burningComment: Unknown case " + _local4);
}
if (playAnim(_local5)) {
_root.objSounds.play(_local3);
}
}
function vanComment() {
var _local5;
var _local3;
var _local4 = _root.Maths.randomInt(1, 10);
switch (_local4) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
return(undefined);
case 7 :
case 8 :
_local5 = "talkshort";
_local3 = "keep-them-buns-coming-07";
break;
case 9 :
case 10 :
_local5 = "talklong";
_local3 = "more-bread-for-them-06";
break;
default :
trace("doughComment: Unknown case " + _local4);
}
if (prevVan == _local3) {
return(undefined);
}
prevVan = _local3;
if (playAnim(_local5)) {
_root.objSounds.play(_local3);
}
}
function doughComment() {
var _local4;
var _local3;
var _local5 = _root.Maths.randomInt(1, 12);
switch (_local5) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
return(undefined);
case 7 :
case 8 :
_local4 = "talkshort";
_local3 = "here-comes-another-batch-02";
break;
case 9 :
case 10 :
_local4 = "talklong";
_local3 = "the-more-the-merrier-06";
break;
case 11 :
case 12 :
_local4 = "talklong";
_local3 = "no-rest-for-the-wicked-06";
break;
default :
trace("doughComment: Unknown case " + _local5);
}
if (prevDough == _local3) {
return(undefined);
}
prevDough = _local3;
if (playAnim(_local4)) {
_root.objSounds.play(_local3);
}
}
function soundPlaying() {
if (_root.objSounds.sounds["all-this-hard-work-05"].playing) {
return(true);
}
if (_root.objSounds.sounds["can-you-smell-burning-01"].playing) {
return(true);
}
if (_root.objSounds.sounds["come-on-boy-07"].playing) {
return(true);
}
if (_root.objSounds.sounds["general-whistling-02"].playing) {
return(true);
}
if (_root.objSounds.sounds["general-whistling-04"].playing) {
return(true);
}
if (_root.objSounds.sounds["gromit-fire-fire-03"].playing) {
return(true);
}
if (_root.objSounds.sounds["here-comes-another-batch-02"].playing) {
return(true);
}
if (_root.objSounds.sounds["keep-them-buns-coming-07"].playing) {
return(true);
}
if (_root.objSounds.sounds["more-bread-for-them-06"].playing) {
return(true);
}
if (_root.objSounds.sounds["no-rest-for-the-wicked-06"].playing) {
return(true);
}
if (_root.objSounds.sounds["phew-04"].playing) {
return(true);
}
if (_root.objSounds.sounds["phew-06"].playing) {
return(true);
}
if (_root.objSounds.sounds["the-more-the-merrier-06"].playing) {
return(true);
}
return(false);
}
function lifeAnim() {
var _local4;
var _local3 = _root.Maths.randomInt(1, 18);
switch (_local3) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
_local4 = "eyes-move";
break;
case 7 :
case 8 :
case 9 :
case 10 :
case 11 :
_local4 = "eyes-head-move";
break;
case 12 :
case 13 :
if (playAnim("newspaper") && (_root.Maths.randomNum(1, 100) > 75)) {
_root.objSounds.play("phew");
}
return(undefined);
case 14 :
case 15 :
if (playAnim("shocked") && (_root.Maths.randomNum(1, 100) > 60)) {
_root.objSounds.play("phew");
}
return(undefined);
case 16 :
case 17 :
case 18 :
return(randomComment());
default :
trace("lifeAnim: Unknown case " + _local3);
}
playAnim(_local4);
}
var prevVan = "";
var prevDough = "";
var prevRandom = "";
}
Symbol 667 MovieClip [__Packages.Smoke] Frame 0
class Smoke extends MovieClip
{
var game, frame, smokeRect, objPE, smokeHolder, objGE, ovenA, smoke_ba, smoke_bb, smoke_bc, smoke_bd, amount_ba, amount_bb, amount_bc, amount_bd, ovenB, ovenC, ovenD, onEnterFrame;
function Smoke () {
super();
init();
}
function init() {
game = _root.game;
frame = 0;
var _local3 = smokeRect;
_local3._visible = false;
objPE = new _root.ParticleEngine(smokeHolder, new flash.geom.Rectangle(0, 0, _local3._width, _local3._height));
objGE = addGenerator(ovenA);
smoke_ba = false;
smoke_bb = false;
smoke_bc = false;
smoke_bd = false;
amount_ba = 0;
amount_bb = 0;
amount_bc = 0;
amount_bd = 0;
ovenA._visible = false;
ovenB._visible = false;
ovenC._visible = false;
ovenD._visible = false;
onEnterFrame = evtEnterFrame;
}
function evtEnterFrame() {
frame++;
if (smoke_ba) {
amount_ba++;
if (timeForParticle(amount_ba)) {
objGE.x = ovenA._x;
objGE.y = ovenA._y;
objGE.generateParticles();
}
} else {
amount_ba = 0;
}
if (smoke_bb) {
amount_bb++;
if (timeForParticle(amount_bb)) {
objGE.x = ovenB._x;
objGE.y = ovenB._y;
objGE.generateParticles();
}
} else {
amount_bb = 0;
}
if (smoke_bc) {
amount_bc++;
if (timeForParticle(amount_bc)) {
objGE.x = ovenC._x;
objGE.y = ovenC._y;
objGE.generateParticles();
}
} else {
amount_bc = 0;
}
if (smoke_bd) {
amount_bd++;
if (timeForParticle(amount_bd)) {
objGE.x = ovenD._x;
objGE.y = ovenD._y;
objGE.generateParticles();
}
} else {
amount_bd = 0;
}
objGE.tailEffect();
}
function timeForParticle(amount) {
if (amount < 40) {
return(false);
}
if (amount < 60) {
return((((frame % 10) == 0) ? true : false));
}
if (amount < 80) {
return((((frame % 7) == 0) ? true : false));
}
if (amount < 100) {
return((((frame % 5) == 0) ? true : false));
}
if (amount < 120) {
return((((frame % 4) == 0) ? true : false));
}
if (amount < 140) {
return((((frame % 3) == 0) ? true : false));
}
if (amount < 160) {
return((((frame % 2) == 0) ? true : false));
}
if ((amount % 200) == 0) {
_root.wallace.burningComment();
}
return(true);
}
function addGenerator(clip) {
var _local3 = new _root.ParticleGenerator(clip._x, clip._y, 0, -0.1, 1, 1, false, _root.makeLifespanGravityParticle, undefined, "particleSmokeTail", objPE);
_local3.vxMin = -0.5;
_local3.vxMax = 0.5;
_local3.vyMin = -1;
_local3.vyMax = -0.1;
_local3.dxMin = (-clip._width) / 2;
_local3.dxMax = clip._width / 2;
_local3.dyMin = 0;
_local3.dyMax = 0;
_local3.scaleMin = 10;
_local3.scaleMax = 30;
_local3.vrMin = 3;
_local3.vrMax = 5;
_local3.scaleMultMin = 1;
_local3.scaleMultMax = 1.03;
_local3.growFrames = 15;
_local3.colourMatrix = new Array();
_local3.colourMatrix = _local3.colourMatrix.concat([0.4, 0, 0, 0, 0]);
_local3.colourMatrix = _local3.colourMatrix.concat([0, 0.4, 0, 0, 0]);
_local3.colourMatrix = _local3.colourMatrix.concat([0, 0, 0.4, 0, 0]);
_local3.colourMatrix = _local3.colourMatrix.concat([0, 0, 0, 0.97, 0]);
_local3.filter = new flash.filters.ColorMatrixFilter(_local3.colourMatrix);
_local3.paint = _root.simpleFadePaint;
_local3.tailEffect = _root.explosionFade;
_local3.glowFilter = new flash.filters.GlowFilter(16777215, 100, 20, 20, 1, 1, false, true);
_local3.checkLifeOver = _root.lifespanTest;
_local3.particleLifespan = 50;
return(_local3);
}
}
Symbol 31 MovieClip [auto] Frame 1
#initclip 29
Object.registerClass("auto", Car);
#endinitclip
Symbol 74 MovieClip Frame 1
stop();
Symbol 104 Button
on (release) {
addAccion();
}
on (rollOver) {
this.filters = [new flash.filters.GlowFilter(Aardman.rolloverGlowColour, Aardman.rolloverGlowAlpha, Aardman.rolloverGlowBlur, Aardman.rolloverGlowBlur, Aardman.rolloverGlowStrength, Aardman.rolloverGlowQuality)];
}
on (rollOut, dragOut) {
this.filters = [];
}
Symbol 106 MovieClip Frame 1
this._visible = false;
Symbol 111 MovieClip [bomba] Frame 1
#initclip 27
Object.registerClass("bomba", Bomba);
#endinitclip
Symbol 122 MovieClip [item] Frame 1
#initclip 28
Object.registerClass("item", Item);
#endinitclip
stop();
gotoAndStop(_parent._parent.item);
Symbol 129 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 157 Button
on (release) {
_root.gotoAndStop("play");
}
Symbol 158 Button
on (release) {
play();
}
Symbol 159 MovieClip Frame 26
stop();
Symbol 159 MovieClip Frame 45
_root.gotoAndStop("play");
Symbol 176 MovieClip Frame 1
_visible = false;
btnItem._alpha = 0;
Instance of Symbol 175 MovieClip "btnItem" in Symbol 176 MovieClip Frame 1
on (release) {
_root.game.cola.addAccion("walkItem", _parent);
}
on (rollOver) {
_parent.filters = [new flash.filters.GlowFilter(Aardman.rolloverGlowColour, Aardman.rolloverGlowAlpha, Aardman.rolloverGlowBlur, Aardman.rolloverGlowBlur, Aardman.rolloverGlowStrength, Aardman.rolloverGlowQuality)];
}
on (rollOut) {
_parent.filters = [];
}
Symbol 197 MovieClip [smoke] Frame 1
#initclip 32
Object.registerClass("smoke", Smoke);
#endinitclip
Symbol 222 MovieClip Frame 1
stop();
Symbol 223 MovieClip [gromit] Frame 1
#initclip 30
Object.registerClass("gromit", Gromit);
#endinitclip
Symbol 231 Button
on (release) {
_root.game.cola.addAccion("walkCaja", this);
}
on (rollOver) {
this.filters = [new flash.filters.GlowFilter(Aardman.rolloverGlowColour, Aardman.rolloverGlowAlpha, Aardman.rolloverGlowBlur, Aardman.rolloverGlowBlur, Aardman.rolloverGlowStrength, Aardman.rolloverGlowQuality)];
}
on (rollOut) {
this.filters = [];
}
Symbol 235 MovieClip Frame 1
stop();
this.doorsOpen = false;
Symbol 235 MovieClip Frame 11
_root.objSounds.play("van-door-open");
this.filters = [];
Symbol 235 MovieClip Frame 16
stop();
Symbol 235 MovieClip Frame 25
_root.objSounds.play("van-door-close-2");
Symbol 235 MovieClip Frame 26
gotoAndStop ("idle");
Symbol 257 MovieClip Frame 70
_parent.lifeAnim();
Symbol 263 MovieClip Frame 21
_parent.gotoAndStop("idle");
Symbol 272 MovieClip Frame 14
_parent.gotoAndStop("idle");
Symbol 323 MovieClip Frame 70
_parent.gotoAndStop("idle");
Symbol 386 MovieClip Frame 93
_parent.gotoAndStop("idle");
Symbol 387 MovieClip Frame 106
_parent.gotoAndStop("idle");
Symbol 444 MovieClip Frame 1
_root.objSounds.play("newspaper-turn-single-page-05");
Symbol 444 MovieClip Frame 28
_parent.gotoAndStop("idle");
Symbol 487 MovieClip Frame 1
_root.objSounds.play("newspaper-turn-single-page-03");
Symbol 487 MovieClip Frame 27
_parent.gotoAndStop("idle");
Symbol 488 MovieClip [wallace] Frame 1
#initclip 31
Object.registerClass("wallace", Wallace);
#endinitclip
this.idle = true;
Symbol 497 Button
on (release) {
_root.game.iniciar();
btnStart.enabled = false;
}
Symbol 505 MovieClip Frame 1
txtGoal.htmlText = _root.game.levelGoalTxt;
Symbol 527 Button
on (release) {
endGame();
btnEnd.enabled = false;
}
Symbol 529 Button
on (release) {
gotoAndPlay ("upgrades");
}
Symbol 531 Button
on (release) {
_root.game.retryLevel();
gotoAndStop ("reset");
}
Symbol 533 Button
on (release) {
gotoAndStop ("final");
}
Symbol 553 Button
on (release) {
getURL ("http://www.wallaceandgromit.com/films/loafanddeath/trailer.html", "_blank");
}
Symbol 566 Button
on (release) {
compra("ba");
}
Symbol 567 Button
on (release) {
compra("bb");
}
Symbol 568 Button
on (release) {
compra("bc");
}
Symbol 569 Button
on (release) {
compra("bd");
}
Symbol 570 Button
on (release) {
compra("speed");
}
Symbol 571 Button
on (release) {
compra("wash");
}
Symbol 573 Button
on (release) {
gotoAndStop(_root.game.levelNumber + 1);
}
Symbol 600 Button
on (release) {
endGame();
btnEndGame.enabled = false;
}
Symbol 602 Button
on (release) {
submitScore();
btnSubmitScore.enabled = false;
}
Symbol 608 Button
on (release) {
getURL ("http://www.wallaceandgromit.com/films/loafanddeath/trailer.html", "_blank");
}
Symbol 615 MovieClip Frame 1
modalBlocker.onRelease = function () {
};
modalBlocker.useHandCursor = false;
stop();
Symbol 615 MovieClip Frame 21
function showStep(num) {
if (num == 0) {
myClients = _root.game.levelCars;
} else if (num == 1) {
myGoal = _root.prevLevelGoal;
} else if (num == 2) {
myMoney = _root.game.levelMoney;
} else if (num == 3) {
myScore = _root.game.levelScore;
} else if (num == 4) {
_root.game.totalScore = _root.game.totalScore + _root.game.levelScore;
myTotalScore = _root.game.totalScore;
}
Aardman.updateScore();
}
function mostrarBotones() {
if (_root.game.levelNumber > 7) {
btnFinish._visible = true;
} else {
btnEnd._visible = true;
btnNext._visible = true;
}
}
function gotoFinal() {
gotoAndStop ("final");
}
function endGame() {
_root.gotoAndPlay("menu");
}
btnEnd._visible = false;
btnNext._visible = false;
btnRetry._visible = false;
btnFinish._visible = false;
txt.failed._visible = false;
stop();
gs.TweenLite.delayedCall(0.3, showStep, [0], this);
gs.TweenLite.delayedCall(0.6, showStep, [1], this);
gs.TweenLite.delayedCall(0.9, showStep, [2], this);
gs.TweenLite.delayedCall(1.2, showStep, [3], this);
gs.TweenLite.delayedCall(1.5, showStep, [4], this);
gs.TweenLite.delayedCall(1.8, mostrarBotones, [], this);
myClients = "";
myGoal = "";
myMoney = "";
myScore = "";
myTotalScore = "";
Symbol 615 MovieClip Frame 31
function showStep(num) {
if (num == 0) {
myClients = _root.game.levelCars;
} else if (num == 1) {
myGoal = _root.prevLevelGoal;
} else if (num == 2) {
myMoney = _root.game.levelMoney;
} else if (num == 3) {
myScore = _root.game.levelScore;
} else if (num == 4) {
_root.game.totalScore = _root.game.totalScore + _root.game.levelScore;
myTotalScore = _root.game.totalScore;
}
Aardman.updateScore();
}
function mostrarFail() {
btnEnd._visible = true;
txt.failed._visible = true;
btnRetry._visible = true;
}
function gotoFinal() {
gotoAndStop ("final");
}
function endGame() {
_root.gotoAndPlay("menu");
}
btnEnd._visible = false;
btnNext._visible = false;
btnRetry._visible = false;
btnFinish._visible = false;
txt.failed._visible = false;
stop();
gs.TweenLite.delayedCall(0.3, showStep, [0], this);
gs.TweenLite.delayedCall(0.6, showStep, [1], this);
gs.TweenLite.delayedCall(0.9, showStep, [2], this);
gs.TweenLite.delayedCall(1.2, showStep, [3], this);
gs.TweenLite.delayedCall(1.5, showStep, [4], this);
gs.TweenLite.delayedCall(1.8, mostrarFail, [], this);
myClients = "";
myGoal = "";
myMoney = "";
myScore = "";
myTotalScore = "";
Symbol 615 MovieClip Frame 41
function alcanza(plata) {
if ((_root.game.dinero - plata) >= 0) {
return(true);
}
return(false);
}
function compra(cosa) {
if (cosa == "ba") {
_root.game.dinero = _root.game.dinero - prec_bomba[_root.ovenHolder.ba.nivel - 1];
_root.ovenHolder.ba.nivel++;
_root.ovenHolder.ba.init();
} else if (cosa == "bb") {
_root.game.dinero = _root.game.dinero - prec_bomba[_root.ovenHolder.bb.nivel - 1];
_root.ovenHolder.bb.nivel++;
_root.ovenHolder.bb.init();
} else if (cosa == "bc") {
_root.game.dinero = _root.game.dinero - prec_bomba[_root.ovenHolder.bc.nivel - 1];
_root.ovenHolder.bc.nivel++;
_root.ovenHolder.bc.init();
} else if (cosa == "bd") {
_root.game.dinero = _root.game.dinero - prec_bomba[_root.ovenHolder.bd.nivel - 1];
_root.ovenHolder.bd.nivel++;
_root.ovenHolder.bd.init();
} else if (cosa == "speed") {
_root.game.dinero = _root.game.dinero - prec_speed[_root.game.speedLevel - 1];
_root.game.speedLevel++;
_root.game.setVelocidad();
} else if (cosa == "wash") {
_root.game.dinero = _root.game.dinero - prec_cw;
_root.game.carWash = true;
Aardman.setupFridge(true);
}
_root.objSounds.play("bread-done");
checkUpgrades();
}
function checkUpgrades() {
txtSpend.text = _root.game.dinero;
mc_ba.txtTitle.text = "OVEN #1";
mc_bb.txtTitle.text = "OVEN #2";
mc_bc.txtTitle.text = "OVEN #3";
mc_bd.txtTitle.text = "OVEN #4";
mc_ba.gotoAndStop(_root.ovenHolder.ba.nivel);
if (!alcanza(prec_bomba[_root.ovenHolder.ba.nivel - 1])) {
buy_ba._alpha = 30;
buy_ba.enabled = false;
}
if (_root.ovenHolder.ba.nivel >= 3) {
mc_ba._alpha = 30;
buy_ba._visible = false;
}
if (_root.ovenHolder.bb == undefined) {
mc_bb._visible = false;
buy_bb._visible = false;
} else {
mc_bb.gotoAndStop(_root.ovenHolder.bb.nivel);
if (!alcanza(prec_bomba[_root.ovenHolder.bb.nivel - 1])) {
buy_bb._alpha = 30;
buy_bb.enabled = false;
}
if (_root.ovenHolder.bb.nivel >= 3) {
mc_bb._alpha = 30;
buy_bb._visible = false;
}
}
if (_root.ovenHolder.bc == undefined) {
mc_bc._visible = false;
desc_bc._visible = false;
buy_bc._visible = false;
} else {
mc_bc.gotoAndStop(_root.ovenHolder.bc.nivel);
if (!alcanza(prec_bomba[_root.ovenHolder.bc.nivel - 1])) {
buy_bc._alpha = 30;
buy_bc.enabled = false;
}
if (_root.ovenHolder.bc.nivel >= 3) {
mc_bc._alpha = 30;
buy_bc._visible = false;
}
}
if (_root.ovenHolder.bd == undefined) {
mc_bd._visible = false;
desc_bd._visible = false;
buy_bd._visible = false;
} else {
mc_bd.gotoAndStop(_root.ovenHolder.bd.nivel);
if (!alcanza(prec_bomba[_root.ovenHolder.bd.nivel - 1])) {
buy_bd._alpha = 30;
buy_bd.enabled = false;
}
if (_root.ovenHolder.bd.nivel >= 3) {
mc_bd._alpha = 30;
buy_bd._visible = false;
}
}
mc_speed.gotoAndStop(_root.game.speedLevel);
if (!alcanza(prec_speed[_root.game.speedLevel - 1])) {
buy_speed._alpha = 30;
buy_speed.enabled = false;
}
if (_root.game.speedLevel > 3) {
mc_speed._alpha = 30;
buy_speed._visible = false;
}
if (!_root.game.carWash) {
if (!alcanza(prec_cw)) {
buy_wash._alpha = 30;
buy_wash.enabled = false;
}
} else {
mc_wash._alpha = 30;
buy_wash._visible = false;
}
}
stop();
prec_speed = [150, 200, 380];
prec_cw = 400;
prec_bomba = [180, 250];
checkUpgrades();
Symbol 615 MovieClip Frame 51
function submitScore() {
btnEndGame._visible = false;
btnSubmitScore._visible = false;
var _local2 = {boardID:_root.boardID, score:myTotalScore, res:"640x480", onClose:function () {
endGame();
}};
mochi.MochiScores.showLeaderboard(_local2);
gotoAndStop ("submitscore");
}
Symbol 636 Button
on (release) {
_root.objSounds.setMute(true);
gotoAndStop ("muted");
}
Symbol 639 Button
on (release) {
_root.objSounds.setMute(false);
_root.music.start();
gotoAndStop ("sound_on");
}
Symbol 640 MovieClip Frame 1
stop();
Symbol 641 MovieClip Frame 11
stop();