Frame 1
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes - loaded_bytes;
percent_done = int((loaded_bytes / total_bytes) * 100);
_root.showperc = percent_done + "%";
bar.gotoAndStop(percent_done);
if (remaining_bytes <= 0) {
gotoAndStop (4);
}
Frame 3
gotoAndPlay (1);
_root.qual = 1;
Frame 4
stop();
Frame 5
stop();
Frame 6
function init() {
var _local1 = _root;
engine.copyInstanceNames(this);
initGame();
engine.compile();
engine.render(this);
startGame();
_local1.sides._alpha = 100;
_local1.scoreboard._alpha = 100;
_local1.sb._alpha = 100;
_local1.goalkeeper._alpha = 100;
}
function initGame() {
var _local3 = _root;
inactiveBalls = [ball1, ball2, ball3, ball4];
for (var _local1 in inactiveBalls) {
inactiveBalls[_local1].enabled = false;
}
hole.addListener({onEnter:function (eo) {
ballLost(eo.movableObject);
}});
topRamp.addListener({onUpperLevel:function (eo) {
eo.movableObject.mc.swapDepths(upperDepthDummy.zIndex);
}});
var _local2 = {onUpperLevel:function (eo) {
eo.movableObject.mc.swapDepths(upperDepthDummy.zIndex);
}, onLowerLevel:function (eo) {
eo.movableObject.mc.swapDepths(lowerDepthDummy.zIndex);
}};
ramp1.addListener(_local2);
ramp2.addListener(_local2);
ballLostSound = new Sound();
ballLostSound.attachSound("loose");
Defender1Rebound = new ReboundSystem(def1area, def1area, [def1, def1]);
Defender2Rebound = new ReboundSystem(def2area, def2area, [def2, def2]);
Defender3Rebound = new ReboundSystem(def3area, def3area, [def3, def3]);
Defender4Rebound = new ReboundSystem(def4area, def4area, [def4, def4]);
tgroup1 = new TargetGroup(targetGroup1);
tgroup2 = new TargetGroup(targetGroup2);
tgroup1.onComplete = function () {
gameSound.stop();
tgroup1.setState(true);
Defender1Rebound.open();
Defender2Rebound.open();
Defender3Rebound.open();
Defender4Rebound.open();
};
tgroup2.onComplete = function () {
_root.score = _root.score + 2000;
tgroup2.setState(true);
};
hideOut1.addListener({onHoldBall:function () {
Defender1Rebound.open();
Defender2Rebound.open();
Defender3Rebound.open();
Defender4Rebound.open();
tellTarget (_root.goalkeeper) {
gotoAndStop (2);
};
newBall();
}});
}
function startGame() {
ballNum = 1;
gamePoints = 0;
engine.start();
newBall();
Defender1Rebound.open();
Defender2Rebound.open();
Defender3Rebound.open();
Defender4Rebound.open();
}
function stopGame() {
engine.stop();
}
function newBall() {
var _local1 = inactiveBalls.shift();
bposx = _root.ballposition._x;
bposy = _root.ballposition._y;
_local1.position = new Vector(bposx, bposy);
_local1.velocity = new Vector(0, 0);
_local1.setEnabled(true);
_local1.level = 1;
_local1.mc.swapDepths(lowerDepthDummy.zIndex);
}
function ballLost(b) {
var _local1 = _root;
var _local2 = b;
tellTarget (_local1.goalkeeper) {
gotoAndStop (1);
};
Defender1Rebound.open();
Defender2Rebound.open();
Defender3Rebound.open();
Defender4Rebound.open();
_local2.position = _local2.initPosition.clone();
_local2.setEnabled(false);
_local2.onAfterStepPhysics();
inactiveBalls.push(_local2);
if (hideOut1.occupied) {
hideOut1.releaseBall();
} else if (ballNum == 4) {
stopGame();
_local1.qual = 1;
_local1.qqq.qu.gotoAndStop("qual" + _local1.qual);
stopAllSounds();
ballLostSound.start();
endSound = new Sound(this);
endSound.attachSound("endsound");
endSound.start(0, 1);
_local1.scr = "SCORE: " + _local1.score;
_local1.endgame._visible = 1;
} else {
ballNum++;
newBall();
Defender1Rebound.open();
Defender2Rebound.open();
Defender3Rebound.open();
Defender4Rebound.open();
ballLostSound.start();
}
}
function ReboundSystem(inner, outer, door) {
var _local1 = this;
_local1.inner = inner;
_local1.outer = outer;
_local1.door = door;
var _local2 = new Object();
_local2.parent = _local1;
_local2.onEnter = function () {
this.parent.open();
this.parent.openSound.start();
};
_local1.inner.addListener(_local2);
_local2 = new Object();
_local2.parent = _local1;
_local2.onExit = function (eo) {
var _local1 = eo.movableObject;
if (_local1.position.y < outer.position.y) {
this.parent.close();
}
};
_local1.outer.addListener(_local2);
}
function TargetGroup(group, autoReset) {
var _local1 = this;
var _local2 = group;
_local1.group = _local2;
_local1.autoReset = autoReset;
_local2.target1.addListener(_local1);
_local2.target2.addListener(_local1);
_local1.setState(true);
}
function onEnterFrame() {
var _local1 = _root;
_local1.showscore = _local1.score;
x = length(_local1.score);
while (x < 10) {
x++;
_local1.showscore = "0" + _local1.showscore;
}
_local1.ballsleft = 4 - _local1.ballNum;
}
_global.ICE = new Object();
o = (_global.ASBroadcaster = new Object());
o._broadcastMessage = function () {
var _local3 = arguments;
var _local1 = this._listeners.concat();
var _local2 = _local3.shift();
for (var i in _local1) {
_local1[i][_local2].apply(_local1[i], _local3);
}
};
o.addListener = function (obj) {
var _local3 = obj;
var _local1 = this._listeners;
var _local2 = _local1.length;
_local1[-1] = _local3;
_local2--;
while (_local1[_local2] != _local3) {
}
delete _local1[-1];
if (_local2 < 0) {
_local1.unshift(_local3);
this.broadcastMessage = ASBroadcaster._broadcastMessage;
return(true);
}
return(false);
};
o.removeListener = function (obj) {
var _local3 = obj;
var _local1 = this._listeners;
var _local2 = _local1.length;
_local1[-1] = _local3;
_local2--;
while (_local1[_local2] != _local3) {
}
delete _local1[-1];
if (_local2 >= 0) {
_local1.splice(_local2, 1);
if (_local1.length == 0) {
this.broadcastMessage = undefined;
}
return(true);
}
return(false);
};
o.initialize = function (obj) {
var _local1 = obj;
_local1.broadcastMessage = undefined;
_local1.addListener = ASBroadcaster.addListener;
_local1.removeListener = ASBroadcaster.removeListener;
_local1._listeners = [];
AsSetPropFlags(_local1, "broadcastMessage,addListener,removeListener,_listeners", 131);
};
ASSetPropFlags(o, null, 131);
delete o;
if (!$moveTo) {
var p = MovieClip.prototype;
p._xpen = (p._ypen = (p._xpenStart = (p._ypenStart = 0)));
p.$moveTo = p.moveTo;
p.moveTo = function (x, y) {
var _local1 = this;
_local1.$moveTo(x, y);
_local1._xpen = (_local1._xpenStart = x);
_local1._ypen = (_local1._ypenStart = y);
};
p.$lineTo = p.lineTo;
p.lineTo = function (x, y) {
var _local1 = this;
_local1.$lineTo(x, y);
_local1._xpen = x;
_local1._ypen = y;
};
p.$curveTo = p.curveTo;
p.curveTo = function (cx, cy, ax, ay) {
var _local1 = this;
_local1.$curveTo(cx, cy, ax, ay);
_local1._xpen = ax;
_local1._ypen = ay;
};
p.$clear = p.clear;
p.clear = function () {
var _local1 = this;
_local1.$clear();
_local1._xpen = (_local1._ypen = (_local1._xpenStart = (_local1._ypenStart = 0)));
};
p.drawLine = function (x1, y1, x2, y2) {
this.moveTo(x1, y1);
this.lineTo(x2, y2);
};
p.drawTri = function (p1, p2, p3) {
with (this) {
moveTo(p1.x, p1.y);
lineTo(p2.x, p2.y);
lineTo(p3.x, p3.y);
lineTo(p1.x, p1.y);
}
};
p.drawQuad = function (p1, p2, p3, p4) {
with (this) {
moveTo(p1.x, p1.y);
lineTo(p2.x, p2.y);
lineTo(p3.x, p3.y);
lineTo(p4.x, p4.y);
lineTo(p1.x, p1.y);
}
};
p.drawRect = function (x1, y1, x2, y2) {
with (this) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
};
p.drawRectRel = function (x, y, width, height) {
this.drawRect(x, y, x + width, y + height);
};
p.drawRectCenter = function (x, y, w, h) {
this.drawRect(x - (w / 2), y - (h / 2), x + (w / 2), y + (h / 2));
};
p.drawSquare = function (x, y, width) {
this.drawRect(x, y, x + width, y + width);
};
p.drawSquareCent = function (x, y, width) {
var _local1 = width / 2;
this.drawRect(x - _local1, y - _local1, x + _local1, y + _local1);
};
p.drawDot = function (x, y) {
this.drawRect(x - 0.5, y - 0.5, x + 0.5, y + 0.5);
};
p.drawPoly = function (pts) {
var _local2 = pts;
var _local3 = this;
_local3.moveTo(_local2[0].x, _local2[0].y);
var _local1 = _local2.length;
while (_local1--) {
_local3.lineTo(_local2[_local1].x, _local2[_local1].y);
}
};
p.drawRegPoly = function (x, y, radius, numPts, rotation) {
var _local1 = rotation;
var pts = [];
var _local3;
var _local2;
var dAngle = ((Math.PI*2) / numPts);
var cos = Math.cos;
var sin = Math.sin;
while (numPts--) {
_local1 = _local1 + dAngle;
_local3 = (radius * cos(_local1)) + x;
_local2 = (radius * sin(_local1)) + y;
pts.push({x:_local3, y:_local2});
}
this.drawPoly(pts);
};
p.drawOval = function (x, y, rx, ry) {
var _local1 = y;
var _local2 = x;
var _local3 = rx;
this.moveTo(_local2 + _local3, _local1);
this.curveTo(_local3 + _local2, (0.4142 * ry) + _local1, (0.7071 * _local3) + _local2, (0.7071 * ry) + _local1);
this.curveTo((0.4142 * _local3) + _local2, ry + _local1, _local2, ry + _local1);
this.curveTo((-0.4142 * _local3) + _local2, ry + _local1, (-0.7071 * _local3) + _local2, (0.7071 * ry) + _local1);
this.curveTo((-_local3) + _local2, (0.4142 * ry) + _local1, (-_local3) + _local2, _local1);
this.curveTo((-_local3) + _local2, (-0.4142 * ry) + _local1, (-0.7071 * _local3) + _local2, (-0.7071 * ry) + _local1);
this.curveTo((-0.4142 * _local3) + _local2, (-ry) + _local1, _local2, (-ry) + _local1);
this.curveTo((0.4142 * _local3) + _local2, (-ry) + _local1, (0.7071 * _local3) + _local2, (-0.7071 * ry) + _local1);
this.curveTo(_local3 + _local2, (-0.4142 * ry) + _local1, _local3 + _local2, _local1);
};
p.drawCircle = function (x, y, r) {
this.drawOval(x, y, r, r);
};
p.arcTo = function (s, e, r) {
var res = 10;
var fill = (e - s);
var steps = (Math.abs(Math.ceil(fill / ((Math.PI*2) / res))) + 1);
var _local3 = fill / steps;
var r2 = (r / Math.cos(_local3 / 2));
var x = (this._xpen - (Math.cos(s) * r));
var y = (this._ypen - (Math.sin(s) * r));
var _local2 = 1;
while (_local2 <= steps) {
var _local1 = s + (_local2 * _local3);
this.curveTo((Math.cos(_local1 - (_local3 / 2)) * r2) + x, (Math.sin(_local1 - (_local3 / 2)) * r2) + y, (Math.cos(_local1) * r) + x, (Math.sin(_local1) * r) + y);
_local2++;
}
};
p.drawArc = function (x, y, s, e, r) {
var _local1 = s;
var _local2 = r;
this.moveTo(x + (Math.cos(_local1) * _local2), y + (Math.sin(_local1) * _local2));
this.arcTo(_local1, e, _local2);
};
ASSetPropFlags(p, null, 1);
}
_global.Function.prototype.as1_extends = function (superclassString) {
var _local1 = this;
_local1.prototype.__proto__ = superclassString.prototype;
_local1.prototype.__constructor__ = superclassString;
ASSetPropFlags(_local1.prototype, "__constructor__", 1);
return(_local1.prototype);
};
_global.getDistance = function (v1, v2) {
return(v1.clone().minus(v2).getLength());
};
_global.getAngle = function (v1, v2) {
return(Math.atan2(v1.y - v2.y, v1.x - v2.x));
};
_global.fixAngle = function (a) {
var _local1 = a;
while (_local1 < 0) {
_local1 = _local1 + (Math.PI*2);
}
while (_local1 > (Math.PI*2)) {
_local1 = _local1 - (Math.PI*2);
}
return(_local1);
};
ASBroadcaster.initialize(MovieClip);
_root.createEmptyMovieClip("onEnterFrameBraodcaster", 99999).onEnterFrame = function () {
MovieClip.broadcastMessage("onEnterFrame");
};
XMLNode.prototype.__resolve = function (name) {
var _local1 = this;
var _local2 = name;
for (var _local3 in _local1.childNodes) {
if (_local1.childNodes[_local3].nodeName == _local2) {
return(_local1.childNodes[_local3]);
}
}
return(undefined);
};
XML.prototype.ignoreWhite = true;
var c = ((_global.Vector = function (x, y) {
this.reset(x, y);
}));
var p = ((c.prototype = new Object()));
Object.registerclassString("Vector", Vector);
c.max = function (v1, v2) {
return(new Vector(Math.max(v1.x, v2.x), Math.max(v1.y, v2.y)));
};
c.min = function (v1, v2) {
return(new Vector(Math.min(v1.x, v2.x), Math.min(v1.y, v2.y)));
};
p.toString = function () {
return((this.x + ",") + this.y);
};
p.reset = function (x, y) {
var _local1 = this;
_local1.x = x;
_local1.y = y;
return(_local1);
};
p.clone = function () {
return(new Vector(this.x, this.y));
};
p.plus = function (v) {
var _local1 = this;
_local1.x = _local1.x + v.x;
_local1.y = _local1.y + v.y;
return(_local1);
};
p.minus = function (v) {
var _local1 = this;
_local1.x = _local1.x - v.x;
_local1.y = _local1.y - v.y;
return(_local1);
};
p.scale = function (s) {
var _local1 = this;
_local1.x = _local1.x * s;
_local1.y = _local1.y * s;
return(_local1);
};
p.getLength = function () {
var _local1 = this;
return(Math.sqrt((_local1.x * _local1.x) + (_local1.y * _local1.y)));
};
p.setLength = function (len) {
var _local2 = this;
var _local1 = _local2.getLength();
if (_local1) {
_local2.scale(len / _local1);
} else {
_local2.x = len;
}
return(_local2);
};
p.getAngle = function () {
return(Math.atan2(this.y, this.x));
};
p.setAngle = function (ang) {
var _local2 = this;
var _local1 = _local2.getLength();
_local2.x = _local1 * Math.cos(ang);
_local2.y = _local1 * Math.sin(ang);
return(_local2);
};
p.rotate = function (ang) {
var _local1 = this;
var _local3 = Math.cos(ang);
var _local2 = Math.sin(ang);
var rx = ((_local1.x * _local3) - (_local1.y * _local2));
_local1.y = (_local1.x * _local2) + (_local1.y * _local3);
_local1.x = rx;
return(_local1);
};
p.rotateAround = function (p, a) {
var _local1 = this;
_local1.minus(p);
_local1.rotate(a);
_local1.plus(p);
return(_local1);
};
p.reverse = function () {
this.x = this.x * -1;
this.y = this.y * -1;
};
var c = ((ICE.PhysicsObject = function (x, y) {
var _local1 = this;
_local1.position = ((x == null) ? (_local1.position.clone()) : (new Vector(x, y)));
_local1.velocity = _local1.velocity.clone();
_local1.id = ICE.PhysicsObject.uid++;
ASBroadcaster.initialize(_local1);
}));
var p = c.as1_extends(Object);
c.uid = 0;
p.name = "";
p.position = new Vector(0, 0);
p.velocity = new Vector(0, 0);
p.bounceFriction = 0.2;
p.slidingFriction = 0.02;
p.useDefaultBounds = true;
p.autoRender = true;
p.fillColor = 6710886 /* 0x666666 */;
p.fillAlpha = 100;
p.lineWidth = undefined;
p.lineColor = 0;
p.lineAlpha = 100;
p.useSymbol = false;
p.symbolID = "";
p.symbolXScale = 100;
p.symbolYScale = 100;
p.symbolRotation = 0;
p.symbolAlpha = 100;
p.render = function (mc) {
var _local1 = this;
_local1.mc = mc.createEmptyMovieClip("physicsObject_" + _local1.id, _local1.zIndex);
_local1.mc._x = _local1.position.x;
_local1.mc._y = _local1.position.y;
_local1.mc.obj = _local1;
_local1._render(_local1.mc);
};
p._render = function (mc) {
var _local1 = this;
var _local2 = mc;
if (_local1.autoRender) {
_local1.drawShapeAt(_local2, 0, 0, _local1.rotation);
}
if (_local1.useSymbol) {
_local2.attachMovie(_local1.symbolID, "symbol", 0);
_local2.symbol._xscale = _local1.symbolXScale;
_local2.symbol._yscale = _local1.symbolYScale;
_local2.symbol._rotation = (_local1.symbolRotation / Math.PI) * 180;
_local2.symbol._alpha = _local1.symbolAlpha;
}
};
p.setProperties = function (o) {
var _local1 = o;
var _local2 = this;
for (var _local3 in _local1) {
_local2[_local3] = _local1[_local3];
}
};
p.drawShape = function (mc) {
var _local1 = this;
_local1.drawShapeAt(mc, _local1.position.x, _local1.position.y, _local1.rotation);
};
p.drawShapeAt = function (mc, x, y, a) {
var _local1 = this;
var _local2 = mc;
_local2.beginFill(_local1.fillColor, _local1.fillAlpha);
_local2.lineStyle(_local1.lineWidth, _local1.lineColor, _local1.lineAlpha);
_local1._drawShapeAt(_local2, x, y, a);
_local2.endFill();
};
p.flipVertical = function (y, s) {
var _local1 = this;
if (y != null) {
_local1.position.y = (y * 2) - _local1.position.y;
}
if (!s) {
_local1.symbolYScale = _local1.symbolYScale * -1;
_local1.symbolRotation = _local1.symbolRotation * -1;
}
return(_local1);
};
p.flipHorizontal = function (x, s) {
var _local1 = this;
if (x != null) {
_local1.position.x = (x * 2) - _local1.position.x;
}
if (!s) {
_local1.symbolXScale = _local1.symbolXScale * -1;
_local1.symbolRotation = _local1.symbolRotation * -1;
}
return(_local1);
};
p.rotate = function (a) {
this.symbolRotation = this.symbolRotation + a;
};
p.scale = function (factor) {
this.symbolXScale = this.symbolXScale * factor;
this.symbolYScale = this.symbolYScale * factor;
};
p.clone = function () {
var _local2 = this;
var _local1 = new _local2.constructor();
_local1.position = _local2.position.clone();
_local1.velocity = _local2.velocity.clone();
_local2.cloneProp("name", _local1);
_local2.cloneProp("bounceFriction", _local1);
_local2.cloneProp("slidingFriction", _local1);
_local2.cloneProp("useSymbol", _local1);
_local2.cloneProp("symbolID", _local1);
_local2.cloneProp("symbolXScale", _local1);
_local2.cloneProp("symbolYScale", _local1);
_local2.cloneProp("symbolRotation", _local1);
_local2.cloneProp("symbolAlpha", _local1);
_local2.cloneProp("autoRender", _local1);
_local2.cloneProp("fillColor", _local1);
_local2.cloneProp("fillAlpha", _local1);
_local2.cloneProp("lineWidth", _local1);
_local2.cloneProp("lineColor", _local1);
_local2.cloneProp("lineAlpha", _local1);
return(_local1);
};
p.getObjectRef = function (path) {
var _local2 = path.split(".");
var _local3 = this.parent;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == "_parent") {
_local3 = _local3.parent;
} else {
_local3 = _local3[_local2[_local1]];
}
_local1++;
}
return(_local3);
};
p.getBounds = function () {
var _local1 = this;
if (_local1.useDefaultBounds) {
_local1.getDefaultBounds();
}
return(_local1);
};
p.getLocalBounds = function () {
var _local3 = this;
var _local2 = _local3.getGlobalPosition();
var _local1 = new Object();
_local1.xMin = _local3.xMin - _local2.x;
_local1.xMax = _local3.xMax - _local2.x;
_local1.yMin = _local3.yMin - _local2.y;
_local1.yMax = _local3.yMax - _local2.y;
return(_local1);
};
p.getParentBounds = function () {
var _local2 = this;
var _local1 = _local2.getLocalBounds();
_local1.xMin = _local1.xMin + _local2.position.x;
_local1.xMax = _local1.xMax + _local2.position.x;
_local1.yMin = _local1.yMin + _local2.position.y;
_local1.yMax = _local1.yMax + _local2.position.y;
return(_local1);
};
p.getGlobalPosition = function () {
var _local1 = this;
if (!_local1.isGrouped) {
return(_local1.position.clone());
}
return(_local1.position.clone().plus(_local1.parentGroup.getGlobalPosition()));
};
p.getRoot = function () {
return(this.parent.getRoot());
};
p.getDefaultBounds = function () {
return(this._getDefaultBounds(this.getGlobalPosition()));
};
p.cloneProp = function (name, o) {
var _local1 = name;
var _local2 = this;
if (_local2.__proto__[_local1] != _local2[_local1]) {
o[_local1] = _local2[_local1];
}
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = "";
_local1 = _local1 + _local2.exportProp("name");
_local1 = _local1 + ((" classString='" + _local2.classString) + "'");
_local1 = _local1 + ((((" position='" + _local2.position.x) + ",") + _local2.position.y) + "'");
_local1 = _local1 + _local2.exportProp("bounceFriction");
_local1 = _local1 + _local2.exportProp("slidingFriction");
_local1 = _local1 + _local2.exportProp("useSymbol");
_local1 = _local1 + _local2.exportProp("symbolID");
_local1 = _local1 + _local2.exportProp("symbolXScale");
_local1 = _local1 + _local2.exportProp("symbolYScale");
_local1 = _local1 + _local2.exportProp("symbolRotation");
_local1 = _local1 + _local2.exportProp("symbolAlpha");
_local1 = _local1 + _local2.exportProp("autoRender");
_local1 = _local1 + _local2.exportProp("fillColor", "Color");
_local1 = _local1 + _local2.exportProp("fillAlpha");
_local1 = _local1 + _local2.exportProp("lineWidth");
_local1 = _local1 + _local2.exportProp("lineColor", "Color");
_local1 = _local1 + _local2.exportProp("lineAlpha");
return(_local1);
};
p.exportProp = function (name, type) {
var _local1 = name;
var _local2 = this;
if (_local2.__proto__[_local1] != _local2[_local1]) {
if (_local1 == "border") {
trace(_local2[_local1]);
}
if (type == "Color") {
var _local3 = _local2[_local1].toString(16).toUpperCase();
} else {
var _local3 = _local2[_local1];
}
return((((" " + _local1) + "='") + _local3) + "'");
}
return("");
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
_local2.importProp("position", _local1, "Vector");
_local2.importProp("name", _local1, "String");
_local2.importProp("bounceFriction", _local1);
_local2.importProp("slidingFriction", _local1);
_local2.importProp("useSymbol", _local1, "Boolean");
_local2.importProp("symbolID", _local1, "String");
_local2.importProp("symbolXScale", _local1);
_local2.importProp("symbolYScale", _local1);
_local2.importProp("symbolRotation", _local1);
_local2.importProp("symbolAlpha", _local1);
_local2.importProp("autoRender", _local1, "Boolean");
_local2.importProp("fillColor", _local1, "Color");
_local2.importProp("fillAlpha", _local1);
_local2.importProp("lineWidth", _local1);
_local2.importProp("lineColor", _local1, "Color");
_local2.importProp("lineAlpha", _local1);
};
p.importProp = function (name, o, type) {
var _local2 = type;
var _local3 = o.attributes[name];
if (_local3 != null) {
if (_local2 == "Vector") {
var _local1 = _local3.split(",");
_local3 = new Vector(parseFloat(_local1[0]), parseFloat(_local1[1]));
} else if (_local2 == "String") {
} else if (_local2 == "Boolean") {
_local3 = ((_local3 == "true") ? true : false);
} else if (_local2 == "Color") {
_local3 = parseInt(_local3, 16);
} else {
_local3 = parseFloat(_local3);
}
this[name] = _local3;
}
};
var c = ((ICE.MovableObject = function (x, y, radius) {
super(x, y);
if (radius != null) {
this.radius = radius;
}
this.contacts = new Object();
}));
var p = c.as1_extends(ICE.PhysicsObject);
p.classString = "MovableObject";
p.enabled = true;
p.radius = 20;
p.fillColor = 0;
p.maxSpeed = 30;
p.level = 0;
p.contactAngle = 0;
p.mass = 1;
p.bounceFriction = 0.3;
p.rollingEnabled = false;
p.rotationSpeed = 0;
p.rollingGrip = 0.5;
p.rotationFriction = 0.02;
p.rotation = 0;
p.started = false;
p.setEnabled = function (enabled) {
var _local1 = this;
_local1.enabled = enabled;
_local1.parent.updateMovableObjects();
if (_local1.started) {
if (enabled) {
_local1.parent.addListener(_local1);
} else {
_local1.parent.removeListener(_local1);
}
}
};
p.start = function () {
var _local1 = this;
if (_local1.started) {
} else {
_local1.started = true;
_local1.initVelocity = _local1.velocity.clone();
_local1.initPosition = _local1.position.clone();
_local1.initLevel = _local1.level;
if (_local1.enabled) {
_local1.parent.addListener(_local1);
}
}
};
p.stop = function () {
var _local1 = this;
if (!_local1.started) {
} else {
_local1.started = false;
_local1.velocity = _local1.initVelocity;
_local1.position = _local1.initPosition;
_local1.level = _local1.initLevel;
_local1.mc._x = _local1.position.x;
_local1.mc._y = _local1.position.y;
_local1.mc.swapDepths(_local1.zIndex);
_local1.getDefaultBounds();
if (_local1.enabled) {
_local1.parent.removeListener(_local1);
}
}
};
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local1.radius = _local2.radius;
_local1.dragForce = _local2.dragForce;
_local1.dragFriction = _local2.dragFriction;
_local1.fillColor = _local2.fillColor;
_local1.level = _local2.level;
_local1.contactAngle = _local2.contactAngle;
_local1.mass = _local2.mass;
return(_local1);
};
p.scale = function (factor) {
super.scale(factor);
this.radius = this.radius * factor;
return(this);
};
p.hasContactWith = function (f) {
return((this.contacts[f.id] ? true : false));
};
p.hasContact = function () {
var _local1 = this;
for (var _local2 in _local1.contacts) {
return(true);
}
return(false);
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local2 = p;
_local1.xMin = _local2.x - _local1.radius;
_local1.xMax = _local2.x + _local1.radius;
_local1.yMin = _local2.y - _local1.radius;
_local1.yMax = _local2.y + _local1.radius;
};
p._drawShapeAt = function (mc, x, y) {
mc.drawCircle(x, y, this.radius);
};
p.startDrag = function () {
this.obj.onBeforeStepPhysics = this.obj.drag;
};
p.stopDrag = function () {
delete this.obj.onBeforeStepPhysics;
};
p.drag = function () {
var _local1 = this;
var _local2 = _local1.mc._parent;
var _local3 = new Vector(_local2._xmouse, _local2._ymouse).minus(_local1.position);
_local1.velocity.plus(_local3.scale(_local1.dragForce));
_local1.velocity.scale(1 - _local1.dragFriction);
};
p.onAfterStepPhysics = function () {
var _local1 = this;
_local1.mc._x = _local1.position.x;
_local1.mc._y = _local1.position.y;
_local1.mc._rotation = (_local1.rotation / Math.PI) * 180;
if (_local1.velocity.getLength() > _local1.maxSpeed) {
_local1.velocity.setLength(_local1.maxSpeed);
}
};
p.detectCollision = function (b) {
var _local1 = this;
var _local2 = b;
var overLap = ((_local1.radius + _local2.radius) - _global.getDistance(_local1.position, _local2.position));
if (overLap <= 0) {
return(false);
}
var _local3 = (Math.PI/2) - _global.getAngle(_local2.position, _local1.position);
_local1.velocity.rotate(_local3);
_local1.position.rotate(_local3);
_local2.velocity.rotate(_local3);
_local2.position.rotate(_local3);
var totMom = Math.abs((_local1.mass * _local1.velocity.y) - (_local2.mass * _local2.velocity.y));
var mr = (_local1.mass / (_local1.mass + _local2.mass));
var eo = {bounceSpeed:_local1.velocity.y - _local2.velocity.y, angle:_local3, movableObject1:_local1, movableObject2:_local2};
_local1.position.y = _local1.position.y - (overLap * (1 - mr));
_local1.velocity.y = _local1.velocity.y - ((totMom / _local1.mass) * (1 - _local1.bounceFriction));
_local1.velocity.x = _local1.velocity.x * (1 - _local1.slidingFriction);
_local2.position.y = _local2.position.y + (overLap * mr);
_local2.velocity.y = _local2.velocity.y + ((totMom / _local2.mass) * (1 - _local1.bounceFriction));
_local2.velocity.x = _local2.velocity.x * (1 - _local1.slidingFriction);
if (_local1.rollingEnabled) {
var svy = ((_local2.rotationSpeed * _local2.radius) - (_local1.rotationSpeed * _local1.radius));
var staticFrictionC = 0.2;
var kineticFrictionC = 0.1;
var maxStatic = staticFrictionC;
var frictionForce = ((-svy) / 5);
_local1.velocity.x = _local1.velocity.x + frictionForce;
_local1.rotationSpeed = _local1.rotationSpeed - (frictionForce / _local1.radius);
_local2.velocity.x = _local2.velocity.x - frictionForce;
_local2.rotationSpeed = _local2.rotationSpeed + (frictionForce / _local2.radius);
}
_local1.velocity.rotate(-_local3);
_local1.position.rotate(-_local3);
_local2.velocity.rotate(-_local3);
_local2.position.rotate(-_local3);
_local1.getRoot().broadcastMessage("onMovableCollision", eo);
return(true);
};
p.export = function () {
return(("<MovableObject" + this.exportProperties()) + " />");
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("radius");
_local1 = _local1 + _local2.exportProp("velocity");
_local1 = _local1 + _local2.exportProp("maxSpeed");
_local1 = _local1 + _local2.exportProp("dragForce");
_local1 = _local1 + _local2.exportProp("dragFriction");
_local1 = _local1 + _local2.exportProp("level");
_local1 = _local1 + _local2.exportProp("mass");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("radius", _local1);
_local2.importProp("velocity", _local1, "Vector");
_local2.importProp("maxSpeed", _local1);
_local2.importProp("dragForce", _local1);
_local2.importProp("dragFriction", _local1);
_local2.importProp("level", _local1);
_local2.importProp("mass", _local1);
};
var c = ((ICE.FixedObject = function (x, y, rotation) {
super(x, y);
if (rotation != null) {
this.rotation = rotation;
}
}));
var p = c.as1_extends(ICE.PhysicsObject);
p.enabled = true;
p.nested = false;
p.transparent = false;
p.rotation = 0;
p.rotationSpeed = 0;
p.forceMultiplier = 1;
p.zIndex = null;
p.startLevel = 0;
p.endLevel = 0;
p.isGrouped = false;
p.parentGroup = null;
p.xMin = -100;
p.xMax = 100;
p.yMin = -100;
p.yMax = 100;
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("enabled", _local1);
_local2.cloneProp("nested", _local1);
_local2.cloneProp("transparent", _local1);
_local2.cloneProp("rotation", _local1);
_local2.cloneProp("rotationSpeed", _local1);
_local2.cloneProp("forceMultiplier", _local1);
_local2.cloneProp("startLevel", _local1);
_local2.cloneProp("endLevel", _local1);
_local2.cloneProp("zIndex", _local1);
_local2.cloneProp("useDefaultBounds", _local1);
_local2.cloneProp("xMin", _local1);
_local2.cloneProp("xMax", _local1);
_local2.cloneProp("yMin", _local1);
_local2.cloneProp("yMax", _local1);
return(_local1);
};
p.scale = function (factor) {
super.scale(factor);
};
p.rotate = function (a) {
super.rotate(a);
this.rotation = this.rotation + a;
};
p.flipVertical = function (y, s) {
super.flipVertical(y, s);
};
p.flipHorizontal = function (x, s) {
super.flipHorizontal(x, s);
};
p.compile = function () {
var _local2 = this;
_local2.levels = new Array();
var _local1 = 0;
while (_local1 <= _local2.endLevel) {
_local2.levels[_local1] = _local1 >= _local2.startLevel;
_local1++;
}
};
p.detectCollision = function (b) {
return(this._detectCollision(b, this.getGlobalPosition()));
};
p.resolveCollision = function (m, a, p) {
var _local1 = m;
var _local2 = this;
if (_local2.nested) {
return(_local2.parent.resolveCollision(_local1, a, p));
}
if (_local2.transparent) {
return(true);
}
var _local3 = _local1.velocity.rotate(-a);
var f = _local2.velocity.clone().plus(_local2.getRoot().velocity.clone().scale(1 / _local2.forceMultiplier));
var initVx = _local3.x;
_local3.x = _local3.x * (((_local3.x < 0) ? -1 : 1) * (1 - _local2.bounceFriction));
if (p instanceof Vector) {
_local1.position = p.clone().plus(new Vector(0, _local1.radius).setAngle(a));
if (_local2.rotationSpeed != 0) {
var rf = (_global.getDistance(p, _local2.position) * _local2.rotationSpeed);
var ca = (_global.getAngle(_local2.position, p) - (Math.PI/2));
f.x = f.x + (Math.cos(ca) * rf);
f.y = f.y + (Math.sin(ca) * rf);
}
}
if ((f.x != 0) || (f.y != 0)) {
f.rotate(-a);
if (f.x > 0) {
_local3.x = _local3.x + ((f.x * _local2.forceMultiplier) * (1 - _local2.bounceFriction));
}
}
if (_local1.rollingEnabled) {
var svy = ((_local3.y - (_local1.rotationSpeed * _local1.radius)) - f.y);
var staticFrictionC = 0.7;
var kineticFrictionC = 0.6;
var linearMomentumY = (_local1.mass * svy);
var maxStatic = (staticFrictionC * _local1.mass);
if (Math.abs(linearMomentumY) > maxStatic) {
var frictionForce = ((kineticFrictionC * _local1.mass) * ((svy < 0) ? 1 : -1));
} else {
var frictionForce = (-linearMomentumY);
}
_local3.y = _local3.y + (frictionForce / _local1.mass);
_local1.rotationSpeed = _local1.rotationSpeed - ((frictionForce / _local1.mass) / _local1.radius);
} else {
_local3.y = _local3.y - ((_local3.y - f.y) * _local2.slidingFriction);
}
var eo = {angle:a, bounceSpeed:_local3.x, slidingSpeed:_local3.y, fixedObject:_local2, movableObject:_local1};
_local3.rotate(a);
_local1.contactAngle = a;
_local2.broadcastMessage("onCollision", eo);
_local1.broadcastMessage("onCollision", eo);
return(true);
};
p.export = function () {
return(("<FixedObject" + this.exportProperties()) + " />");
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("enabled");
_local1 = _local1 + _local2.exportProp("transparent");
_local1 = _local1 + _local2.exportProp("rotation");
_local1 = _local1 + _local2.exportProp("forceMultiplier");
_local1 = _local1 + _local2.exportProp("startLevel");
_local1 = _local1 + _local2.exportProp("endLevel");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("enabled", _local1, "Boolean");
_local2.importProp("transparent", _local1, "Boolean");
_local2.importProp("forceMultiplier", _local1);
_local2.importProp("rotation", _local1);
_local2.importProp("startLevel", _local1);
_local2.importProp("endLevel", _local1);
};
var c = ((ICE.Circle = function (x, y, radius) {
super(x, y);
if (radius != null) {
this.radius = radius;
}
}));
var p = c.as1_extends(ICE.FixedObject);
p.classString = "Circle";
p.radius = 40;
p.clone = function () {
var _local1 = super.clone();
this.cloneProp("radius", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
this.radius = this.radius * factor;
return(this);
};
p.flipVertical = function (y) {
super.flipVertical(y);
return(this);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
return(this);
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local2 = p;
_local1.xMin = _local2.x - _local1.radius;
_local1.xMax = _local2.x + _local1.radius;
_local1.yMin = _local2.y - _local1.radius;
_local1.yMax = _local2.y + _local1.radius;
};
p._detectCollision = function (b, p) {
var _local1 = b;
var _local3 = p;
if (((_local1.radius + this.radius) - _global.getDistance(_local1.position, _local3)) < 0) {
return(false);
}
var _local2 = _global.getAngle(_local1.position, _local3);
_local3 = _local3.clone().plus(new Vector(0, this.radius).setAngle(_local2));
return(this.resolveCollision(_local1, _local2, _local3));
};
p._drawShapeAt = function (mc, x, y) {
mc.drawCircle(x, y, this.radius);
};
p.exportProperties = function () {
var _local1 = super.exportProperties();
_local1 = _local1 + this.exportProp("radius");
return(_local1);
};
p.importObject = function (o) {
super.importObject(o);
this.importProp("radius", o);
};
var c = ((ICE.CircleBumper = function (x, y, r) {
super(x, y, r);
}));
var p = c.as1_extends(ICE.Circle);
p.classString = "CircleBumper";
p.radius = 20;
p.fillColor = 3355443 /* 0x333333 */;
p.radius = 50;
p.hitForce = 5;
p.hitThreshold = 0;
p.hitSoundID = "";
p.playSymbol = false;
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("hitForce", _local1);
_local2.cloneProp("hitThreshold", _local1);
_local2.cloneProp("hitSoundID", _local1);
_local2.cloneProp("playSymbol", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
};
p.flipVertical = function (y) {
super.flipVertical(y);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
};
p.start = function () {
this.addListener(this);
};
p.stop = function () {
this.removeListener(this);
};
p.compile = function () {
var _local1 = this;
super.compile();
if (_local1.hitSoundID != null) {
_local1.hitSound = new Sound(_local1.mc);
_local1.hitSound.attachSound(_local1.hitSoundID);
} else {
_local1.hitSound = null;
}
};
p.onCollision = function (eo) {
var _local1 = this;
var _local2 = eo;
if (Math.abs(_local2.bounceSpeed) >= _local1.hitThreshold) {
_local2.movableObject.velocity.plus(new Vector(0, _local1.hitForce).setAngle(_local2.angle));
_local1.hitSound.start();
if (_local1.playSymbol) {
_local1.mc.symbol.play();
}
_local1.broadcastMessage("onBump", _local2);
}
};
p._drawShapeAt = function (mc, x, y) {
mc.drawCircle(x, y, this.radius);
var _local1 = mc.createEmptyMovieClip("mid", 1);
_local1.beginFill(16777215, 20);
_local1.drawCircle(x, y, this.radius * 0.7);
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("hitForce");
_local1 = _local1 + _local2.exportProp("hitThreshold");
_local1 = _local1 + _local2.exportProp("hitSoundID");
_local1 = _local1 + _local2.exportProp("playSymbol");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("hitForce", _local1);
_local2.importProp("hitThreshold", _local1);
_local2.importProp("hitSoundID", _local1, "String");
_local2.importProp("playSymbol", _local1, "Boolean");
};
var c = ((ICE.HideOut = function (x, y, r) {
super(x, y, r);
this.releaseVelocity = this.releaseVelocity.clone();
}));
var p = c.as1_extends(ICE.Circle);
p.classString = "HideOut";
p.fillColor = 10066329 /* 0x999999 */;
p.lineWidth = 2;
p.targetRadius = 2;
p.outerRadius = 20;
p.releaseVelocity = new Vector(0, 0);
p.randomFactor = 1;
p.holdSoundID = "";
p.releaseSoundID = "";
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("targetRadius", _local1);
_local2.cloneProp("outerRadius", _local1);
_local2.cloneProp("holdSoundID", _local1);
_local2.cloneProp("releaseSoundID", _local1);
_local2.cloneProp("releaseVelocity", _local1);
_local2.cloneProp("randomFactor", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
};
p.flipVertical = function (y) {
super.flipVertical(y);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
};
p.start = function () {
var _local1 = this;
_local1.addListener(_local1);
_local1.onEnter = _local1._onEnter;
delete _local1.onExit;
_local1.radius = _local1.targetRadius;
_local1.occupied = false;
_local1.transparent = true;
_local1.mc.fakeball.removeMovieClip();
};
p.stop = function () {
this.removeListener(this);
};
p.compile = function () {
var _local1 = this;
super.compile();
if (_local1.holdSoundID != null) {
_local1.holdSound = new Sound(_local1.mc);
_local1.holdSound.attachSound(_local1.holdSoundID);
} else {
delete _local1.holdSound;
}
if (_local1.releaseSoundID != null) {
_local1.releaseSound = new Sound(_local1.mc);
_local1.releaseSound.attachSound(_local1.releaseSoundID);
} else {
delete _local1.releaseSound;
}
};
p.holdBall = function (ball) {
var _local1 = this;
var _local2 = ball;
_local1.occupied = true;
_local1.ball = _local2;
_local2.position = _local1.position.clone();
_local2.onAfterStepPhysics();
_local2.setEnabled(false);
_local1.transparent = false;
_local1.radius = _local2.radius;
delete _local1.onExit;
delete _local1.onEnter;
_local1.holdSound.start();
};
p.releaseBall = function () {
var _local1 = this;
_local1.occupied = false;
var _local2 = (_local1.ball.velocity = _local1.releaseVelocity.clone());
_local2.x = _local2.x + ((Math.random() - 0.5) * _local1.randomFactor);
_local2.y = _local2.y + ((Math.random() - 0.5) * _local1.randomFactor);
_local1.radius = _local1.targetRadius;
_local1.transparent = true;
_local1.onExit = _local1._onExit;
_local1.ball.setEnabled(true);
_local1.releaseSound.start();
return(_local1.ball);
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local2 = p;
_local1.xMin = _local2.x - _local1.outerRadius;
_local1.xMax = _local2.x + _local1.outerRadius;
_local1.yMin = _local2.y - _local1.outerRadius;
_local1.yMax = _local2.y + _local1.outerRadius;
};
p._drawShapeAt = function (mc, x, y) {
mc.drawCircle(x, y, this.outerRadius);
mc.drawCircle(x, y, this.targetRadius);
};
p._onEnter = function (eo) {
var _local1 = this;
if (!_local1.occupied) {
_local1.holdBall(eo.movableObject);
_local1.broadcastMessage("onHoldBall", eo);
}
};
p._onExit = function () {
var _local1 = this;
if (!_local1.occupied) {
delete _local1.onExit;
_local1.onEnter = _local1._onEnter;
}
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("targetRadius");
_local1 = _local1 + _local2.exportProp("outerRadius");
_local1 = _local1 + _local2.exportProp("holdSoundID");
_local1 = _local1 + _local2.exportProp("releaseSoundID");
_local1 = _local1 + _local2.exportProp("releaseVelocity");
_local1 = _local1 + _local2.exportProp("randomFactor");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("targetRadius", _local1);
_local2.importProp("outerRadius", _local1);
_local2.importProp("holdSoundID", _local1, "String");
_local2.importProp("releaseSoundID", _local1, "String");
_local2.importProp("releaseVelocity", _local1, "Vector");
_local2.importProp("randomFactor", _local1);
};
var c = ((ICE.Rectangle = function (x, y, rotation, width, height) {
super(x, y, rotation);
if (height != null) {
this.height = height;
}
if (width != null) {
this.width = width;
}
}));
var p = c.as1_extends(ICE.FixedObject);
p.classString = "Rectangle";
p.width = 80;
p.height = 80;
p.clone = function () {
var _local1 = super.clone();
this.cloneProp("width", _local1);
this.cloneProp("height", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
var _local1 = this;
var _local2 = factor;
super.scale(_local2);
_local1.width = _local1.width * _local2;
_local1.height = _local1.height * _local2;
return(_local1);
};
p.flipVertical = function (y) {
var _local1 = this;
super.flipVertical(y);
_local1.rotation = Math.PI - _local1.rotation;
return(_local1);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
this.rotation = this.rotation * -1;
return(this);
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local3 = new Vector(_local1.width / 2, _local1.height / 2);
_local3.rotate(_local1.rotation);
var _local2 = new Vector(_local1.width / 2, (-_local1.height) / 2);
_local2.rotate(_local1.rotation);
var xMax = Math.max(Math.abs(_local3.x), Math.abs(_local2.x));
var yMax = Math.max(Math.abs(_local3.y), Math.abs(_local2.y));
_local1.xMin = p.x - xMax;
_local1.xMax = p.x + xMax;
_local1.yMin = p.y - yMax;
_local1.yMax = p.y + yMax;
};
p._detectCollision = function (b, p) {
var _local1 = this;
var _local2 = b.position.clone().rotateAround(p, -_local1.rotation);
var _local3 = b.radius;
var left = ((p.x - (_local1.width / 2)) - _local3);
var right = ((p.x + (_local1.width / 2)) + _local3);
if ((_local2.x < right) && (_local2.x > left)) {
var top = ((p.y - (_local1.height / 2)) - _local3);
var bottom = ((p.y + (_local1.height / 2)) + _local3);
if ((_local2.y < bottom) && (_local2.y > top)) {
var corner = new Vector();
var overlap = new Vector();
var edge = new Vector();
if (_local2.y < p.y) {
overlap.y = top - _local2.y;
corner.y = top + _local3;
var ya = (_local1.rotation - (Math.PI/2));
} else {
overlap.y = _local2.y - bottom;
corner.y = bottom - _local3;
var ya = (_local1.rotation + (Math.PI/2));
}
if (_local2.x < p.x) {
overlap.x = left - _local2.x;
corner.x = left + _local3;
var xa = (_local1.rotation + Math.PI);
} else {
overlap.x = _local2.x - right;
corner.x = right - _local3;
var xa = _local1.rotation;
}
if (((-overlap.x) < _local3) && ((-overlap.y) < _local3)) {
var overLap = (_local3 - _global.getDistance(corner, _local2));
if (overLap > 0) {
var a = (_local1.rotation + _global.getAngle(_local2, corner));
var p = corner.rotateAround(p, _local1.rotation);
return(_local1.resolveCollision(b, a, p));
}
} else {
if (overlap.x > overlap.y) {
var p = new Vector(corner.x, _local2.y).rotateAround(p, _local1.rotation);
return(_local1.resolveCollision(b, xa, p));
}
var p = new Vector(_local2.x, corner.y).rotateAround(p, _local1.rotation);
return(_local1.resolveCollision(b, ya, p));
}
}
}
return(false);
};
p._drawShapeAt = function (mc, x, y, a) {
var _local1 = [];
var w = (this.width / 2);
var _local3 = this.height / 2;
var _local2 = new Vector(x, y);
_local1[0] = new Vector(-w, -_local3).rotate(a).plus(_local2);
_local1[1] = new Vector(w, -_local3).rotate(a).plus(_local2);
_local1[2] = new Vector(w, _local3).rotate(a).plus(_local2);
_local1[3] = new Vector(-w, _local3).rotate(a).plus(_local2);
mc.drawPoly(_local1);
};
p.exportProperties = function () {
var _local1 = super.exportProperties();
_local1 = _local1 + this.exportProp("width");
_local1 = _local1 + this.exportProp("height");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
super.importObject(_local1);
this.importProp("width", _local1);
this.importProp("height", _local1);
};
var c = ((ICE.Ramp = function (x, y, a) {
super(x, y, a);
}));
var p = c.as1_extends(ICE.Rectangle);
p.classString = "Ramp";
p.transparent = true;
p.autoRender = false;
p.lowerLevel = 0;
p.upperLevel = 1;
p.width = 100;
p.height = 10;
p.clone = function () {
var _local1 = super.clone();
this.cloneProp("lowerLevel", _local1);
this.cloneProp("upperLevel", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
};
p.flipVertical = function (y) {
super.flipVertical(y);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
};
p.compile = function () {
super.compile();
this.transparent = true;
};
p.start = function () {
this.addListener(this);
};
p.stop = function () {
this.removeListener(this);
};
p.onExit = function (eo) {
var _local1 = this;
var _local3 = eo.movableObject;
var _local2 = _local3.position.clone().minus(_local1.getGlobalPosition()).rotate(-_local1.rotation);
if ((_local2.x > ((-_local1.width) / 2)) && (_local2.x < (_local1.width / 2))) {
if (_local2.y > 0) {
_local3.level = _local1.lowerLevel;
_local1.broadcastMessage("onLowerLevel", eo);
} else {
_local3.level = _local1.upperLevel;
_local1.broadcastMessage("onUpperLevel", eo);
}
}
};
p.exportProperties = function () {
var _local1 = super.exportProperties();
_local1 = _local1 + this.exportProp("lowerLevel");
_local1 = _local1 + this.exportProp("upperLevel");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
super.importObject(_local1);
this.importProp("lowerLevel", _local1);
this.importProp("upperLevel", _local1);
};
var c = ((ICE.Target = function (x, y, a) {
super(x, y, a);
}));
var p = c.as1_extends(ICE.Rectangle);
p.classString = "Target";
p.transparent = true;
p.fillColor = 0;
p.light = "";
p.state = true;
p.switchSoundID = "";
p.width = 40;
p.height = 3;
p.setState = function (state) {
var _local1 = this;
_local1.state = state;
_local1.lightRef.setState(state);
_local1.mc.symbol.gotoAndStop((_local1.state ? "on" : "off"));
_local1.broadcastMessage("onStateChanged", {target:_local1, state:state});
};
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("light", _local1);
_local2.cloneProp("state", _local1);
_local2.cloneProp("switchSoundID", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
};
p.flipVertical = function (y) {
super.flipVertical(y);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
};
p.compile = function () {
var _local1 = this;
super.compile();
if (_local1.switchSoundID != "") {
_local1.switchSound = new Sound(_local1.mc);
_local1.switchSound.attachSound(_local1.switchSoundID);
}
_local1.lightRef = _local1.getObjectRef(_local1.light);
_local1.setState(_local1.state);
};
p.start = function () {
var _local1 = this;
_local1.addListener(_local1);
_local1.initState = _local1.state;
};
p.stop = function () {
var _local1 = this;
_local1.removeListener(_local1);
_local1.state = _local1.initState;
};
p.onEnter = function (eo) {
var _local1 = this;
if (_local1.state) {
_local1.setState(false);
_local1.switchSound.start();
_local1.broadcastMessage("onSwitch", eo);
}
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("light");
_local1 = _local1 + _local2.exportProp("state");
_local1 = _local1 + _local2.exportProp("switchSoundID");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("light", _local1, "String");
_local2.importProp("state", _local1, "Boolean");
_local2.importProp("switchSoundID", _local1, "String");
};
var c = ((ICE.Plunger = function (x, y, a) {
super(x, y, a);
}));
var p = c.as1_extends(ICE.Rectangle);
p.classString = "Plunger";
p.fillColor = 3355443 /* 0x333333 */;
p.pullSpeed = 3;
p.pullAmount = 40;
p.pullPos = 0;
p.plungerSpeed = 0;
p.randomFactor = 1;
p.hitSoundID = "";
p.keyCode = 32;
p.width = 30;
p.height = 80;
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("pullSpeed", _local1);
_local2.cloneProp("pullAmount", _local1);
_local2.cloneProp("randomFactor", _local1);
_local2.cloneProp("hitSoundID", _local1);
_local2.cloneProp("keyCode", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
};
p.flipVertical = function (y) {
super.flipVertical(y);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
};
p.compile = function () {
var _local1 = this;
super.compile();
if (_local1.hitSoundID != "") {
_local1.hitSound = new Sound(_local1.mc);
_local1.hitSound.attachSound(_local1.hitSoundID);
}
};
p.start = function () {
Key.addListener(this);
};
p.stop = function () {
Key.removeListener(this);
};
p._render = function (mc) {
var _local1 = mc;
var _local2 = this;
_local1.createEmptyMovieClip("cnt", 0);
if (_local2.autoRender) {
_local2.drawShapeAt(_local1.cnt, 0, 0, _local2.rotation);
}
if (_local2.useSymbol) {
_local1.cnt.attachMovie(_local2.symbolID, "symbol", 0);
_local1.cnt.symbol._xscale = _local2.symbolXScale;
_local1.cnt.symbol._yscale = _local2.symbolYScale;
_local1.cnt.symbol._rotation = (_local2.symbolRotation / Math.PI) * 180;
_local1.cnt.symbol._alpha = _local2.symbolAlpha;
}
_local1.createEmptyMovieClip("mask", 1);
_local2.drawShapeAt(_local1.mask, 0, 0, _local2.rotation);
_local1.cnt.setMask(_local1.mask);
};
p._detectCollision = function (m, p) {
var _local1 = this;
var _local3 = m;
var _local2 = _local3.position.clone().minus(p).rotate(-_local1.rotation);
if (((_local2.x > ((-_local1.width) / 2)) && (_local2.x < (_local1.width / 2))) && (_local2.y < (_local1.height / 2))) {
var y = (((-_local1.height) / 2) + _local1.pullPos);
if (_local2.y > (y - _local3.radius)) {
_local2.y = y;
_local2.rotate(_local1.rotation).plus(p);
_local1.velocity = new Vector(0, _local1.plungerSpeed).rotate(_local1.rotation);
var a = (_local1.rotation - (Math.PI/2));
if (_local1.direction == -1) {
_local1.hitSound.start();
_local3.velocity.x = _local3.velocity.x + ((Math.random() - 0.5) * _local1.randomFactor);
_local3.velocity.y = _local3.velocity.y + ((Math.random() - 0.5) * _local1.randomFactor);
_local1.broadcastMessage("onShoot", {fixedObject:_local1, movableObject:_local3});
}
return(_local1.resolveCollision(_local3, a, _local2));
}
}
return(undefined);
};
p.onKeyDown = function () {
var _local1 = this;
if (_local1.isDown) {
} else if (Key.getCode() != _local1.keyCode) {
} else {
_local1.isDown = true;
_local1.pull();
}
};
p.onKeyUp = function () {
var _local1 = this;
if (Key.getCode() != _local1.keyCode) {
} else {
_local1.isDown = false;
_local1.release();
}
};
p.pull = function () {
var _local1 = this;
if (!_local1.moving) {
_local1.getRoot().addListener(_local1);
if (_root.sides.foot._currentframe < 15) {
_root.sides.foot.play();
}
}
_local1.moving = true;
_local1.direction = 1;
_local1.broadcastMessage("onPull", {fixedObject:_local1});
};
p.release = function () {
var _local1 = this;
if (!_local1.moving) {
_local1.getRoot().addListener(_local1);
}
_root.sides.foot.gotoAndPlay(17);
_local1.moving = true;
_local1.direction = -1;
_local1.broadcastMessage("onRelease", {fixedObject:_local1});
};
p.onBeforeStepPhysics = function () {
var _local1 = this;
var _local3 = _local1.pullPos;
if (_local1.direction == 1) {
if (_local1.pullPos >= _local1.pullAmount) {
_local1.pullPos = _local1.pullAmount;
_local1.getRoot().removeListener(_local1);
_local1.moving = false;
_local1.direction = 0;
} else {
_local1.pullPos = _local1.pullPos + _local1.pullSpeed;
_local1.pullPos = Math.min(_local1.pullPos, _local1.pullAmount);
}
}
if (_local1.direction == -1) {
if (_local1.pullPos <= 0) {
_local1.pullPos = 0;
_local1.getRoot().removeListener(_local1);
_local1.moving = false;
_local1.direction = 0;
} else {
_local1.pullPos = 0;
}
}
_local1.plungerSpeed = _local1.pullPos - _local3;
var _local2 = new Vector(0, _local1.pullPos).rotate(_local1.rotation);
_local1.mc.cnt._x = _local2.x;
_local1.mc.cnt._y = _local2.y;
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("pullSpeed");
_local1 = _local1 + _local2.exportProp("pullAmount");
_local1 = _local1 + _local2.exportProp("randomFactor");
_local1 = _local1 + _local2.exportProp("hitSoundID");
_local1 = _local1 + _local2.exportProp("keyCode");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("pullSpeed", _local1);
_local2.importProp("pullAmount", _local1);
_local2.importProp("randomFactor", _local1);
_local2.importProp("hitSoundID", _local1, "String");
_local2.importProp("keyCode", _local1);
};
var c = ((ICE.Ring = function (x, y, rotation, fill, inner, outer, detect) {
var _local1 = this;
super(x, y, rotation);
if (outer != null) {
_local1.outerRadius = outer;
}
if (inner != null) {
_local1.innerRadius = inner;
}
if (fill != null) {
_local1.fillAngle = fill;
}
if (detect != null) {
_local1.detectCorners = detect;
}
}));
var p = c.as1_extends(ICE.FixedObject);
p.classString = "Ring";
p.innerRadius = 20;
p.outerRadius = 40;
p.fillAngle = Math.PI;
p.detectCorners = true;
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("innerRadius", _local1);
_local2.cloneProp("outerRadius", _local1);
_local2.cloneProp("fillAngle", _local1);
_local2.cloneProp("detectCorners", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
var _local1 = this;
var _local2 = factor;
super.scale(_local2);
_local1.innerRadius = _local1.innerRadius * _local2;
_local1.outerRadius = _local1.outerRadius * _local2;
return(_local1);
};
p.flipVertical = function (y) {
var _local1 = this;
super.flipVertical(y);
_local1.rotation = -(_local1.rotation + _local1.fillAngle);
return(_local1);
};
p.flipHorizontal = function (x) {
var _local1 = this;
super.flipHorizontal(x);
_local1.rotation = Math.PI - (_local1.rotation + _local1.fillAngle);
return(_local1);
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local2 = p;
var p1 = new Vector(0, _local1.innerRadius).setAngle(_local1.rotation);
var p2 = new Vector(0, _local1.innerRadius).setAngle(_local1.rotation + _local1.fillAngle);
var p3 = new Vector(0, _local1.outerRadius).setAngle(_local1.rotation);
var _local3 = new Vector(0, _local1.outerRadius).setAngle(_local1.rotation + _local1.fillAngle);
if (_local1.isAngleBetween(Math.PI)) {
_local1.xMin = _local2.x - _local1.outerRadius;
} else {
_local1.xMin = _local2.x + Math.min(p1.x, Math.min(p2.x, Math.min(p3.x, _local3.x)));
}
if (_local1.isAngleBetween(0)) {
_local1.xMax = _local2.x + _local1.outerRadius;
} else {
_local1.xMax = _local2.x + Math.max(p1.x, Math.max(p2.x, Math.max(p3.x, _local3.x)));
}
if (_local1.isAngleBetween(4.71238898038469)) {
_local1.yMin = _local2.y - _local1.outerRadius;
} else {
_local1.yMin = _local2.y + Math.min(p1.y, Math.min(p2.y, Math.min(p3.y, _local3.y)));
}
if (_local1.isAngleBetween((Math.PI/2))) {
_local1.yMax = _local2.y + _local1.outerRadius;
} else {
_local1.yMax = _local2.y + Math.max(p1.y, Math.max(p2.y, Math.max(p3.y, _local3.y)));
}
};
p.isAngleBetween = function (a) {
var _local1 = a;
var _local2 = this;
while (_local1 < _local2.rotation) {
_local1 = _local1 + (Math.PI*2);
}
while (_local1 > (_local2.rotation + (Math.PI*2))) {
_local1 = _local1 - (Math.PI*2);
}
return(_local1 <= (_local2.rotation + _local2.fillAngle));
};
p._detectCollision = function (b, p) {
var _local1 = this;
var r = b.radius;
var dist = _global.getDistance(p, b.position);
if (((dist + r) > _local1.innerRadius) && ((dist - r) < _local1.outerRadius)) {
var _local2 = _global.getAngle(b.position, p);
if (_local1.isAngleBetween(_local2)) {
if (dist > ((_local1.outerRadius + _local1.innerRadius) / 2)) {
var ca = _local2;
var lmt = _local1.outerRadius;
} else {
var ca = (_local2 - Math.PI);
var lmt = _local1.innerRadius;
}
var p2 = p.clone().plus(new Vector(0, lmt).setAngle(_local2));
return(_local1.resolveCollision(b, ca, p2));
}
if (_local1.detectCorners) {
while (_local2 < _local1.rotation) {
_local2 = _local2 + (Math.PI*2);
}
if (((((_local1.rotation * 2) + _local1.fillAngle) / 2) + Math.PI) > _local2) {
var ta = (4.71238898038469 - (_local1.rotation + _local1.fillAngle));
var ca = ((_local1.rotation + _local1.fillAngle) + (Math.PI/2));
var top = (p.y - _local1.outerRadius);
var bottom = (p.y - _local1.innerRadius);
} else {
var ta = ((Math.PI/2) - _local1.rotation);
var ca = (_local1.rotation - (Math.PI/2));
var top = (p.y + _local1.innerRadius);
var bottom = (p.y + _local1.outerRadius);
}
var _local3 = b.position.clone().rotateAround(p, ta);
if ((_local3.x - r) > p.x) {
return(false);
}
if ((_local3.y > top) && (_local3.y < bottom)) {
var p2 = new Vector(p.x, _local3.y).rotateAround(p, -ta);
return(_local1.resolveCollision(b, ca, p2));
}
var corner = p.clone();
corner.y = ((_local3.y < top) ? (top) : (bottom));
var dist = _global.getDistance(_local3, corner);
var overLap = (r - dist);
if (overLap > 0) {
var ca2 = _global.getAngle(_local3, corner);
var p = corner.rotateAround(p, -ta);
return(_local1.resolveCollision(b, ca2 - ta, p));
}
}
}
return(false);
};
p._drawShapeAt = function (mc, x, y, a) {
var _local1 = this;
var _local2 = a;
var _local3 = new Vector((Math.cos(_local2) * _local1.outerRadius) + x, (Math.sin(_local2) * _local1.outerRadius) + y);
mc.moveTo(_local3.x, _local3.y);
mc.arcTo(_local2, _local2 + _local1.fillAngle, _local1.outerRadius);
mc.lineTo((Math.cos(_local2 + _local1.fillAngle) * _local1.innerRadius) + x, (Math.sin(_local2 + _local1.fillAngle) * _local1.innerRadius) + y);
mc.arcTo(_local2 + _local1.fillAngle, _local2, _local1.innerRadius);
mc.lineTo(_local3.x, _local3.y);
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("innerRadius");
_local1 = _local1 + _local2.exportProp("outerRadius");
_local1 = _local1 + _local2.exportProp("fillAngle");
_local1 = _local1 + _local2.exportProp("detectCorners");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("innerRadius", _local1);
_local2.importProp("outerRadius", _local1);
_local2.importProp("fillAngle", _local1);
_local2.importProp("detectCorners", _local1, "Boolean");
};
var c = ((ICE.Flipper = function (x, y, a, r1, r2, l) {
var _local1 = this;
super(x, y, a);
if (r1 != null) {
_local1.radius1 = r1;
}
if (r2 != null) {
_local1.radius2 = r2;
}
if (l != null) {
_local1.flatLength = l;
}
}));
var p = c.as1_extends(ICE.FixedObject);
p.classString = "Flipper";
p.radius1 = 30;
p.radius2 = 15;
p.flatLength = 80;
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("radius1", _local1);
_local2.cloneProp("radius2", _local1);
_local2.cloneProp("flatLength", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
var _local1 = this;
var _local2 = factor;
super.scale(_local2);
_local1.radius1 = _local1.radius1 * _local2;
_local1.radius2 = _local1.radius2 * _local2;
_local1.flatLength = _local1.flatLength * _local2;
return(_local1);
};
p.flipVertical = function (y, s) {
super.flipVertical(y, s);
this.rotation = this.rotation * -1;
return(this);
};
p.flipHorizontal = function (x, s) {
var _local1 = this;
super.flipHorizontal(x, s);
_local1.rotation = Math.PI - _local1.rotation;
return(_local1);
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local3 = p;
var _local2 = new Vector(_local1.flatLength, 0).setAngle(_local1.rotation).plus(_local3);
_local1.xMin = Math.min(_local3.x - _local1.radius1, _local2.x - _local1.radius2);
_local1.xMax = Math.max(_local3.x + _local1.radius1, _local2.x + _local1.radius2);
_local1.yMin = Math.min(_local3.y - _local1.radius1, _local2.y - _local1.radius2);
_local1.yMax = Math.max(_local3.y + _local1.radius1, _local2.y + _local1.radius2);
};
p._detectCollision = function (b, p) {
var _local2 = this;
var x = p.x;
var r1 = _local2.radius1;
var r2 = _local2.radius2;
var r = b.radius;
var _local1 = b.position.clone().rotateAround(p, -_local2.rotation);
if (((_local1.x + r) > (x - r1)) && ((_local1.x - r) < ((x + _local2.flatLength) + r2))) {
var maxr = Math.max(r1, r2);
var _local3 = p.y;
if (((_local1.y + r) > (_local3 - maxr)) && ((_local1.y - r) < (_local3 + maxr))) {
var d = (r2 - r1);
var fl = Math.sqrt((_local2.flatLength * _local2.flatLength) - (d * d));
var da = Math.atan2(d, Math.abs(fl));
_local2.tweak(_local1, _local3);
if (_local1.y < _local3) {
var ca = (da - _local2.rotation);
var left = x;
var right = (x + fl);
var flip = 1;
} else {
var ca = ((Math.PI - da) - _local2.rotation);
var right = x;
var left = (x - fl);
var flip = -1;
}
_local1.rotateAround(p, _local2.rotation);
_local1.rotateAround(p, ca);
if ((_local1.y + r) > (_local3 - r1)) {
if ((_local1.x > left) && (_local1.x < right)) {
if ((_local1.y + r) > (_local3 - r1)) {
var p = new Vector(_local1.x, _local3 - r1).rotateAround(p, -ca);
return(_local2.resolveCollision(b, (-ca) - (Math.PI/2), p));
}
} else {
var side = (((x - _local1.x) * flip) > 0);
b.position = _local1.rotateAround(p, -ca);
var c = (new ICE.Circle(0, 0, 0));
c.nested = true;
c.parent = _local2;
if (side) {
c.position = new Vector(x, _local3);
c.radius = r1;
} else {
c.position = new Vector(x + (_local2.flatLength * Math.cos(_local2.rotation)), _local3 + (_local2.flatLength * Math.sin(_local2.rotation)));
c.radius = r2;
}
return(c.detectCollision(b));
}
}
}
}
return(0);
};
p._drawShapeAt = function (mc, x, y, r) {
var _local1 = this;
var _local2 = r;
var p = new Vector(x, y);
var p2 = new Vector(0, _local1.flatLength).setAngle(_local2).plus(p);
var d = (_local1.radius2 - _local1.radius1);
var da = Math.atan2(d, Math.sqrt(Math.abs((_local1.flatLength * _local1.flatLength) - (d * d))));
var _local3 = (Math.PI/2) + da;
var c1 = new Vector(0, _local1.radius1).rotate(_local2 + da).plus(p);
var c2 = new Vector(0, -_local1.radius2).rotate(_local2 - da).plus(p2);
mc.moveTo(c1.x, c1.y);
mc.arcTo(_local2 + _local3, (_local2 - _local3) + (Math.PI*2), _local1.radius1);
mc.lineTo(c2.x, c2.y);
mc.arcTo(_local2 - _local3, _local2 + _local3, _local1.radius2);
mc.lineTo(c1.x, c1.y);
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("radius1");
_local1 = _local1 + _local2.exportProp("radius2");
_local1 = _local1 + _local2.exportProp("flatLength");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("radius1", _local1);
_local2.importProp("radius2", _local1);
_local2.importProp("flatLength", _local1);
};
var c = ((ICE.PinballFlipper = function (x, y, r1, r2, l, start, end, steps) {
var _local1 = this;
super(x, y, 0, r1, r2, l);
if (start != null) {
_local1.startAngle = start;
}
if (end != null) {
_local1.endAngle = end;
}
if (steps != null) {
_local1.steps = steps;
}
_local1.rotation = _local1.startAngle;
_local1.setInputEnabled(true);
}));
var p = c.as1_extends(ICE.Flipper);
p.classString = "PinballFlipper";
p.radius1 = 13;
p.radius2 = 6;
p.flatLength = 70;
p.flipType = 0;
p.startAngle = 0.4;
p.endAngle = -0.5;
p.steps = 5;
p.stepPosition = 1;
p.fillColor = 3355443 /* 0x333333 */;
p.forceMultiplier = 2.5;
p.keyCode = null;
p.hitSoundID = "";
p.upSoundID = "";
p.downSoundID = "";
p.isDown = false;
p.direction = 0;
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("flipType", _local1);
_local2.cloneProp("startAngle", _local1);
_local2.cloneProp("endAngle", _local1);
_local2.cloneProp("steps", _local1);
_local2.cloneProp("keyCode", _local1);
_local2.cloneProp("hitSoundID", _local1);
_local2.cloneProp("upSoundID", _local1);
_local2.cloneProp("downSoundID", _local1);
return(_local1);
};
p.flipVertical = function (y) {
var _local1 = this;
super.flipVertical(y, true);
_local1.startAngle = _local1.startAngle * -1;
_local1.rotation = _local1.startAngle;
_local1.endAngle = _local1.endAngle * -1;
_local1.symbolYscale = _local1.symbolYscale * -1;
return(_local1);
};
p.flipHorizontal = function (x) {
var _local1 = this;
super.flipHorizontal(x, true);
_local1.startAngle = Math.PI - _local1.startAngle;
_local1.rotation = _local1.startAngle;
_local1.endAngle = Math.PI - _local1.endAngle;
_local1.symbolYscale = _local1.symbolYscale * -1;
return(_local1);
};
p.rotate = function (a) {
var _local1 = this;
_local1.startAngle = _local1.startAngle + a;
_local1.rotation = _local1.startAngle;
_local1.endAngle = _local1.endAngle + a;
};
p.scale = function (factor) {
super.scale(factor);
};
p._render = function (mc) {
var _local1 = this;
var _local2 = mc;
if (_local1.autoRender) {
_local1.drawShapeAt(_local2, 0, 0, 0);
}
if (_local1.useSymbol) {
_local2.attachMovie(_local1.symbolID, "symbol", 0);
_local2.symbol._xscale = _local1.symbolXScale;
_local2.symbol._yscale = _local1.symbolYScale;
_local2.symbol._alpha = _local1.symbolAlpha;
}
_local1.onRender();
};
p.onRender = function () {
this.mc._rotation = (this.rotation / Math.PI) * 180;
};
p.moveToEnd = function () {
var _local1 = this;
_local1.direction = 1;
if (!_local1.moving) {
_local1.getRoot().addListener(_local1);
}
_local1.moving = true;
_local1.upSound.start();
_local1.broadcastMessage("onFlipperUp", {fixedObject:_local1});
};
p.moveToStart = function () {
var _local1 = this;
_local1.direction = -1;
if (!_local1.moving) {
_local1.getRoot().addListener(_local1);
}
_local1.moving = true;
_local1.downSound.start();
_local1.broadcastMessage("onFlipperDown", {fixedObject:_local1});
};
p.start = function () {
var _local1 = this;
if (_local1.keyCode != null) {
Key.addListener(_local1);
}
_local1.addListener(_local1);
};
p.stop = function () {
var _local1 = this;
Key.removeListener(_local1);
_local1.removeListener(_local1);
};
p.compile = function () {
var _local1 = this;
super.compile();
if (_local1.hitSoundID != "") {
_local1.hitSound = new Sound(_local1.mc);
_local1.hitSound.attachSound(_local1.hitSoundID);
} else {
_local1.hitSound = null;
}
if (_local1.upSoundID != "") {
_local1.upSound = new Sound(_local1.mc);
_local1.upSound.attachSound(_local1.upSoundID);
} else {
_local1.upSound = null;
}
if (_local1.downSoundID != "") {
_local1.downSound = new Sound(_local1.mc);
_local1.downSound.attachSound(_local1.downSoundID);
} else {
_local1.downSound = null;
}
_local1.rotation = _local1.startAngle;
if (_local1.flipType == 0) {
_local1.onBeforeStepPhysics = _local1.onBeforeStepPhysics_type0;
_local1._detectCollision = _local1.__detectCollision;
delete _local1.onCollision;
delete _local1.tweak;
} else {
_local1.onBeforeStepPhysics = _local1.onBeforeStepPhysics_type1;
delete _local1._detectCollision;
_local1.onCollision = _local1._onCollision;
_local1.tweak = _local1._tweak;
}
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local2 = p;
var p1 = new Vector(_local1.flatLength, 0).setAngle(_local1.startAngle).plus(_local2);
var _local3 = new Vector(_local1.flatLength, 0).setAngle(_local1.endAngle).plus(_local2);
if (_local1.isAngleBetween(Math.PI)) {
_local1.xMin = (_local2.x - _local1.flatLength) - _local1.radius2;
} else {
_local1.xMin = Math.min(Math.min(_local2.x - _local1.radius1, p1.x - _local1.radius2), _local3.x - _local1.radius2);
}
if (_local1.isAngleBetween(0)) {
_local1.xMax = (_local2.x + _local1.flatLength) + _local1.radius2;
} else {
_local1.xMax = Math.max(Math.max(_local2.x + _local1.radius1, p1.x + _local1.radius2), _local3.x + _local1.radius2);
}
if (_local1.isAngleBetween(4.71238898038469)) {
_local1.yMin = (_local2.y - _local1.flatLength) - _local1.radius2;
} else {
_local1.yMin = Math.min(Math.min(_local2.y - _local1.radius1, p1.y - _local1.radius2), _local3.y - _local1.radius2);
}
if (_local1.isAngleBetween((Math.PI/2))) {
_local1.yMax = (_local2.y + _local1.flatLength) + _local1.radius2;
} else {
_local1.yMax = Math.max(Math.max(_local2.y + _local1.radius1, p1.y + _local1.radius2), _local3.y + _local1.radius2);
}
};
p.isAngleBetween = function (a) {
var _local1 = a;
var _local3 = this;
var _local2 = Math.min(_local3.startAngle, _local3.endAngle);
var end = Math.max(_local3.startAngle, _local3.endAngle);
while (_local1 < _local2) {
_local1 = _local1 + (Math.PI*2);
}
return(_local1 < end);
};
p.onBeforeStepPhysics_type0 = function () {
var _local1 = this;
if (_local1.direction == 1) {
if (_local1.stepPosition == -1) {
var _local2 = 1;
}
}
if (_local1.direction == -1) {
if (_local1.stepPosition == 1) {
var _local2 = 1;
}
}
if (_local2) {
_local1.getRoot().removeListener(_local1);
_local1.moving = false;
_local1.direction = 0;
} else {
_local1.stepPosition = -_local1.direction;
_local1.rotation = ((_local1.direction == -1) ? (_local1.startAngle) : (_local1.endAngle));
}
_local1.onRender();
};
p.__detectCollision = function (m, p) {
var _local1 = this;
var _local3 = m;
if (!_local1.moving) {
return(super._detectCollision(_local3, p));
}
_local1.rotationSpeed = (_local1.endAngle - _local1.startAngle) * _local1.direction;
var stepSize = (_local1.rotationSpeed / _local1.steps);
var initAngle = ((_local1.direction == 1) ? (_local1.startAngle) : (_local1.endAngle));
var hasHit = false;
var _local2 = 0;
while (_local2 <= _local1.steps) {
_local1.rotation = initAngle + (stepSize * _local2);
var c = super._detectCollision(_local3, p);
if (c) {
_local3.position.plus(_local3.velocity.clone().scale(1 / _local1.steps));
hasHit = true;
}
_local2++;
}
_local1.rotationSpeed = 0;
if (hasHit) {
_local1.hitSound.start();
}
return(hasHit);
};
p.onBeforeStepPhysics_type1 = function () {
var _local1 = this;
if (_local1.direction == 1) {
if (_local1.stepPosition == _local1.steps) {
var _local2 = 1;
}
}
if (_local1.direction == -1) {
if (_local1.stepPosition == 0) {
var _local2 = 1;
}
}
if (_local2) {
_local1.parent.removeListener(_local1);
_local1.moving = false;
_local1.rotationSpeed = 0;
} else {
_local1.stepPosition = _local1.stepPosition + _local1.direction;
_local1.rotationSpeed = ((_local1.endAngle - _local1.startAngle) / _local1.steps) * _local1.direction;
_local1.rotation = _local1.startAngle + (((_local1.endAngle - _local1.startAngle) / _local1.steps) * _local1.stepPosition);
_local1.onRender();
}
};
p._onCollision = function () {
if (this.moving) {
this.hitSound.start();
}
};
p._tweak = function (oc, y) {
var _local1 = this;
var _local2 = oc;
if (_local1.moving) {
if (_local1.direction == 1) {
if (_local1.rotationSpeed > 0) {
if (y > _local2.y) {
_local2.y = _local2.y + _local1.radius2;
}
} else if (y < _local2.y) {
_local2.y = _local2.y - _local1.radius2;
}
}
}
};
p.onKeyDown = function () {
var _local1 = this;
if (_local1.isDown) {
} else if (Key.getCode() != _local1.keyCode) {
} else {
_local1.isDown = true;
_local1.moveToEnd();
}
};
p.onKeyUp = function () {
var _local1 = this;
if (!_local1.isDown) {
} else if (Key.getCode() != _local1.keyCode) {
} else {
_local1.isDown = false;
_local1.moveToStart();
}
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("flipType");
_local1 = _local1 + _local2.exportProp("startAngle");
_local1 = _local1 + _local2.exportProp("endAngle");
_local1 = _local1 + _local2.exportProp("steps");
_local1 = _local1 + _local2.exportProp("keyCode");
_local1 = _local1 + _local2.exportProp("hitSoundID");
_local1 = _local1 + _local2.exportProp("upSoundID");
_local1 = _local1 + _local2.exportProp("downSoundID");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("flipType", _local1);
_local2.importProp("startAngle", _local1);
_local2.importProp("endAngle", _local1);
_local2.importProp("steps", _local1);
_local2.importProp("keyCode", _local1);
_local2.importProp("hitSoundID", _local1, "String");
_local2.importProp("upSoundID", _local1, "String");
_local2.importProp("downSoundID", _local1, "String");
};
var c = ((ICE.RegularPolygon = function (x, y, rotation, radius, sides) {
super(x, y, rotation);
if (sides != null) {
this.sides = sides;
}
if (radius != null) {
this.radius = radius;
}
}));
var p = c.as1_extends(ICE.FixedObject);
p.classString = "RegularPolygon";
p.radius = 100;
p.sides = 5;
p.clone = function () {
var _local1 = super.clone();
this.cloneProp("radius", _local1);
this.cloneProp("sides", _local1);
return(_local1);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
this.radius = this.radius * factor;
return(this);
};
p.flipVertical = function (y) {
super.flipVertical(y);
this.rotation = this.rotation * -1;
return(this);
};
p.flipHorizontal = function (x) {
var _local1 = this;
super.flipHorizontal(x);
_local1.rotation = Math.PI - _local1.rotation;
return(_local1);
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local3 = p;
var _local2 = (Math.PI*2) / _local1.sides;
_local1.xMax = _local3.x + (Math.cos((Math.round((-_local1.rotation) / _local2) * _local2) + _local1.rotation) * _local1.radius);
_local1.xMin = _local3.x + (Math.cos((Math.round((Math.PI - _local1.rotation) / _local2) * _local2) + _local1.rotation) * _local1.radius);
_local1.yMax = _local3.y + (Math.sin((Math.round(((Math.PI/2) - _local1.rotation) / _local2) * _local2) + _local1.rotation) * _local1.radius);
_local1.yMin = _local3.y + (Math.sin((Math.round((4.71238898038469 - _local1.rotation) / _local2) * _local2) + _local1.rotation) * _local1.radius);
};
p._detectCollision = function (b, p) {
var _local2 = this;
var a = (Math.PI / _local2.sides);
var adj = (Math.cos(a) * _local2.radius);
var opp = (Math.sin(a) * _local2.radius);
var _local1 = b.position.clone().minus(p);
var a = _global.fixAngle(_local1.getAngle() - _local2.rotation);
var edgeNum = Math.floor(a / ((Math.PI*2) / _local2.sides));
var _local3 = ((Math.PI*2) * ((edgeNum + 0.5) / _local2.sides)) + _local2.rotation;
_local1.rotate(-_local3);
if (((adj + b.radius) - _local1.x) > 0) {
if (Math.abs(_local1.y) < opp) {
_local1.x = adj;
return(_local2.resolveCollision(b, _local3, _local1.rotate(_local3).plus(p)));
}
var corner = new Vector(adj, opp * ((_local1.y < 0) ? -1 : 1));
var overlap = (b.radius - _global.getDistance(_local1, corner));
if (overlap > 0) {
var ca2 = _global.getAngle(_local1, corner);
return(_local2.resolveCollision(b, _local3 + ca2, corner.rotate(_local3).plus(p)));
}
}
return(undefined);
};
p._drawShapeAt = function (mc, x, y, a) {
mc.drawRegPoly(x, y, this.radius, this.sides, a);
};
p.exportProperties = function () {
var _local1 = super.exportProperties();
_local1 = _local1 + this.exportProp("radius");
_local1 = _local1 + this.exportProp("sides");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
super.importObject(_local1);
this.importProp("radius", _local1);
this.importProp("sides", _local1);
};
var c = ((ICE.ConvexPolygon = function (x, y, rotation, border) {
var _local2 = arguments;
var _local3 = this;
super(x, y, rotation);
if (border != null) {
_local3.border = border;
}
if (_local2.length > 5) {
_local3.points = new Array();
var _local1 = 0;
while (_local1 < (_local2.length - 4)) {
_local3.points.push(_local2[_local1 + 4]);
_local1++;
}
} else {
_local3.points = [new Vector(-30, -30), new Vector(-30, 30), new Vector(30, -30), new Vector(30, 30)];
}
_local3.compile();
}));
var p = c.as1_extends(ICE.FixedObject);
p.classString = "ConvexPolygon";
p.border = 10;
p.points = null;
p.clone = function () {
var _local2 = this;
var _local3 = super.clone();
_local2.cloneProp("border", _local3);
_local3.points = new Array();
var _local1 = 0;
while (_local1 < _local2.points.length) {
_local3.points[_local1] = _local2.points[_local1].clone();
_local1++;
}
return(_local3);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
var _local2 = this;
var _local3 = factor;
super.scale(_local3);
var _local1 = 0;
while (_local1 < _local2.points.length) {
_local2.points[_local1].scale(_local3);
_local1++;
}
_local2.border = _local2.border * _local3;
return(_local2);
};
p.flipVertical = function (y) {
var _local2 = this;
super.flipVertical(y);
var _local1 = 0;
while (_local1 < _local2.points.length) {
_local2.points[_local1].y = _local2.points[_local1].y * -1;
_local1++;
}
_local2.rotation = _local2.rotation * -1;
return(_local2);
};
p.flipHorizontal = function (x) {
var _local2 = this;
super.flipHorizontal(x);
var _local1 = 0;
while (_local1 < _local2.points.length) {
_local2.points[_local1].x = _local2.points[_local1].x * -1;
_local1++;
}
_local2.rotation = _local2.rotation * -1;
return(_local2);
};
p.compile = function () {
super.compile();
var l = this.points.length;
var total = new Vector(0, 0);
var _local2 = 0;
while (_local2 < l) {
total.plus(this.points[_local2]);
_local2++;
}
var mid = ((this.middle = total.scale(1 / l)));
this.points.sort(function (a, b) {
var _local2 = _global.fixAngle(a.clone().minus(mid).getAngle());
var _local1 = _global.fixAngle(b.clone().minus(mid).getAngle());
return(_local2 > _local1);
});
this.segments = new Array();
_local2 = 0;
while (_local2 < l) {
var _local1 = (this.segments[_local2] = new Object());
_local1.p1 = this.points[_local2];
_local1.p2 = this.points[(_local2 + 1) % l];
var p1 = _local1.p1.clone().minus(mid);
var _local3 = _local1.p2.clone().minus(mid);
_local1.startAngle = p1.getAngle();
_local1.endAngle = _local3.getAngle();
while (_local1.startAngle < 0) {
_local1.startAngle = _local1.startAngle + (Math.PI*2);
}
while (_local1.endAngle < _local1.startAngle) {
_local1.endAngle = _local1.endAngle + (Math.PI*2);
}
_local1.lineAngle = _global.getAngle(_local3, p1);
var rp1 = p1.clone().rotate(-_local1.lineAngle);
var rp2 = _local3.clone().rotate(-_local1.lineAngle);
_local1.y = rp1.y;
_local1.x1 = rp1.x;
_local1.x2 = rp2.x;
_local2++;
}
};
p._getDefaultBounds = function (p) {
var _local1 = this;
var _local3 = new Vector(-99999, -99999);
var pMin = new Vector(99999, 99999);
var _local2 = 0;
while (_local2 < _local1.points.length) {
_local3 = Vector.max(_local3, _local1.points[_local2].clone().rotate(_local1.rotation));
var pMin = Vector.min(pMin, _local1.points[_local2].clone().rotate(_local1.rotation));
_local2++;
}
_local3.plus(p);
pMin.plus(p);
_local1.xMin = pMin.x - _local1.border;
_local1.xMax = _local3.x + _local1.border;
_local1.yMin = pMin.y - _local1.border;
_local1.yMax = _local3.y + _local1.border;
};
p._detectCollision = function (m, p) {
var _local2 = this;
var _local3 = m.position.clone().minus(p).rotate(-_local2.rotation).minus(_local2.middle);
var oa = _global.fixAngle(_local3.getAngle());
var i = 0;
var l = _local2.points.length;
while (i < l) {
var _local1 = _local2.segments[i];
var a = ((oa < _local1.startAngle) ? (oa + (Math.PI*2)) : (oa));
if ((_local1.startAngle <= a) && (_local1.endAngle >= a)) {
_local3.rotate(-_local1.lineAngle);
if ((_local3.y + m.radius) > (_local1.y - _local2.border)) {
if ((_local3.x > _local1.x1) && (_local3.x < _local1.x2)) {
_local3.y = _local1.y - _local2.border;
var a = ((_local1.lineAngle - (Math.PI/2)) + _local2.rotation);
var p = _local3.rotate(_local1.lineAngle).plus(_local2.middle).rotate(_local2.rotation).plus(p);
return(_local2.resolveCollision(m, a, p));
}
if ((_local3.x > ((_local1.x1 - m.radius) - _local2.border)) && (_local3.x < ((_local1.x2 + m.radius) + _local2.border))) {
var cp = new Vector(((_local3.x < 0) ? (_local1.x1) : (_local1.x2)), _local1.y);
cp.rotate(_local1.lineAngle).plus(_local2.middle).rotate(_local2.rotation).plus(p);
var c = (new ICE.Circle(cp.x, cp.y, _local2.border));
c.parent = _local2;
c.nested = true;
return(c.detectCollision(m));
}
}
return(false);
}
i++;
}
return(false);
};
p._drawShapeAt = function (mc, x, y, a) {
var _local1 = this;
_local1.compile();
var mid = _local1.middle.clone().rotate(_local1.rotation);
var p0 = _local1.points[0].clone().plus(new Vector(0, _local1.border).setAngle(_local1.segments[0].lineAngle - (Math.PI/2))).rotate(_local1.rotation);
mc.moveTo(p0.x + x, p0.y + y);
var _local3 = 0;
var l = _local1.points.length;
while (_local3 < l) {
var s0 = _local1.segments[_local3];
var s1 = _local1.segments[(_local3 + 1) % l];
var p0 = _local1.points[(_local3 + 1) % l].clone().plus(new Vector(0, _local1.border).setAngle(s0.lineAngle - (Math.PI/2))).rotate(_local1.rotation);
var a0 = ((s0.lineAngle - (Math.PI/2)) + _local1.rotation);
var _local2 = (s1.lineAngle - (Math.PI/2)) + _local1.rotation;
while (_local2 < a0) {
_local2 = _local2 + (Math.PI*2);
}
mc.lineTo(p0.x + x, p0.y + y);
mc.arcTo(a0, _local2, _local1.border);
_local3++;
}
};
p.exportProperties = function () {
var str = super.exportProperties();
str = str + this.exportProp("border");
str = str + " points='";
var _local1 = 0;
var _local3 = this.points.length;
while (_local1 < _local3) {
var _local2 = this.points[_local1];
str = str + ((_local2.x + ",") + _local2.y);
if ((_local1 + 1) < _local3) {
str = str + "|";
}
_local1++;
}
str = str + "'";
return(str);
};
p.importObject = function (o) {
super.importObject(o);
this.importProp("border", o);
this.points = new Array();
var _local3 = o.attributes.points.split("|");
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = _local3[_local1].split(",");
this.points.push(new Vector(parseFloat(_local2[0]), parseFloat(_local2[1])));
_local1++;
}
};
var c = ((ICE.PolyBumper = function (x, y, r) {
super(x, y, r);
}));
var p = c.as1_extends(ICE.ConvexPolygon);
c.uid = 0;
p.classString = "PolyBumper";
p.fillColor = 3355443 /* 0x333333 */;
p.hitSegment = 0;
p.hitForce = 5;
p.hitThreshold = 0;
p.hitSoundID = "";
p.playSymbol = false;
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("hitSegment", _local1);
_local2.cloneProp("hitForce", _local1);
_local2.cloneProp("hitThreshold", _local1);
_local2.cloneProp("hitSoundID", _local1);
_local2.cloneProp("playSymbol", _local1);
return(_local1);
};
p.start = function () {
this.addListener(this);
};
p.stop = function () {
this.removeListener(this);
};
p.rotate = function (a) {
super.rotate(a);
};
p.scale = function (factor) {
super.scale(factor);
};
p.flipVertical = function (y) {
super.flipVertical(y);
};
p.flipHorizontal = function (x) {
super.flipHorizontal(x);
};
p.compile = function () {
var _local1 = this;
super.compile();
if (_local1.hitSoundID != null) {
_local1.hitSound = new Sound(_local1.mc);
_local1.hitSound.attachSound(_local1.hitSoundID);
} else {
_local1.hitSound = null;
}
_local1.bumpAngle = (_local1.segments[_local1.hitSegment].lineAngle - (Math.PI/2)) + _local1.rotation;
};
p.onCollision = function (eo) {
var _local1 = this;
var _local2 = eo;
if (_local2.angle == _local1.bumpAngle) {
if (Math.abs(_local2.bounceSpeed) >= _local1.hitThreshold) {
_local2.movableObject.velocity.plus(new Vector(0, _local1.hitForce).setAngle(_local2.angle));
_local1.hitSound.start();
if (_local1.playSymbol) {
_local1.mc.symbol.play();
}
_local1.broadcastMessage("onBump", _local2);
}
}
};
p._drawShapeAt = function (mc, x, y, a) {
var _local2 = this;
var _local3 = a;
super._drawShapeAt(mc, x, y, _local3);
var pts = [];
var _local1 = 0;
while (_local1 < _local2.points.length) {
pts.push(_local2.points[_local1].clone().rotate(_local3).plus(new Vector(x, y)));
_local1++;
}
var c = mc.createEmptyMovieClip("mid", 1);
c.beginFill(16777215, _local2.fillAlpha / 5);
c.drawPoly(pts);
c.endFill();
var s = _local2.segments[_local2.hitSegment];
var p = new Vector(0, _local2.border).setAngle((s.lineAngle + _local3) - (Math.PI/2));
var p1 = s.p1.clone().rotate(_local3).plus(new Vector(x, y));
var p2 = s.p2.clone().rotate(_local3).plus(new Vector(x, y));
var tp1 = p1.clone().plus(p);
var tp2 = p2.clone().plus(p);
var bmpmc = mc.createEmptyMovieClip("bmp", 2);
bmpmc.beginFill(0, _local2.fillAlpha / 2);
bmpmc.drawPoly([tp1, p1, p2, tp2]);
bmpmc.endFill();
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("hitSegment");
_local1 = _local1 + _local2.exportProp("hitForce");
_local1 = _local1 + _local2.exportProp("hitThreshold");
_local1 = _local1 + _local2.exportProp("hitSoundID");
_local1 = _local1 + _local2.exportProp("playSymbol");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("hitSegment", _local1);
_local2.importProp("hitForce", _local1);
_local2.importProp("hitThreshold", _local1);
_local2.importProp("hitSoundID", _local1, "String");
_local2.importProp("playSymbol", _local1, "Boolean");
};
var c = ((ICE.Tilt = function () {
var _local1 = this;
_local1.position = ((x == null) ? (_local1.position.clone()) : (new Vector(x, y)));
_local1.tiltAmount = _local1.tiltAmount.clone();
_local1.id = ICE.PhysicsObject.uid++;
}));
var p = c.as1_extends(Object);
p.classString = "Tilt";
p.autoRender = true;
p.tiltAmount = new Vector(0, -3);
p.keyCode = 40;
p.position = new Vector(0, 0);
p.start = function () {
var _local1 = this;
Key.addListener(_local1);
_local1.def_y = _local1.root.mc._y;
_local1.def_x = _local1.root.mc._x;
};
p.stop = function () {
var _local1 = this;
Key.removeListener(_local1);
if (_local1.isDown) {
_local1.onKeyUp();
}
};
p.onKeyDown = function () {
var _local1 = this;
if (_local1.isDown) {
} else if (Key.getCode() != _local1.keyCode) {
} else {
_local1.isDown = true;
_local1.direction = 1;
_local1.hasMoved = false;
_local1.getRoot().addListener(_local1);
}
};
p.onKeyUp = function () {
var _local1 = this;
if (Key.getCode() != _local1.keyCode) {
} else {
_local1.isDown = false;
_local1.direction = -1;
_local1.hasMoved = false;
_local1.getRoot().addListener(_local1);
}
};
p.onBeforeStepPhysics = function () {
var _local2 = this;
if (_local2.hasMoved) {
_local2.getRoot().removeListener(_local2);
_local2.getRoot().velocity = new Vector(0, 0);
} else {
var amount = _local2.tiltAmount.clone();
if (_local2.direction == 1) {
_local2.getRoot().mc._x = _local2.def_x + amount.x;
_local2.getRoot().mc._y = _local2.def_y + amount.y;
}
if (_local2.direction == -1) {
_local2.getRoot().mc._x = _local2.def_x;
_local2.getRoot().mc._y = _local2.def_y;
amount.reverse();
}
_local2.getRoot().velocity = amount;
var _local3 = _local2.getRoot().movableObjects;
var _local1 = 0;
while (_local1 < _local3.length) {
_local3[_local1].position.minus(amount);
_local1++;
}
_local2.hasMoved = true;
}
};
p.drawShapeAt = function (mc) {
mc.attachMovie("TiltSymbol", "tilt", 0);
};
p.getBounds = function () {
var _local1 = this;
var _local2 = _local1.mc.getBounds(_local1.getRoot().mc);
_local1.xMin = _local2.xMin;
_local1.xMax = _local2.xMax;
_local1.yMin = _local2.yMin;
_local1.yMax = _local2.yMax;
return(_local1);
};
p.clone = function () {
var _local1 = this;
var _local2 = new ICE.Tilt();
_local2.tiltAmount = _local1.tiltAmount.clone();
_local1.cloneProp("keyCode");
_local1.cloneProp("position");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
_local2.importProp("tiltAmount", _local1, "Vector");
_local2.importProp("keyCode", _local1);
_local2.importProp("position", _local1, "Vector");
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = (" classString='" + _local2.classString) + "'";
_local1 = _local1 + _local2.exportProp("tiltAmount");
_local1 = _local1 + _local2.exportProp("keyCode");
_local1 = _local1 + _local2.exportProp("position");
return(_local1);
};
p.export = function () {
return(("<Tilt " + this.exportProperties()) + " />");
};
p.exportProp = ICE.PhysicsObject.prototype.exportProp;
p.importProp = ICE.PhysicsObject.prototype.importProp;
p.cloneProp = ICE.PhysicsObject.prototype.cloneProp;
p.getLocalBounds = ICE.PhysicsObject.prototype.getLocalBounds;
p.getParentBounds = ICE.PhysicsObject.prototype.getParentBounds;
p.getGlobalPosition = ICE.PhysicsObject.prototype.getGlobalPosition;
p.getRoot = ICE.PhysicsObject.prototype.getRoot;
var c = ((ICE.Decal = function (x, y) {
var _local1 = this;
_local1.position = ((x == null) ? (_local1.position.clone()) : (new Vector(x, y)));
_local1.id = ICE.PhysicsObject.uid++;
}));
var p = c.as1_extends(Object);
p.classString = "Decal";
p.name = "";
p.position = new Vector(0, 0);
p.useSymbol = true;
p.symbolID = "";
p.symbolXScale = 100;
p.symbolYScale = 100;
p.symbolRotation = 0;
p.symbolAlpha = 100;
p.render = function (mc) {
var _local1 = this;
_local1.mc = mc.createEmptyMovieClip("physicsObject_" + _local1.id, _local1.zIndex);
_local1.mc._x = _local1.position.x;
_local1.mc._y = _local1.position.y;
_local1.mc.attachMovie(_local1.symbolID, "symbol", 0);
_local1.mc.symbol._xscale = _local1.symbolXScale;
_local1.mc.symbol._yscale = _local1.symbolYScale;
_local1.mc.symbol._rotation = (_local1.symbolRotation / Math.PI) * 180;
_local1.mc.symbol._alpha = _local1.symbolAlpha;
};
p.flipVertical = function (y) {
var _local1 = this;
if (y != null) {
_local1.position.y = (y * 2) - _local1.position.y;
}
_local1.symbolYScale = _local1.symbolYScale * -1;
_local1.symbolRotation = _local1.symbolRotation * -1;
return(_local1);
};
p.flipHorizontal = function (x) {
var _local1 = this;
if (x != null) {
_local1.position.x = (x * 2) - _local1.position.x;
}
_local1.symbolXScale = _local1.symbolXScale * -1;
_local1.symbolRotation = _local1.symbolRotation * -1;
return(_local1);
};
p.rotate = function (a) {
this.symbolRotation = this.symbolRotation + a;
};
p.scale = function (factor) {
this.symbolXScale = this.symbolXScale * factor;
this.symbolYScale = this.symbolYScale * factor;
};
p.clone = function () {
var _local2 = this;
var _local1 = new _local2.constructor();
_local1.position = _local2.position.clone();
_local2.cloneProp("name", _local1);
_local2.cloneProp("useSymbol", _local1);
_local2.cloneProp("symbolID", _local1);
_local2.cloneProp("symbolXScale", _local1);
_local2.cloneProp("symbolYScale", _local1);
_local2.cloneProp("symbolRotation", _local1);
_local2.cloneProp("symbolAlpha", _local1);
return(_local1);
};
p.getBounds = function () {
var _local1 = this;
_local1.mc.render();
var _local2 = _local1.mc.symbol.getBounds(_local1.getRoot().mc);
_local1.xMin = _local2.xMin;
_local1.xMax = _local2.xMax;
_local1.yMin = _local2.yMin;
_local1.yMax = _local2.yMax;
return(_local1);
};
p.export = function () {
return(("<Decal " + this.exportProperties()) + " />");
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = "";
_local1 = _local1 + _local2.exportProp("name");
_local1 = _local1 + ((" classString='" + _local2.classString) + "'");
_local1 = _local1 + ((((" position='" + _local2.position.x) + ",") + _local2.position.y) + "'");
_local1 = _local1 + _local2.exportProp("useSymbol");
_local1 = _local1 + _local2.exportProp("symbolID");
_local1 = _local1 + _local2.exportProp("symbolXScale");
_local1 = _local1 + _local2.exportProp("symbolYScale");
_local1 = _local1 + _local2.exportProp("symbolRotation");
_local1 = _local1 + _local2.exportProp("symbolAlpha");
return(_local1);
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
_local2.importProp("position", _local1, "Vector");
_local2.importProp("name", _local1, "String");
_local2.importProp("useSymbol", _local1, "Boolean");
_local2.importProp("symbolID", _local1, "String");
_local2.importProp("symbolXScale", _local1);
_local2.importProp("symbolYScale", _local1);
_local2.importProp("symbolRotation", _local1);
_local2.importProp("symbolAlpha", _local1);
};
p.exportProp = ICE.PhysicsObject.prototype.exportProp;
p.importProp = ICE.PhysicsObject.prototype.importProp;
p.cloneProp = ICE.PhysicsObject.prototype.cloneProp;
p.getLocalBounds = ICE.PhysicsObject.prototype.getLocalBounds;
p.getParentBounds = ICE.PhysicsObject.prototype.getParentBounds;
p.getGlobalPosition = ICE.PhysicsObject.prototype.getGlobalPosition;
p.getRoot = ICE.PhysicsObject.prototype.getRoot;
var c = ((ICE.Light = function (x, y) {
super(x, y);
}));
var p = c.as1_extends(ICE.Decal);
p.classString = "Light";
p.state = true;
p.symbolID = "Light";
p.setState = function (state) {
var _local1 = this;
_local1.state = state;
_local1.mc.symbol.gotoAndStop((_local1.state ? "on" : "off"));
};
p.start = function () {
this.initState = this.state;
};
p.stop = function () {
this.setState(this.initState);
};
p.exportProperties = function () {
var _local1 = super.exportProperties();
_local1 = _local1 + this.exportProp("state");
return(_local1);
};
p.importObject = function (o) {
super.importObject(o);
this.importProp("state", o, "Boolean");
};
var c = ((ICE.Container = function () {
this.objects = new Object();
this.depths = new Array();
}));
var p = c.as1_extends(Object);
p.addObject = function (o) {
var _local1 = o;
var _local2 = this;
_local1.parent = _local2;
_local1.root = _local2.root;
_local2.objects[_local1.id] = _local1;
var _local3 = _local2.depths.length;
_local2.depths[_local3] = _local1;
_local1.zIndex = _local3;
return(_local1);
};
p.removeObject = function (o) {
var _local1 = o;
var _local2 = this;
delete _local2.objects[_local1.id];
_local2.depths.splice(_local1.zIndex, 1);
_local2.updateDepths(_local1.zIndex);
return(_local1);
};
p.removeAll = function () {
this.objects = new Object();
this.depths = new Array();
};
p.getObject = function (id) {
return(this.objects[id]);
};
p.getObjectByID = function (id) {
return(this.objects[id]);
};
p.getObjectByDepth = function (d) {
return(this.depths[d]);
};
p.setObjectDepth = function (o, d) {
var _local1 = d;
var _local3 = this;
var l = _local3.depths.length;
if (_local1 < 0) {
_local1 = 0;
}
if (_local1 > (l - 1)) {
_local1 = l - 1;
}
var _local2 = o.zIndex;
_local3.depths.splice(_local2, 1);
_local3.depths.splice(_local1, 0, o);
_local3.updateDepths(Math.min(_local2, _local1), Math.max(_local2, _local1));
};
p.updateDepths = function (start, end) {
var _local2 = this;
var _local3 = end;
if (start == null) {
start = 0;
}
if (_local3 == null) {
_local3 = _local2.depths.length - 1;
}
var _local1 = start;
while (_local1 <= _local3) {
_local2.depths[_local1].zIndex = _local1;
_local2.depths[_local1].mc.swapDepths(_local1);
_local1++;
}
};
p.copyInstanceNames = function (scope) {
var _local2 = this;
for (var _local3 in _local2.objects) {
var _local1 = _local2.objects[_local3];
if (_local1.name != null) {
scope[_local1.name] = _local1;
}
if (_local1.isGroup) {
_local1.copyInstanceNames(_local1);
}
}
};
p.getRoot = function () {
return(this.parent.getRoot());
};
p.exportProp = ICE.PhysicsObject.prototype.exportProp;
p.importProp = ICE.PhysicsObject.prototype.importProp;
p.cloneProp = ICE.PhysicsObject.prototype.cloneProp;
var c = ((ICE.Engine = function () {
var _local1 = this;
super();
_local1.root = _local1;
_local1.gravity = _local1.gravity.clone();
_local1.velocity = _local1.velocity.clone();
ASBroadcaster.initialize(_local1);
}));
var p = c.as1_extends(ICE.Container);
p.airFriction = 0.01;
p.gravity = new Vector(0, 1);
p.velocity = new Vector(0, 0);
p.movableCollisions = true;
p.start = function () {
var _local1 = this;
if (_local1.started) {
} else {
_local1.started = true;
_local1.paused = false;
for (var _local2 in _local1.objects) {
_local1.objects[_local2].start();
}
MovieClip.addListener(_local1);
}
};
p.stop = function () {
var _local1 = this;
if (!_local1.started) {
} else {
_local1.started = false;
for (var _local2 in _local1.objects) {
_local1.objects[_local2].stop();
}
MovieClip.removeListener(_local1);
}
};
p.pause = function () {
var _local1 = this;
if (!_local1.started) {
} else {
_local1.paused = !_local1.paused;
if (_local1.paused) {
MovieClip.removeListener(_local1);
} else {
MovieClip.addListener(_local1);
}
}
};
p.compile = function () {
var _local1 = this;
_local1.copyInstanceNames(_local1);
_local1.fixedObjects = new Object();
_local1.movableObjects = new Array();
for (var _local3 in _local1.objects) {
_local1.compileObject(_local1.objects[_local3]);
}
var _local2 = 0;
_local1.leftBounds = new Array();
_local1.rightBounds = new Array();
_local1.topBounds = new Array();
_local1.bottomBounds = new Array();
for (var _local3 in _local1.fixedObjects) {
var o = _local1.fixedObjects[_local3];
o.getBounds();
_local1.rightBounds[_local2] = (_local1.leftBounds[_local2] = (_local1.bottomBounds[_local2] = (_local1.topBounds[_local2] = o)));
_local2++;
}
_local1.lastIndex = _local2 - 1;
_local1.leftBounds.sort(function (a, b) {
return(a.xMax > b.xMax);
});
_local1.rightBounds.sort(function (a, b) {
return(a.xMin < b.xMin);
});
_local1.topBounds.sort(function (a, b) {
return(a.yMax > b.yMax);
});
_local1.bottomBounds.sort(function (a, b) {
return(a.yMin < b.yMin);
});
var _local3 = 0;
var l = _local1.movableObjects.length;
while (_local3 < l) {
_local1.compileMovableObject(_local1.movableObjects[_local3]);
_local3++;
}
_local1.updateMovableObjects();
};
p.render = function (mc) {
var _local1 = this;
var _local2 = mc;
_local1.mc = _local2;
for (var _local3 in _local1.objects) {
_local1.objects[_local3].render(_local2);
}
};
p.renderBounds = function (mc) {
var _local2 = mc;
var _local3 = this;
for (var i in _local3.objects) {
var _local1 = _local3.objects[i];
_local2.lineStyle(1, 1193046);
_local2.moveTo(_local1.xMin, _local1.yMin);
_local2.lineTo(_local1.xMin, _local1.yMax);
_local2.lineTo(_local1.xMax, _local1.yMax);
_local2.lineTo(_local1.xMax, _local1.yMin);
_local2.lineTo(_local1.xMin, _local1.yMin);
}
};
p.getGlobalPosition = function () {
return(new Vector(0, 0));
};
p.getRoot = function () {
return(this);
};
p.stepPhysics = (p.onEnterFrame = function () {
this.broadcastMessage("onBeforeStepPhysics", {engine:this});
var m = this.activeMovableObjects;
var ml = m.length;
var i = 0;
while (i < ml) {
var o = m[i];
o.velocity.plus(this.gravity);
o.velocity.scale(1 - this.airFriction);
o.position.plus(o.velocity);
o.rotationSpeed = o.rotationSpeed * (1 - o.rotationFriction);
o.rotation = o.rotation + o.rotationSpeed;
i++;
}
if (this.movableCollisions) {
var i = 0;
while (i < (ml - 1)) {
var j = (i + 1);
while (j < ml) {
if (m[i].level == m[j].level) {
m[i].detectCollision(m[j]);
}
j++;
}
i++;
}
}
var i = 0;
while (i < ml) {
var _local1 = m[i];
var dl = ((_local1.position.x - _local1.radius) - _local1.xMin);
var dr = ((_local1.position.x + _local1.radius) - _local1.xMax);
var dt = ((_local1.position.y - _local1.radius) - _local1.yMin);
var db = ((_local1.position.y + _local1.radius) - _local1.yMax);
if ((dl + dr) < 0) {
this.moveLeftBound(_local1, dl);
this.moveRightBound(_local1, dr);
} else {
this.moveRightBound(_local1, dr);
this.moveLeftBound(_local1, dl);
}
if ((dt + db) < 0) {
this.moveTopBound(_local1, dt);
this.moveBottomBound(_local1, db);
} else {
this.moveBottomBound(_local1, db);
this.moveTopBound(_local1, dt);
}
var cs = new Object();
var newc = new Object();
var oldc = _local1.contacts;
var f = _local1.activeObjects;
for (var j in f) {
var _local2 = f[j];
if (_local2.enabled) {
if (_local2.levels[_local1.level]) {
if (_local2.detectCollision(_local1)) {
var _local3 = _local2.id;
cs[_local3] = _local2;
if (oldc[_local3] == null) {
newc[_local3] = _local2;
} else {
delete oldc[_local3];
}
}
}
}
}
for (var k in oldc) {
oldc[k].broadcastMessage("onExit", {fixedObject:oldc[k], movableObject:_local1});
}
for (var k in newc) {
newc[k].broadcastMessage("onEnter", {fixedObject:newc[k], movableObject:_local1});
}
_local1.contacts = cs;
i++;
}
this.broadcastMessage("onAfterStepPhysics", {engine:this});
});
p.compileObject = function (o) {
var _local1 = o;
var _local2 = this;
_local1.compile();
if (_local1 instanceof ICE.Group) {
for (var _local3 in _local1.objects) {
_local2.compileObject(_local1.objects[_local3]);
}
} else if (_local1 instanceof ICE.FixedObject) {
_local2.addFixedObject(_local1);
} else if (_local1 instanceof ICE.MovableObject) {
_local2.addMovableObject(_local1);
}
};
p.compileMovableObject = function (obj) {
var _local2 = obj;
var _local3 = this;
_local2.xMin = -10000;
_local2.xMax = 10000;
_local2.yMin = -10000;
_local2.yMax = 10000;
_local2.activeObjects = new Object();
_local2.rightIndex = -1;
_local2.leftIndex = -1;
_local2.bottomIndex = -1;
_local2.topIndex = -1;
for (var i in _local3.fixedObjects) {
var _local1 = _local3.fixedObjects[i];
_local1.vActive[_local2.id] = true;
_local1.hActive[_local2.id] = true;
_local2.activeObjects[_local1.id] = _local1;
}
};
p.updateMovableObjects = function () {
var _local3 = (this.activeMovableObjects = new Array());
var _local2 = this.movableObjects;
var l = ((l = _local2.length));
var _local1 = 0;
while (_local1 < l) {
if (_local2[_local1].enabled) {
_local3.push(_local2[_local1]);
}
_local1++;
}
};
p.addMovableObject = function (obj) {
this.movableObjects.push(obj);
return(obj);
};
p.addFixedObject = function (obj) {
var _local1 = obj;
this.fixedObjects[_local1.id] = _local1;
_local1.vActive = new Object();
_local1.hActive = new Object();
return(_local1);
};
p.moveLeftBound = function (o, x) {
var _local1 = o;
var _local3 = this;
_local1.xMin = _local1.xMin + x;
if (x < 0) {
while (_local1.leftIndex > -1) {
var _local2 = _local3.leftBounds[_local1.leftIndex];
if (_local2.xMax > _local1.xMin) {
_local2.hActive[_local1.id] = true;
_local1.leftIndex--;
if (_local2.vActive[_local1.id]) {
_local1.activeObjects[_local2.id] = _local2;
}
} else {
break;
}
}
} else {
while (_local1.leftIndex < _local3.lastIndex) {
var _local2 = _local3.leftBounds[_local1.leftIndex + 1];
if (_local2.xMax < _local1.xMin) {
_local2.hActive[_local1.id] = false;
_local1.leftIndex++;
if (_local2.vActive[_local1.id]) {
delete _local1.activeObjects[_local2.id];
}
} else {
return;
}
}
}
};
p.moveRightBound = function (o, x) {
var _local1 = o;
var _local3 = this;
_local1.xMax = _local1.xMax + x;
if (x < 0) {
while (_local1.rightIndex < _local3.lastIndex) {
var _local2 = _local3.rightBounds[_local1.rightIndex + 1];
if (_local2.xMin > _local1.xMax) {
_local2.hActive[_local1.id] = false;
_local1.rightIndex++;
if (_local2.vActive[_local1.id]) {
delete _local1.activeObjects[_local2.id];
}
} else {
break;
}
}
} else {
while (_local1.rightIndex > -1) {
var _local2 = _local3.rightBounds[_local1.rightIndex];
if (_local2.xMin < _local1.xMax) {
_local2.hActive[_local1.id] = true;
_local1.rightIndex--;
if (_local2.vActive[_local1.id]) {
_local1.activeObjects[_local2.id] = _local2;
}
} else {
return;
}
}
}
};
p.moveTopBound = function (o, y) {
var _local1 = o;
var _local3 = this;
_local1.yMin = _local1.yMin + y;
if (y < 0) {
while (_local1.topIndex > -1) {
var _local2 = _local3.topBounds[_local1.topIndex];
if (_local2.yMax > _local1.yMin) {
_local2.vActive[_local1.id] = true;
_local1.topIndex--;
if (_local2.hActive[_local1.id]) {
_local1.activeObjects[_local2.id] = _local2;
}
} else {
break;
}
}
} else {
while (_local1.topIndex < _local3.lastIndex) {
var _local2 = _local3.topBounds[_local1.topIndex + 1];
if (_local2.yMax < _local1.yMin) {
_local2.vActive[_local1.id] = false;
_local1.topIndex++;
if (_local2.hActive[_local1.id]) {
delete _local1.activeObjects[_local2.id];
}
} else {
return;
}
}
}
};
p.moveBottomBound = function (o, y) {
var _local1 = o;
var _local3 = this;
_local1.yMax = _local1.yMax + y;
if (y < 0) {
while (_local1.bottomIndex < _local3.lastIndex) {
var _local2 = _local3.bottomBounds[_local1.bottomIndex + 1];
if (_local2.yMin > _local1.yMax) {
_local2.vActive[_local1.id] = false;
_local1.bottomIndex++;
if (_local2.hActive[_local1.id]) {
delete _local1.activeObjects[_local2.id];
}
} else {
break;
}
}
} else {
while (_local1.bottomIndex > -1) {
var _local2 = _local3.bottomBounds[_local1.bottomIndex];
if (_local2.yMin < _local1.yMax) {
_local2.vActive[_local1.id] = true;
_local1.bottomIndex--;
if (_local2.hActive[_local1.id]) {
_local1.activeObjects[_local2.id] = _local2;
}
} else {
return;
}
}
}
};
p.export = function () {
var _local2 = this;
var _local3 = ("<Engine" + _local2.exportProperties()) + ">";
_local3 = _local3 + "<Objects>";
var _local1 = 0;
while (_local1 < _local2.depths.length) {
_local3 = _local3 + _local2.depths[_local1].export();
_local1++;
}
_local3 = _local3 + "</Objects>";
_local3 = _local3 + "</Engine>";
return(_local3);
};
p.exportProperties = function () {
var _local1 = "";
_local1 = _local1 + this.exportProp("airFriction");
_local1 = _local1 + this.exportProp("gravity");
_local1 = _local1 + ((" bounceFriction='" + ICE.FixedObject.prototype.bounceFriction) + "'");
_local1 = _local1 + ((" slidingFriction='" + ICE.FixedObject.prototype.slidingFriction) + "'");
return(_local1);
};
p.import = function (o) {
this.importProp("gravity", o, "Vector");
this.importProp("airFriction", o);
var fo = o.Objects.childNodes;
var _local1 = 0;
var l = fo.length;
while (_local1 < l) {
var _local2 = fo[_local1].attributes;
var _local3 = new ICE[_local2[((_local2.class != null) ? "class" : "classString")]]();
_local3.importObject(fo[_local1]);
this.addObject(_local3);
_local1++;
}
ICE.FixedObject.prototype.bounceFriction = parseFloat(o.attributes.bounceFriction);
ICE.FixedObject.prototype.slidingFriction = parseFloat(o.attributes.slidingFriction);
};
p.load = function (url) {
var _local1 = this;
_local1.loader = new XML();
_local1.loader.parent = _local1;
_local1.loader.ignoreWhite = true;
_local1.loader.load(url);
_local1.loader.onLoad = function (success) {
var _local1 = this;
_local1.parent.import(_local1.firstChild);
_local1.parent.onLoad(success);
};
};
var c = ((ICE.Group = function (x, y) {
super();
this.position = new Vector(x, y);
this.id = ICE.PhysicsObject.uid++;
}));
var p = c.as1_extends(ICE.Container);
p.classString = "Group";
p.isGroup = true;
p.isGrouped = false;
p.parentGroup = null;
p.addObject = function (o) {
var _local1 = o;
super.addObject(_local1);
_local1.isGrouped = true;
_local1.parentGroup = this;
return(_local1);
};
p.removeObject = function (o) {
var _local1 = o;
super.removeObject(_local1);
_local1.isGrouped = false;
delete _local1.parentGroup;
};
p.setProperties = function (o) {
var _local1 = o;
var _local2 = this;
for (var _local3 in _local1) {
_local2[_local3] = _local1[_local3];
}
};
p.copyProperty = function (name, o) {
var _local1 = name;
if (this[_local1] != null) {
o[_local1] = this[_local1];
}
};
p.compile = function () {
var _local1 = this;
for (var _local2 in _local1.objects) {
_local1.objects[_local2].compile();
}
};
p.start = function () {
var _local1 = this;
for (var _local2 in _local1.objects) {
_local1.objects[_local2].start();
}
};
p.stop = function () {
var _local1 = this;
for (var _local2 in _local1.objects) {
_local1.objects[_local2].stop();
}
};
p.clone = function () {
var _local1 = this;
var _local2 = new _local1.constructor(_local1.position.x, _local1.position.y);
_local2.position = _local1.position.clone();
_local1.cloneProp("name", _local2);
for (var _local3 in _local1.objects) {
_local2.addObject(_local1.objects[_local3].clone());
}
return(_local2);
};
p.flipVertical = function (y) {
var _local1 = this;
var _local3 = y;
if (_local3 == null) {
_local3 = _local1.position.y;
}
for (var _local2 in _local1.objects) {
_local1.objects[_local2].flipVertical(0);
}
if (_local3 != null) {
_local1.position.y = (_local3 * 2) - _local1.position.y;
}
return(_local1);
};
p.flipHorizontal = function (x) {
var _local1 = this;
var _local3 = x;
if (_local3 == null) {
_local3 = _local1.position.x;
}
for (var _local2 in _local1.objects) {
_local1.objects[_local2].flipHorizontal(0);
}
if (_local3 != null) {
_local1.position.x = (_local3 * 2) - _local1.position.x;
}
return(_local1);
};
p.scale = function (factor) {
var _local1 = this;
var _local2 = factor;
for (var _local3 in _local1.objects) {
_local1.objects[_local3].scale(_local2);
_local1.objects[_local3].position.scale(_local2);
}
};
p.rotate = function (a) {
var _local1 = this;
var _local2 = a;
for (var _local3 in _local1.objects) {
_local1.objects[_local3].rotate(_local2);
_local1.objects[_local3].position.rotate(_local2);
}
};
p.getGlobalPosition = function () {
var _local1 = this;
if (!_local1.isGrouped) {
return(_local1.position.clone());
}
return(_local1.position.clone().plus(_local1.parentGroup.getGlobalPosition()));
};
p.render = function (mc) {
var _local1 = this;
_local1.mc = mc.createEmptyMovieClip("physicsObject_" + _local1.id, _local1.zIndex);
_local1.mc._x = _local1.position.x;
_local1.mc._y = _local1.position.y;
for (var _local2 in _local1.objects) {
_local1.objects[_local2].render(_local1.mc);
}
};
p.getBounds = function () {
var _local1 = this;
_local1.xMin = 999999 /* 0x0F423F */;
_local1.xMax = -999999;
_local1.yMin = 999999 /* 0x0F423F */;
_local1.yMax = -999999;
var _local2 = _local1.objects;
for (var _local3 in _local2) {
_local2[_local3].getBounds();
_local1.xMin = Math.min(_local1.xMin, _local2[_local3].xMin);
_local1.xMax = Math.max(_local1.xMax, _local2[_local3].xMax);
_local1.yMin = Math.min(_local1.yMin, _local2[_local3].yMin);
_local1.yMax = Math.max(_local1.yMax, _local2[_local3].yMax);
}
return(_local1);
};
p.getLocalBounds = function () {
var _local3 = this;
var _local2 = _local3.getGlobalPosition();
var _local1 = new Object();
_local1.xMin = _local3.xMin - _local2.x;
_local1.xMax = _local3.xMax - _local2.x;
_local1.yMin = _local3.yMin - _local2.y;
_local1.yMax = _local3.yMax - _local2.y;
return(_local1);
};
p.getParentBounds = function () {
var _local2 = this;
var _local1 = _local2.getLocalBounds();
_local1.xMin = _local1.xMin + _local2.position.x;
_local1.xMax = _local1.xMax + _local2.position.x;
_local1.yMin = _local1.yMin + _local2.position.y;
_local1.yMax = _local1.yMax + _local2.position.y;
return(_local1);
};
p.importObject = function (o) {
this.importProp("position", o, "Vector");
this.importProp("name", o, "String");
var fo = o.Objects.childNodes;
var _local1 = 0;
while (_local1 < fo.length) {
var _local2 = fo[_local1].attributes;
var _local3 = new ICE[_local2[((_local2.class != null) ? "class" : "classString")]]();
_local3.importObject(fo[_local1]);
this.addObject(_local3);
_local1++;
}
};
p.export = function () {
return(((("<Group" + this.exportProperties()) + ">\n") + this.exportChildNodes()) + "</Group>\n");
};
p.exportChildNodes = function () {
return(this.exportObjects());
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = (" classString='" + _local2.classString) + "'";
_local1 = _local1 + _local2.exportProp("name");
_local1 = _local1 + _local2.exportProp("position");
return(_local1);
};
p.exportObjects = function () {
var _local2 = this;
var _local3 = "<Objects>";
var _local1 = 0;
while (_local1 < _local2.depths.length) {
_local3 = _local3 + ((" " + _local2.depths[_local1].export()) + newline);
_local1++;
}
_local3 = _local3 + "</Objects>";
return(_local3);
};
var c = ((ICE.MultiShape = function (x, y, a) {
super(x, y, a);
}));
var p = c.as1_extends(ICE.Group);
p.isGroup = false;
p.__resolve = function (name) {
return(ICE.FixedObject.prototype[name]);
};
p.inheritProp = function (name) {
var _local1 = this;
var _local2 = name;
if (_local1[_local2] != _local1.__proto__[_local2]) {
for (var _local3 in _local1.objects) {
_local1.objects[_local3][_local2] = _local1[_local2];
}
}
};
p.clone = function () {
var _local2 = this;
var _local1 = super.clone();
_local2.cloneProp("bounceFriction", _local1);
_local2.cloneProp("slidingFriction", _local1);
_local2.cloneProp("useSymbol", _local1);
_local2.cloneProp("symbolID", _local1);
_local2.cloneProp("symbolScale", _local1);
_local2.cloneProp("symbolRotation", _local1);
_local2.cloneProp("symbolAlpha", _local1);
_local2.cloneProp("fillColor", _local1);
_local2.cloneProp("fillAlpha", _local1);
_local2.cloneProp("lineWidth", _local1);
_local2.cloneProp("lineColor", _local1);
_local2.cloneProp("lineAlpha", _local1);
_local2.cloneProp("startLevel", _local1);
_local2.cloneProp("endLevel", _local1);
_local2.cloneProp("enabled", _local1);
_local2.cloneProp("transparent", _local1);
return(_local1);
};
p.compile = function () {
var _local1 = this;
_local1.inheritProp("bounceFriction");
_local1.inheritProp("slidingFriction");
_local1.inheritProp("fillColor");
_local1.inheritProp("fillAlpha");
_local1.inheritProp("lineWidth");
_local1.inheritProp("lineColor");
_local1.inheritProp("lineAlpha");
_local1.inheritProp("startLevel");
_local1.inheritProp("endLevel");
_local1.inheritProp("enabled");
_local1.inheritProp("transparent");
super.compile();
};
p.render = function (mc) {
var _local1 = this;
_local1.mc = mc.createEmptyMovieClip("physicsObject_" + _local1.id, _local1.zIndex);
_local1.mc._x = _local1.position.x;
_local1.mc._y = _local1.position.y;
if (_local1.autoRender) {
_local1.drawShapeAt(_local1.mc, 0, 0);
}
if (_local1.useSymbol) {
_local1.mc.attachMovie(_local1.symbolID, "symbol", 0);
_local1.mc.symbol._xscale = _local1.symbolXScale;
_local1.mc.symbol._yscale = _local1.symbolYScale;
_local1.mc.symbol._rotation = (_local1.symbolRotation / Math.PI) * 180;
_local1.mc.symbol._alpha = _local1.symbolAlpha;
}
};
p.scale = function (factor) {
this.symbolXScale = this.symbolXScale * factor;
this.symbolYScale = this.symbolYScale * factor;
};
p.rotate = function (a) {
this.symbolRotation = this.symbolRotation + a;
};
p.flipVertical = function (y) {
var _local1 = this;
if (y != null) {
_local1.position.y = (y * 2) - _local1.position.y;
}
_local1.symbolYScale = _local1.symbolYScale * -1;
return(_local1);
};
p.flipHorizontal = function (x) {
var _local1 = this;
if (x != null) {
_local1.position.x = (x * 2) - _local1.position.x;
}
_local1.symbolXScale = _local1.symbolXScale * -1;
return(_local1);
};
p.drawShape = function (mc) {
var _local1 = this;
_local1.drawShapeAt(mc, _local1.position.x, _local1.position.y);
};
p.drawShapeAt = function (mc, x, y) {
var _local2 = this;
var _local3 = mc;
for (var i in _local2.objects) {
var _local1 = _local2.objects[i];
_local1.drawShapeAt(_local3, x + _local1.position.x, y + _local1.position.y, _local1.rotation);
}
};
p.importObject = function (o) {
var _local1 = o;
var _local2 = this;
super.importObject(_local1);
_local2.importProp("bounceFriction", _local1);
_local2.importProp("slidingFriction", _local1);
_local2.importProp("useSymbol", _local1, "Boolean");
_local2.importProp("symbolID", _local1);
_local2.importProp("symbolScale", _local1);
_local2.importProp("symbolRotation", _local1);
_local2.importProp("symbolAlpha", _local1);
_local2.importProp("autoRender", _local1, "Boolean");
_local2.importProp("fillColor", _local1, "Color");
_local2.importProp("fillAlpha", _local1);
_local2.importProp("lineWidth", _local1);
_local2.importProp("lineColor", _local1, "Color");
_local2.importProp("lineAlpha", _local1);
_local2.importProp("startLevel", _local1);
_local2.importProp("endLevel", _local1);
_local2.importProp("enabled", _local1, "Boolean");
_local2.importProp("transparent", _local1, "Boolean");
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("bounceFriction");
_local1 = _local1 + _local2.exportProp("slidingFriction");
_local1 = _local1 + _local2.exportProp("useSymbol");
_local1 = _local1 + _local2.exportProp("symbolID");
_local1 = _local1 + _local2.exportProp("symbolScale");
_local1 = _local1 + _local2.exportProp("symbolRotation");
_local1 = _local1 + _local2.exportProp("symbolAlpha");
_local1 = _local1 + _local2.exportProp("autoRender");
_local1 = _local1 + _local2.exportProp("fillColor", "Color");
_local1 = _local1 + _local2.exportProp("fillAlpha");
_local1 = _local1 + _local2.exportProp("lineWidth", "Color");
_local1 = _local1 + _local2.exportProp("lineColor");
_local1 = _local1 + _local2.exportProp("lineAlpha");
_local1 = _local1 + _local2.exportProp("startLevel");
_local1 = _local1 + _local2.exportProp("endLevel");
_local1 = _local1 + _local2.exportProp("enabled");
_local1 = _local1 + _local2.exportProp("transparent");
return(_local1);
};
var c = ((ICE.Tube = function (x, y, a) {
var _local1 = this;
super(x, y, a);
_local1.segments = new Array();
_local1.appendSegment();
var _local2 = _local1.appendSegment();
_local2.type = 1;
}));
var p = c.as1_extends(ICE.MultiShape);
p.classString = "Tube";
p.rotation = 0;
p.width = 50;
p.wallWidth = 10;
p.clone = function () {
var o = super.clone();
o.segments = new Array();
var _local1 = 0;
while (_local1 < this.segments.length) {
var _local2 = this.segments[_local1];
var _local3 = (o.segments[_local1] = new Object());
for (var j in _local2) {
_local3[j] = _local2[j];
}
_local1++;
}
this.cloneProp("rotation", o);
this.cloneProp("width", o);
this.cloneProp("wallWidth", o);
return(o);
};
p.insertSegment = function (index) {
var _local1 = {type:0, len:100, radius:100, angle:(Math.PI/4), left:true, right:true};
this.segments.splice(index, 0, _local1);
return(_local1);
};
p.appendSegment = function () {
return(this.insertSegment(this.segments.length));
};
p.removeSegment = function (index) {
this.segments.splice(index, 1);
};
p.flipVertical = function (y) {
var _local1 = this;
super.flipVertical(y);
_local1.rotation = Math.PI - _local1.rotation;
_local1.mirror();
return(_local1);
};
p.flipHorizontal = function (x) {
var _local1 = this;
super.flipHorizontal(x);
_local1.rotation = _local1.rotation * -1;
_local1.mirror();
return(_local1);
};
p.mirror = function () {
var _local2 = 0;
while (_local2 < this.segments.length) {
var _local1 = this.segments[_local2];
_local1.radius = _local1.radius * -1;
var _local3 = _local1.left;
_local1.left = _local1.right;
_local1.right = _local3;
_local2++;
}
};
p.scale = function (factor) {
var _local3 = this;
super.scale(factor);
var _local2 = 0;
while (_local2 < _local3.segments.length) {
var _local1 = _local3.segments[_local2];
if (_local1.type == 0) {
_local1.len = _local1.len * factor;
} else {
_local1.radius = _local1.radius * factor;
}
_local2++;
}
_local3.width = _local3.width * factor;
_local3.wallWidth = _local3.wallWidth * factor;
return(_local3);
};
p.rotate = function (a) {
super.rotate(a);
this.rotation = this.rotation + a;
return(this);
};
p.compile = function () {
this.removeAll();
this.renderPieces = new Array();
var p = new Vector(0, 0);
var a = this.rotation;
var _local2 = this.width;
var t = this.wallWidth;
var i = 0;
var l = this.segments.length;
while (i < l) {
var _local1 = this.segments[i];
_local1.leftWall = null;
_local1.rightWall = null;
if (_local1.type == 0) {
var p1 = new Vector((_local2 / 2) + (t / 2), _local1.len / 2).rotate(a).plus(p);
var p2 = new Vector(((-_local2) / 2) - (t / 2), _local1.len / 2).rotate(a).plus(p);
var pm = new Vector(0, _local1.len / 2).rotate(a).plus(p);
if (_local1.left) {
var lw = (new ICE.Rectangle(p1.x, p1.y, a, t, _local1.len));
this.addObject(lw);
_local1.leftWall = lw;
}
if (_local1.right) {
var rw = (new ICE.Rectangle(p2.x, p2.y, a, t, _local1.len));
this.addObject(rw);
_local1.rightWall = rw;
}
this.renderPieces.push(new ICE.Rectangle(pm.x, pm.y, a, _local2, _local1.len));
var p = new Vector(0, _local1.len).rotate(a).plus(p);
} else {
var _local3 = new Vector(_local1.radius, 0).rotate(a).plus(p);
var a0 = (a + ((_local1.radius > 0) ? (Math.PI - _local1.angle) : 0));
var absr = Math.abs(_local1.radius);
if (_local1.left) {
var lw = (new ICE.Ring(_local3.x, _local3.y, a0, _local1.angle, (absr - (_local2 / 2)) - t, absr - (_local2 / 2), false));
this.addObject(lw);
_local1.leftWall = lw;
}
if (_local1.right) {
var rw = (new ICE.Ring(_local3.x, _local3.y, a0, _local1.angle, absr + (_local2 / 2), (absr + (_local2 / 2)) + t, false));
this.addObject(rw);
_local1.rightWall = rw;
}
this.renderPieces.push(new ICE.Ring(_local3.x, _local3.y, a0, _local1.angle, absr - (_local2 / 2), absr + (_local2 / 2)));
var a = (a + (((_local1.radius < 0) ? 1 : -1) * _local1.angle));
var p = _local3.plus(new Vector(absr, 0).setAngle(((_local1.radius > 0) ? (Math.PI + a) : (a))));
}
i++;
}
super.compile();
};
p.drawShapeAt = function (mc, x, y) {
var _local2 = this;
var _local3 = mc;
super.drawShapeAt(_local3, x, y);
for (var i in _local2.renderPieces) {
var _local1 = _local2.renderPieces[i].clone();
_local1.fillColor = _local2.fillColor;
_local1.fillAlpha = _local2.fillAlpha / 5;
_local1.drawShapeAt(_local3, x + _local1.position.x, y + _local1.position.y, _local1.rotation);
}
};
p.importObject = function (o) {
super.importObject(o);
this.importProp("rotation", o);
this.importProp("width", o);
this.importProp("wallWidth", o);
var segs = o.Segments.childNodes;
this.segments = new Array();
var l = segs.length;
var _local3 = 0;
while (_local3 < l) {
var _local2 = segs[_local3].attributes;
var _local1 = this.appendSegment();
_local1.type = parseInt(_local2.type);
_local1.left = ((_local2.left == "true") ? true : false);
_local1.right = ((_local2.right == "true") ? true : false);
_local1.len = parseFloat(_local2.len);
_local1.radius = parseFloat(_local2.radius);
_local1.angle = parseFloat(_local2.angle);
_local3++;
}
};
p.exportChildNodes = function () {
var l = this.segments.length;
var _local3 = "<Segments>";
var _local2 = 0;
while (_local2 < l) {
var _local1 = this.segments[_local2];
_local3 = _local3 + (((((("<Segment type='" + _local1.type) + "' left='") + _local1.left) + "' right='") + _local1.right) + "' ");
_local3 = _local3 + (((((("len='" + _local1.len) + "' radius='") + _local1.radius) + "' angle='") + _local1.angle) + "' />");
_local2++;
}
_local3 = _local3 + "</Segments>";
return(_local3);
};
p.exportProperties = function () {
var _local2 = this;
var _local1 = super.exportProperties();
_local1 = _local1 + _local2.exportProp("rotation");
_local1 = _local1 + _local2.exportProp("width");
_local1 = _local1 + _local2.exportProp("wallWidth");
return(_local1);
};
delete p;
delete c;
if (!_root.qualchanged) {
_root.qual = 2;
}
_root.endgame._visible = 0;
var engine = (new ICE.Engine());
engine.onLoad = function () {
init();
};
engine.load("/userassets/256000/256300/hansen.xml");
mainVolume = new Sound(this);
mainVolume.setVolume(100);
gameSound = new Sound(this);
gameSound.attachSound("ingameloop");
gameSound.start(0, 99999);
var p = ReboundSystem.prototype;
p.isOpen = true;
p.open = function () {
var _local2 = this;
_local2.isOpen = true;
_local2.inner.enabled = false;
_local2.outer.enabled = true;
var _local1 = 0;
while (_local1 < _local2.door.length) {
_local2.door[_local1].enabled = true;
_local2.door[_local1].mc._visible = true;
_local1++;
}
};
p.close = function () {
var _local2 = this;
var _local3 = _root;
_local2.isOpen = false;
_local2.inner.enabled = true;
_local2.outer.enabled = false;
var _local1 = 0;
while (_local1 < _local2.door.length) {
_local2.door[_local1].enabled = false;
_local2.door[_local1].mc._visible = false;
_local3.score = _local3.score + 1500;
_local1++;
}
};
var p = TargetGroup.prototype;
p.reset = function () {
this.setState(true);
};
p.setState = function (state) {
this.group.target1.setState(state);
this.group.target2.setState(state);
};
p.onSwitch = function () {
var _local1 = this;
if (_local1.isComplete()) {
if (_local1.autoReset) {
_local1.reset();
}
_local1.onComplete();
}
};
p.isComplete = function () {
return(!this.group.target1.state);
};
sides.swapDepths(199);
goalkeeper.swapDepths(200);
scoreboard.swapDepths(201);
endgame.swapDepths(1000);
sb.swapDepths(202);
_root.foot_start_point = _root.foot_area._y;
stop();
Instance of Symbol 325 MovieClip "qqq" in Frame 6
onClipEvent (load) {
this.swapDepths(300);
_root.qqq.qu.gotoAndStop("qual" + _root.qual);
}
Symbol 29 MovieClip [flagman] Frame 1
stop();
Symbol 29 MovieClip [flagman] Frame 2
_root.score = _root.score - 250;
Symbol 35 MovieClip [circle2] Frame 1
stop();
Symbol 35 MovieClip [circle2] Frame 2
_root.score = _root.score + 500;
Symbol 37 MovieClip [PolyBumper] Frame 1
stop();
Symbol 40 MovieClip [Light] Frame 1
stop();
Symbol 44 MovieClip [CircleBumper] Frame 1
stop();
Symbol 86 MovieClip [goal-light] Frame 1
stop();
Symbol 86 MovieClip [goal-light] Frame 2
tellTarget (_root.scoreboard) {
gotoAndPlay ("goal");
};
_root.score = _root.score + 5000;
Symbol 93 MovieClip [bluebutton] Frame 1
stop();
Symbol 104 Button
on (press) {
getURL ("http://www.mob.tv/music", "_blank");
}
Symbol 107 Button
on (press) {
getURL ("http://www.mob.tv", "_blank");
}
Symbol 111 Button
on (press) {
getURL ("http://www.matmi.com", "_blank");
}
Symbol 113 Button
on (press) {
getURL ("http://www.matmi.com", "_blank");
}
Symbol 115 Button
on (press) {
getURL ("http://www.mob.tv", "_blank");
}
Symbol 118 Button
on (press) {
getURL ("http://www.mob.tv/music", "_blank");
}
Symbol 121 Button
on (press) {
getURL ("http://www.matmi.com", "_blank");
}
Symbol 124 Button
on (press) {
getURL ("http://www.mob.tv", "_blank");
}
Symbol 136 MovieClip [tunnelbrawl] Frame 1
stop();
Symbol 136 MovieClip [tunnelbrawl] Frame 2
_root.scoreboard.gotoAndPlay("tunnel");
Symbol 155 MovieClip Frame 1
gotoAndStop("LooseLife" + _root.looselife);
stop();
Symbol 155 MovieClip Frame 2
stop();
Symbol 161 MovieClip [refmain] Frame 1
stop();
Symbol 161 MovieClip [refmain] Frame 2
_root.score = _root.score - 500;
if (_root.ballNum < 4) {
if (_root.looselife == 1) {
_root.ballNum++;
tellTarget (_root.scoreboard) {
gotoAndPlay ("Foul2Frame");
};
_root.looselife = 2;
} else {
_root.looselife = 1;
tellTarget (_root.scoreboard) {
gotoAndPlay ("FoulFrame");
};
}
} else {
tellTarget (_root.scoreboard) {
gotoAndPlay ("FoulFrame");
};
}
Symbol 180 MovieClip [pepperami] Frame 1
stop();
Symbol 180 MovieClip [pepperami] Frame 2
_root.score = _root.score + 1000;
Symbol 195 MovieClip [streaker] Frame 1
stop();
Symbol 203 MovieClip [police] Frame 1
stop();
Symbol 203 MovieClip [police] Frame 2
_root.score = _root.score + 1000;
tellTarget (_root.scoreboard) {
gotoAndPlay ("Bobby Dazzler");
};
Symbol 207 MovieClip Frame 1
play();
Symbol 207 MovieClip Frame 50
gotoAndPlay (1);
Symbol 209 MovieClip [flag] Frame 1
stop();
Symbol 209 MovieClip [flag] Frame 2
play();
_root.score = _root.score + 1000;
tellTarget (_root.scoreboard) {
gotoAndPlay ("Ball Bounce");
};
Symbol 218 MovieClip [defenders] Frame 1
stop();
stop();
Symbol 218 MovieClip [defenders] Frame 2
_root.score = _root.score + 250;
Symbol 223 MovieClip [circle1] Frame 1
stop();
Symbol 223 MovieClip [circle1] Frame 2
_root.score = _root.score + 500;
Symbol 231 MovieClip Frame 1
stop();
Symbol 233 MovieClip [cup] Frame 1
stop();
Symbol 233 MovieClip [cup] Frame 2
_root.score = _root.score + 500;
tellTarget (_root.scoreboard) {
gotoAndPlay ("Ball Bounce");
};
Symbol 236 MovieClip [goaly] Frame 1
stop();
Symbol 236 MovieClip [goaly] Frame 2
stop();
_root.score = _root.score + 2000;
tellTarget (_root.scoreboard) {
gotoAndPlay ("What A Save!");
};
Symbol 249 MovieClip Frame 1
bar.stop();
Symbol 265 Button
on (press) {
getURL ("http://www.hansenseyebrows.com/merch.html");
}
Symbol 303 Button
on (press) {
gotoAndStop (6);
stopAllSounds();
_root.score = 0;
}
Symbol 308 Button
on (press) {
getURL ("http://www.matmi.com", "_blank");
}
Symbol 314 Button
on (press) {
getURL ("http://www.mob.tv/music", "_blank");
}
Symbol 316 MovieClip Frame 1
stop();
Symbol 316 MovieClip Frame 15
stop();
Symbol 316 MovieClip Frame 18
gotoAndStop (1);
Symbol 319 MovieClip Frame 1
if (_root.qual == null) {
_root.qual = 2;
gotoAndStop("qual" + _root.qual);
}
_quality = "HIGH";
stop();
Symbol 319 MovieClip Frame 2
_quality = "MEDIUM";
Symbol 319 MovieClip Frame 3
_quality = "LOW";
Symbol 322 Button
on (press) {
_root.qual = 1;
_root.qqq.qu.gotoAndStop("qual" + _root.qual);
_root.qualchanged = true;
}
Symbol 323 Button
on (press) {
_root.qual = 2;
_root.qqq.qu.gotoAndStop("qual" + _root.qual);
_root.qualchanged = true;
}
Symbol 324 Button
on (press) {
_root.qual = 3;
_root.qqq.qu.gotoAndStop("qual" + _root.qual);
_root.qualchanged = true;
}
Symbol 333 Button
on (press) {
gotoAndStop (5);
}
Symbol 336 Button
on (press) {
getURL ("http://www.hansenseyebrows.com/game/scoreboard.php", "_blank");
}
Symbol 337 Button
on (press) {
getURL ("http://www.myspace.com/hansenseyebrows");
}
Symbol 346 Button
on (press) {
gotoAndStop (4);
}
Symbol 349 Button
on (press) {
getURL ("http://www.monstermob.com", "_blank");
}
Symbol 353 MovieClip Frame 5
stop();
Symbol 361 MovieClip Frame 1
x = 0;
stop();
Symbol 361 MovieClip Frame 40
x++;
if (x < 4) {
gotoAndPlay (2);
}
Symbol 361 MovieClip Frame 67
_root.gameSound = new Sound(_root);
_root.gameSound.attachSound("ingameloop");
_root.gameSound.start(0, 99999);
Symbol 422 MovieClip Frame 1
stop();
Symbol 422 MovieClip Frame 2
tellTarget (_root.sides.tunnelbottom) {
gotoAndPlay (2);
};
_root.goals++;
t = new Sound(_root);
t.attachSound("england");
t.start(0, 1);
Symbol 422 MovieClip Frame 100
gotoAndStop (1);
Symbol 422 MovieClip Frame 101
s.stop();
s = new Sound(this);
s.attachSound("tunnelhan");
s.start(0, 1);
Symbol 422 MovieClip Frame 208
gotoAndStop (1);
Symbol 422 MovieClip Frame 253
gotoAndStop (1);
Symbol 422 MovieClip Frame 313
gotoAndStop (1);
Symbol 422 MovieClip Frame 349
stop();
Symbol 422 MovieClip Frame 406
stop();
Symbol 422 MovieClip Frame 478
stop();
Symbol 435 Button
on (press) {
_root.loadMovie("http://uploads.ungrounded.net/312000/312179_newgrounds.swf");
}
Symbol 457 Button
on (press) {
score = _root.score;
nam = _root.nam;
mob = _root.mob;
email = _root.ema;
nat = _root.nat;
fee = _root.fee;
imp = _root.imp;
age = _root.age;
goals = _root.goals;
rnd = random(999999);
if ((((((nam == null) || (email == null)) || (nat == null)) || (fee == null)) || (imp == null)) || (age == null)) {
_root.endgame.tellerror._visible = 1;
} else {
getURL ((((((((((((((((((("http://www.hansenseyebrows.com/game/hansen.php?@@@@@@&trhr=h5g@@@@&@@@@5656=46@@@&@@@@566@34527=gfgdw3@@@&rtyy=@@@@@@@&@@@@@@@@&x=" + nam) + "&f=") + score) + "&r=") + mob) + "&i=") + email) + "&s=") + nat) + "&y=") + fee) + "&m=") + imp) + "&w=") + age) + "&rnd=") + rnd) + "&gg=") + goals);
_root.endgame.gotoAndStop(2);
}
}
Symbol 462 Button
on (press) {
this.gotoAndStop(2);
}
Symbol 531 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 535 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "angola";
}
Symbol 536 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "argentina";
}
Symbol 537 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "australia";
}
Symbol 538 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "brazil";
}
Symbol 539 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "costa_rica";
}
Symbol 540 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "cote_d_ivoire";
}
Symbol 541 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "croatia";
}
Symbol 542 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "czech_republic";
}
Symbol 543 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "iran";
}
Symbol 544 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "italy";
}
Symbol 545 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "japan";
}
Symbol 546 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "korea_republic";
}
Symbol 547 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "mexico";
}
Symbol 548 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "netherlands";
}
Symbol 549 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "paraguay";
}
Symbol 550 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "poland";
}
Symbol 551 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "sweden";
}
Symbol 552 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "togo";
}
Symbol 553 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "trinidad_and_tobago";
}
Symbol 554 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "tunisia";
}
Symbol 555 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "ukraine";
}
Symbol 556 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "usa";
}
Symbol 557 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "portugal";
}
Symbol 558 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "saudi_arabia";
}
Symbol 559 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "serbia_and_montenegro";
}
Symbol 560 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "spain";
}
Symbol 561 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "switzerland";
}
Symbol 562 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "ecuador";
}
Symbol 563 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "england";
}
Symbol 564 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "france";
}
Symbol 565 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "germany";
}
Symbol 566 Button
on (press) {
_root.endgame.flags.gotoAndStop(1);
_root.nat = "ghana";
}
Symbol 567 MovieClip Frame 1
stop();
Symbol 567 MovieClip Frame 2
stop();
Symbol 576 Button
on (press) {
_root.endgame.tellerror._visible = 0;
}
Symbol 579 Button
on (press) {
_root.loadMovie("http://uploads.ungrounded.net/312000/312179_newgrounds.swf");
}
Symbol 583 MovieClip Frame 1
stop();
Instance of Symbol 577 MovieClip "tellerror" in Symbol 583 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}