Frame 1
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
_root.gotoAndPlay("init");
}
Frame 4
_root.gotoAndPlay("load");
Frame 5
Math.reflectVector = function (vector, rx, ry) {
var _local1 = rx;
var _local2 = vector;
var _local3 = ry;
if ((_local1 != 0) || (_local3 != 0)) {
if (_local3 == 0) {
_local2.y = _local2.y * -1;
} else if (_local1 == 0) {
_local2.x = _local2.x * -1;
} else {
var x = ((((_local1 * _local1) * _local2.x) + ((_local1 * _local3) * _local2.y)) / ((_local1 * _local1) + (_local3 * _local3)));
var y = ((x * _local3) / _local1);
_local2.x = (2 * x) - _local2.x;
_local2.y = (2 * y) - _local2.y;
}
}
};
Math.dist2D = function (x, y) {
return(Math.sqrt((x * x) + (y * y)));
};
Math.distance = function () {
var _local2 = arguments;
var _local3 = 0;
var _local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local3 + (_local2[_local1] * _local2[_local1]);
_local1++;
}
return(Math.sqrt(_local3));
};
_global.Collisions = new Object();
Collisions.AABBOverlapsAABB = function (box1, box2) {
var _local1 = box2;
var _local2 = box1;
var _local3 = ((_local2.xMin <= _local1.xMin) && (_local2.xMax > _local1.xMin)) || ((_local1.xMin <= _local2.xMin) && (_local1.xMax > _local2.xMin));
var yOverlap = (((_local2.yMin <= _local1.yMin) && (_local2.yMax > _local1.yMin)) || ((_local1.yMin <= _local2.yMin) && (_local1.yMax > _local2.yMin)));
return(_local3 && (yOverlap));
};
Collisions.pointInBox = function (point, box) {
var _local1 = box;
var _local2 = point;
return((((_local2.x >= _local1.xMin) && (_local2.x <= _local1.xMax)) && (_local2.y >= _local1.yMin)) && (_local2.y <= _local1.yMax));
};
Collisions.circleCollidesLine = function (c, w) {
var _local1 = c;
var _local2 = w;
var cvx = (_local1.x2 - _local1.x1);
var _local3 = _local1.y2 - _local1.y1;
if ((cvx == 0) && (_local3 == 0)) {
return(false);
}
var wdx = (_local2.x2 - _local2.x1);
var wdy = (_local2.y2 - _local2.y1);
if (((((cvx == wdx) && (_local3 == wdy)) || ((cvx == (-wdx)) && (_local3 == (-wdy)))) || ((wdx == 0) && (cvx == 0))) || ((wdy == 0) && (_local3 == 0))) {
return(false);
}
if (wdx == 0) {
var wallX = _local2.x1;
if (_local1.x1 > wallX) {
wallX = wallX + _local1.r;
} else {
wallX = wallX - _local1.r;
}
var t = ((wallX - _local1.x1) / cvx);
var collisionY = (_local1.y1 + (_local3 * t));
if ((t > 0) && (t <= 1)) {
if ((collisionY <= Math.max(_local2.y1, _local2.y2)) && (collisionY >= Math.min(_local2.y1, _local2.y2))) {
return(t);
}
}
} else if (wdy == 0) {
var wallY = _local2.y1;
if (_local1.y1 > wallY) {
wallY = wallY + _local1.r;
} else {
wallY = wallY - _local1.r;
}
var t = ((wallY - _local1.y1) / _local3);
var collisionX = (_local1.x1 + (cvx * t));
if ((t > 0) && (t <= 1)) {
if ((collisionX <= Math.max(_local2.x1, _local2.x2)) && (collisionX >= Math.min(_local2.x1, _local2.x2))) {
return(t);
}
}
}
return(false);
};
Collisions.resolveCircleLineCollision = function (c, w) {
var _local1 = w;
var _local2 = c;
var _local3 = (-(_local1.x2 - _local1.x1)) / (_local1.y2 - _local1.y1);
var b1 = (_local1.y1 - (_local3 * _local1.x1));
var b2 = (_local1.y2 - (_local3 * _local1.x2));
if (((_local3 * _local2.x) + Math.min(b1, b2)) > _local2.y) {
point = ((b1 < b2) ? 1 : 2);
} else if (((_local3 * _local2.x) + Math.max(b1, b2)) < _local2.y) {
point = ((b1 > b2) ? 1 : 2);
}
cv = {x:_local2.vx, y:_local2.vy};
Math.reflectVector(cv, _local1.x1 - _local1.x2, _local1.y1 - _local1.y2);
_local2.vx = cv.x;
_local2.vy = cv.y;
};
Collisions.circleCollidesCircle = function (c1, c2) {
var _local1 = c2;
var _local2 = c1;
var vx = ((_local1.x2 - _local1.x1) - (_local2.x2 - _local2.x1));
var vy = ((_local1.y2 - _local1.y1) - (_local2.y2 - _local2.y1));
if ((vx == 0) && (vy == 0)) {
return(false);
}
var r = (_local2.r + _local1.r);
var x = (_local1.x1 - _local2.x1);
var y = (_local1.y1 - _local2.y1);
if (((x * x) + (y * y)) < (r * r)) {
return(false);
}
var a = ((vx * vx) + (vy * vy));
var b = (((2 * vx) * x) + ((2 * vy) * y));
var c = (((x * x) + (y * y)) - (r * r));
var _local3 = (b * b) - ((4 * a) * c);
if (_local3 < 0) {
return(false);
}
_local3 = Math.sqrt(_local3);
var t1 = (((-b) - _local3) / (2 * a));
var t1_is_collision = ((t1 > 0) && (t1 <= 1));
var t2 = (((-b) + _local3) / (2 * a));
var t2_is_collision = ((t2 > 0) && (t2 <= 1));
if (t1_is_collision && (t2_is_collision)) {
return(Math.min(t1, t2));
}
if (t1_is_collision) {
return(t1);
}
if (t2_is_collision) {
return(t2);
}
return(false);
};
Collisions.resolveCircleCircleCollision = function (c1Data, c2Data) {
var _local1 = c1Data;
var _local2 = c2Data;
var cmVx;
var _local3;
if (_local1.mass <= 0) {
cmVx = _local1.vx;
_local3 = _local1.vy;
} else if (_local2.mass <= 0) {
cmVx = _local2.vx;
_local3 = _local2.vy;
} else {
var totalMass = (_local1.mass + _local2.mass);
cmVx = ((_local1.vx * _local1.mass) + (_local2.vx * _local2.mass)) / totalMass;
_local3 = ((_local1.vy * _local1.mass) + (_local2.vy * _local2.mass)) / totalMass;
}
var reflectX = (_local1.y - _local2.y);
var reflectY = (_local2.x - _local1.x);
var c1CMV = {x:_local1.vx - cmVx, y:_local1.vy - _local3};
var c2CMV = {x:_local2.vx - cmVx, y:_local2.vy - _local3};
Math.reflectVector(c1CMV, reflectX, reflectY);
Math.reflectVector(c2CMV, reflectX, reflectY);
_local1.vx = c1CMV.x + cmVx;
_local1.vy = c1CMV.y + _local3;
_local2.vx = c2CMV.x + cmVx;
_local2.vy = c2CMV.y + _local3;
};
_global.BoundingArea = function () {
};
BoundingArea.prototype.getWidth = function () {
return(Math.abs(this.getXMin() - this.getXMax()));
};
BoundingArea.prototype.getHeight = function () {
return(Math.abs(this.getYMin() - this.getYMax()));
};
BoundingArea.prototype.getXMin = function () {
return(0);
};
BoundingArea.prototype.getXMax = function () {
return(0);
};
BoundingArea.prototype.getYMin = function () {
return(0);
};
BoundingArea.prototype.getYMax = function () {
return(0);
};
BoundingArea.prototype.getCenterX = function () {
return(0);
};
BoundingArea.prototype.getCenterY = function () {
return(0);
};
_global.BoundingCircle = function (x, y, r) {
var _local1 = this;
super();
_local1.x = x;
_local1.y = y;
_local1.r = r;
};
BoundingCircle.prototype = new BoundingArea();
BoundingCircle.prototype.getX = function () {
return(this.x);
};
BoundingCircle.prototype.getY = function () {
return(this.y);
};
BoundingCircle.prototype.getRadius = function () {
return(this.r);
};
BoundingCircle.prototype.getXMin = function () {
return(this.x - this.r);
};
BoundingCircle.prototype.getXMax = function () {
return(this.x + this.r);
};
BoundingCircle.prototype.getYMin = function () {
return(this.y - this.r);
};
BoundingCircle.prototype.getYMax = function () {
return(this.y + this.r);
};
BoundingCircle.prototype.getCenterX = function () {
return(this.x);
};
BoundingCircle.prototype.getCenterY = function () {
return(this.y);
};
BoundingCircle.prototype.setX = function (x) {
this.x = x;
};
BoundingCircle.prototype.setY = function (y) {
this.y = y;
};
BoundingCircle.prototype.setRadius = function (r) {
this.r = r;
};
_global.BoundingBox = function (xMin, xMax, yMin, yMax) {
var _local1 = this;
super();
_local1.xMin = xMin;
_local1.xMax = xMax;
_local1.yMin = yMin;
_local1.yMax = yMax;
};
BoundingBox.prototype = new BoundingArea();
BoundingBox.prototype.getXMin = function () {
return(this.xMin);
};
BoundingBox.prototype.getXMax = function () {
return(this.xMax);
};
BoundingBox.prototype.getYMin = function () {
return(this.yMin);
};
BoundingBox.prototype.getYMax = function () {
return(this.yMax);
};
BoundingBox.prototype.getCenterX = function () {
return((this.xMax + this.xMin) / 2);
};
BoundingBox.prototype.getCenterY = function () {
return((this.yMax + this.yMin) / 2);
};
BoundingBox.prototype.setXMin = function (x) {
this.xMin = x;
};
BoundingBox.prototype.setXMax = function (x) {
this.xMax = x;
};
BoundingBox.prototype.setYMin = function (y) {
this.yMin = y;
};
BoundingBox.prototype.setYMax = function (y) {
this.yMax = y;
};
_global.BoundingLine = function (x1, y1, x2, y2, nx, ny) {
var _local1 = this;
super();
_local1.x1 = x1;
_local1.x2 = x2;
_local1.y1 = y1;
_local1.y2 = y2;
_local1.nx = nx;
_local1.ny = ny;
};
BoundingLine.prototype = new BoundingArea();
BoundingLine.prototype.getXMin = function () {
return(Math.min(this.x1, this.x2));
};
BoundingLine.prototype.getXMax = function () {
return(Math.max(this.x1, this.x2));
};
BoundingLine.prototype.getYMin = function () {
return(Math.min(this.y1, this.y2));
};
BoundingLine.prototype.getYMax = function () {
return(Math.max(this.y1, this.y2));
};
BoundingLine.prototype.getCenterX = function () {
return((this.x1 + this.x2) / 2);
};
BoundingLine.prototype.getCenterY = function () {
return((this.y1 + this.y2) / 2);
};
BoundingLine.prototype.getX1 = function () {
return(this.x1);
};
BoundingLine.prototype.getY1 = function () {
return(this.y1);
};
BoundingLine.prototype.getX2 = function () {
return(this.x2);
};
BoundingLine.prototype.getY2 = function () {
return(this.y2);
};
BoundingLine.prototype.getNormalX = function () {
return(this.nx);
};
BoundingLine.prototype.getNormalY = function () {
return(this.ny);
};
BoundingLine.prototype.setX1 = function (x) {
this.x1 = x;
};
BoundingLine.prototype.setY1 = function (y) {
this.y1 = y;
};
BoundingLine.prototype.setX2 = function (x) {
this.x2 = x;
};
BoundingLine.prototype.setY2 = function (y) {
this.y2 = y;
};
BoundingLine.prototype.setNormalX = function (x) {
this.nx = x;
};
BoundingLine.prototype.setNormalY = function (y) {
this.ny = y;
};
_global.ContainerMC = function () {
super();
this.MCcounter = 0;
};
ContainerMC.prototype = new MovieClip();
ContainerMC.prototype.addMC = function (symbol, x, y) {
var _local2 = this;
_local2.MCcounter++;
var _local3 = "mc" + _local2.MCcounter;
_local2.attachMovie(symbol, _local3, _local2.MCcounter);
var _local1 = _local2[_local3];
_local1._x = x;
_local1._y = y;
return(_local1);
};
ContainerMC.prototype.empty = function () {
var _local1 = this;
for (var _local2 in _local1) {
_local1[_local2].removeMovieClip();
}
_local1.MCcounter = 0;
};
ContainerMC.prototype.getNextMC = function (mc, dir) {
var depth = mc.getDepth();
var next_mc = mc;
for (var k in this) {
var _local1 = this[k];
if ((_local1 != mc) && (typeof(_local1) == "movieclip")) {
var _local2 = _local1.getDepth();
var _local3 = next_mc.getDepth();
if (dir == 1) {
if ((_local2 > depth) && ((_local2 < _local3) || (_local3 == depth))) {
next_mc = _local1;
}
} else if ((_local2 < depth) && ((_local2 > _local3) || (_local3 == depth))) {
next_mc = _local1;
}
}
}
if (mc != next_mc) {
return(next_mc);
}
return(false);
};
ContainerMC.prototype.getNumMCs = function () {
var _local1 = this;
var _local2 = 0;
for (var _local3 in _local1) {
if (typeof(_local1[_local3]) == "movieclip") {
_local2++;
}
}
return(_local2);
};
ContainerMC.prototype.getMC = function (id) {
return(this["mc" + id]);
};
_global.GameObjectMC = function () {
var _local1 = this;
super();
_local1.stop();
_local1.theme = null;
_local1.boundingArea = null;
_local1.aaBoundingBox = null;
_local1.collideSound = null;
};
GameObjectMC.prototype = new MovieClip();
GameObjectMC.prototype.getX = function () {
return(this._x);
};
GameObjectMC.prototype.getY = function () {
return(this._y);
};
GameObjectMC.prototype.getTheme = function () {
return(this.theme);
};
GameObjectMC.prototype.getActive = function () {
return(this._visible);
};
GameObjectMC.prototype.getBoundingArea = function () {
return(this.boundingArea);
};
GameObjectMC.prototype.getCollideSound = function () {
return(this.collideSound);
};
GameObjectMC.prototype.getBoundingBox = function () {
var _local1 = this;
if (!_local1.aaBoundingBox) {
_local1.updateBoundingBox();
}
return(_local1.aaBoundingBox);
};
GameObjectMC.prototype.getCenterX = function () {
var _local1 = this;
if (_local1.boundingArea) {
return(_local1._x + _local1.boundingArea.getCenterX());
}
return(_local1._x);
};
GameObjectMC.prototype.getCenterY = function () {
var _local1 = this;
if (_local1.boundingArea) {
return(_local1._y + _local1.boundingArea.getCenterY());
}
return(_local1._y);
};
GameObjectMC.prototype.setTheme = function (theme) {
this.theme = theme;
this.gotoAndStop(theme);
};
GameObjectMC.prototype.setActive = function (active) {
this._visible = active;
};
GameObjectMC.prototype.setBoundingArea = function (area) {
this.boundingArea = area;
};
GameObjectMC.prototype.setX = function (x) {
this._x = x;
};
GameObjectMC.prototype.setY = function (y) {
this._y = y;
};
GameObjectMC.prototype.setCollideSound = function (soundName) {
this.collideSound = soundName;
};
GameObjectMC.prototype.updateBoundingBox = function () {
var _local1 = this;
if (!_local1.boundingArea) {
return(false);
}
_local1.aaBoundingBox = new BoundingBox(_local1._x + _local1.boundingArea.getXMin(), _local1._x + _local1.boundingArea.getXMax(), _local1._y + _local1.boundingArea.getYMin(), _local1._y + _local1.boundingArea.getYMax());
return(undefined);
};
GameObjectMC.prototype.onTime = function () {
};
GameObjectMC.prototype.postOnTime = function () {
};
GameObjectMC.prototype.onCollide = function () {
var _local1 = this;
_local1.gotoAndPlay(_local1.theme + "_collide");
if (_local1.collideSound != null) {
var _local2 = new Sound(_local1);
_local2.attachSound(_local1.collideSound);
_local2.start();
}
};
_global.MobileGameObjectMC = function () {
var _local1 = this;
super();
_local1.prevX = 0;
_local1.prevY = 0;
_local1.mobile = false;
_local1.mass = 0;
_local1.bounds = null;
_local1.vx = 0;
_local1.vy = 0;
_local1.maxV = -1;
};
MobileGameObjectMC.prototype = new GameObjectMC();
MobileGameObjectMC.prototype.onLoad = function () {
var _local1 = this;
_local1.prevX = _local1._x;
_local1.prevY = _local1._y;
};
MobileGameObjectMC.prototype.getPrevX = function () {
return(this.prevX);
};
MobileGameObjectMC.prototype.getPrevY = function () {
return(this.prevY);
};
MobileGameObjectMC.prototype.getMobile = function () {
return(this.mobile);
};
MobileGameObjectMC.prototype.getMass = function () {
return(this.mass);
};
MobileGameObjectMC.prototype.getPositionBounds = function () {
return(this.bounds);
};
MobileGameObjectMC.prototype.getVx = function () {
return(this.vx);
};
MobileGameObjectMC.prototype.getVy = function () {
return(this.vy);
};
MobileGameObjectMC.prototype.getMaxVelocity = function () {
return(this.maxV);
};
MobileGameObjectMC.prototype.getPrevCenterX = function () {
var _local1 = this;
if (_local1.boundingArea) {
return(_local1.prevX + _local1.boundingArea.getCenterX());
}
return(_local1.prevX);
};
MobileGameObjectMC.prototype.getPrevCenterY = function () {
var _local1 = this;
if (_local1.boundingArea) {
return(_local1.prevY + _local1.boundingArea.getCenterY());
}
return(_local1.prevY);
};
MobileGameObjectMC.prototype.updateBoundingBox = function () {
var _local1 = this;
var xMin = Math.min(_local1.prevX, _local1._x);
var _local2 = Math.max(_local1.prevX, _local1._x);
var yMin = Math.min(_local1.prevY, _local1._y);
var _local3 = Math.max(_local1.prevY, _local1._y);
if (_local1.boundingArea) {
var centerX = _local1.boundingArea.getCenterX();
var centerY = _local1.boundingArea.getCenterY();
xMin = xMin + (x + _local1.boundingArea.getXMin());
_local2 = _local2 + (x + _local1.boundingArea.getXMax());
yMin = yMin + (y + _local1.boundingArea.getYMin());
_local3 = _local3 + (y + _local1.boundingArea.getYMax());
}
_local1.aaboundingBox = new BoundingBox(xMin, _local2, yMin, _local3);
};
MobileGameObjectMC.prototype.updateVelocityFromPositions = function () {
var _local1 = this;
_local1.vx = _local1._x - _local1.prevX;
_local1.vy = _local1._y - _local1.prevY;
};
MobileGameObjectMC.prototype.capVelocity = function () {
var _local1 = this;
if (_local1.maxV > 0) {
var _local2 = Math.dist2d(_local1.vx, _local1.vy);
if (_local2 > _local1.maxV) {
_local1.vx = _local1.vx * (_local1.maxV / _local2);
_local1.vy = _local1.vy * (_local1.maxV / _local2);
}
} else if (_local1.maxV == 0) {
_local1.vx = 0;
_local1.vy = 0;
}
};
MobileGameObjectMC.prototype.scaleVelocity = function (newVel) {
var _local1 = this;
var _local3 = newVel;
if (_local3 > 0) {
var _local2 = Math.dist2d(_local1.vx, _local1.vy);
if (_local2 > 0) {
_local1.vx = _local1.vx * (_local3 / _local2);
_local1.vy = _local1.vy * (_local3 / _local2);
} else {
_local1.vx = 0;
_local1.vy = 0;
}
} else {
_local1.vx = 0;
_local1.vy = 0;
}
};
MobileGameObjectMC.prototype.setBounds = function (xMin, xMax, yMin, yMax) {
this.bounds = new BoundingBox(xMin, xMax, yMin, yMax);
};
MobileGameObjectMC.prototype.setX = function (x) {
var _local1 = this;
if (_local1.bounds) {
var _local3 = _local1.bounds.getXMin();
var _local2 = _local1.bounds.getXMax();
if (_local1.boundingArea) {
_local3 = _local3 - _local1.boundingArea.getXMin();
_local2 = _local2 - _local1.boundingArea.getXMax();
}
super.setX(Math.max(_local3, Math.min(_local2, x)));
} else {
super.setX(x);
}
};
MobileGameObjectMC.prototype.setY = function (y) {
var _local1 = this;
if (_local1.bounds) {
var _local3 = _local1.bounds.getYMin();
var _local2 = _local1.bounds.getYMax();
if (_local1.boundingArea) {
_local3 = _local3 - _local1.boundingArea.getYMin();
_local2 = _local2 - _local1.boundingArea.getYMax();
}
super.setY(Math.max(_local3, Math.min(_local2, y)));
} else {
super.setY(y);
}
};
MobileGameObjectMC.prototype.moveX = function (dx) {
this.setX(this._x + dx);
};
MobileGameObjectMC.prototype.moveY = function (dy) {
this.setY(this._y + dy);
};
MobileGameObjectMC.prototype.setPrevX = function (x) {
this.prevX = x;
};
MobileGameObjectMC.prototype.setPrevY = function (y) {
this.prevY = y;
};
MobileGameObjectMC.prototype.setMass = function (m) {
this.mass = m;
};
MobileGameObjectMC.prototype.setMobile = function (mobile) {
this.mobile = mobile;
};
MobileGameObjectMC.prototype.setVx = function (vx) {
this.vx = vx;
};
MobileGameObjectMC.prototype.setVy = function (vy) {
this.vy = vy;
};
MobileGameObjectMC.prototype.setMaxVelocity = function (vel) {
this.maxV = vel;
};
MobileGameObjectMC.prototype.setVelocity = function (vx, vy) {
this.vx = vx;
this.vy = vy;
};
MobileGameObjectMC.prototype.onTime = function () {
super.onTime();
this.UpdateBoundingBox();
};
MobileGameObjectMC.prototype.postOnTime = function () {
var _local1 = this;
_local1.prevX = _local1._x;
_local1.prevY = _local1._y;
super.postOnTime();
};
_global.HumanMalletMC = function () {
super();
};
HumanMalletMC.prototype = new MobileGameObjectMC();
HumanMalletMC.prototype.onTime = function () {
this.updateVelocityFromPositions();
super.onTime();
};
HumanMalletMC.prototype.onCollide = function () {
var _local1 = new Sound();
_local1.attachSound("MalletHitPuck");
_local1.start();
};
_global.ComputerMalletMC = function () {
var _local1 = this;
super();
_local1.targetMC = null;
_local1.startX = 0;
_local1.startY = 0;
_local1.numMoves = 0;
};
ComputerMalletMC.prototype = new MobileGameObjectMC();
ComputerMalletMC.prototype.onLoad = function () {
var _local1 = this;
super.onLoad();
_local1.startX = _local1._x;
_local1.startY = _local1._y;
};
ComputerMalletMC.prototype.getTargetMC = function () {
return(this.targetMC);
};
ComputerMalletMC.prototype.setTargetMC = function (mc) {
this.targetMC = mc;
};
ComputerMalletMC.prototype.onTime = function () {
if (this.targetMC != null) {
this.AIMove();
}
super.onTime();
};
ComputerMalletMC.prototype.AIMove = function () {
var _local1 = this;
_local1.vx = 0;
_local1.vy = 0;
var maxV = _local1.maxV;
if ((((!_local1.targetMC) || (!_local1.targetMC.getMobile())) || (!_local1.mobile)) || (maxV == 0)) {
return(false);
}
var targetX = _local1.targetMC.getCenterX();
var targetY = _local1.targetMC.getCenterY();
var x = _local1.getCenterX();
var y = _local1.getCenterY();
var _local2 = targetX - x;
var dy = (targetY - y);
var r = Math.dist2D(_local2, dy);
if (r > 0) {
var _local3 = _local1.targetMC.getBoundingArea().getRadius();
var malletRadius = _local1.getBoundingArea().getRadius();
if ((dy < (maxV - 1)) || ((maxV < 0) && (dy < 0))) {
if (maxV > 0) {
_local1.vy = -maxV;
} else {
_local1.vy = _local1.vy - dy;
}
} else if (targetY > (_local1.bounds.getYMax() + _local3)) {
_local1.vx = _local1.startX - x;
_local1.vy = _local1.startY - y;
} else {
if (Math.abs(_local2) < _local3) {
_local1.vx = (((_local2 < 0) || ((_local2 == 0) && (Math.random() > 0.5))) ? (_local2 + _local3) : (_local2 - _local3));
} else {
_local1.vx = ((_local2 < 0) ? (_local2 - _local3) : (_local2 + _local3));
}
_local1.vy = dy;
}
_local1.capVelocity();
}
_local1.setX(_local1._x + _local1.vx);
_local1.setY(_local1._y + _local1.vy);
_local1.numMoves++;
return(undefined);
};
ComputerMalletMC.prototype.onCollide = function () {
var _local1 = new Sound();
_local1.attachSound("MalletHitPuck");
_local1.start();
};
_global.PuckMC = function () {
super();
this.friction = 0;
};
PuckMC.prototype = new MobileGameObjectMC();
PuckMC.prototype.getFriction = function () {
return(this.friction);
};
PuckMC.prototype.setFriction = function (friction) {
this.friction = friction;
};
PuckMC.prototype.onTime = function () {
var _local1 = this;
if (_local1.mobile && (_local1.maxV != 0)) {
var _local3 = Math.dist2d(_local1.vx, _local1.vy);
var _local2 = _local3;
if (_local1.maxV > 0) {
_local2 = Math.min(_local3, _local1.maxV);
}
_local2 = Math.max(_local2 - _local1.friction, 0);
if ((_local2 != _local3) && (_local3 > 0)) {
_local1.vx = _local1.vx * (_local2 / _local3);
_local1.vy = _local1.vy * (_local2 / _local3);
}
_local1._x = _local1._x + _local1.vx;
_local1._y = _local1._y + _local1.vy;
}
super.onTime();
};
_global.TrailMC = function () {
var _local1 = this;
super();
_local1.maxWidth = 10;
_local1.maxPositions = 5;
_local1.positions = new Array();
_local1.minSegmentLength = 0.1;
_local1.minAngle = (Math.PI/2);
_local1.bgMC.setMask(_local1.drawMC);
_local1.trailType = _local1.TYPE_VOLUME;
};
TrailMC.prototype = new GameObjectMC();
TrailMC.prototype.TYPE_VOLUME = 0;
TrailMC.prototype.TYPE_LINE = 1;
TrailMC.prototype.getMaxWidth = function () {
return(this.maxWidth);
};
TrailMC.prototype.getMaxPositions = function () {
return(this.maxPositions);
};
TrailMC.prototype.getPuckPosition = function (i) {
return(this.positions[i]);
};
TrailMC.prototype.getType = function () {
return(this.trailType);
};
TrailMC.prototype.getTrailLength = function () {
var _local2 = this;
var _local3 = 0;
var _local1 = 0;
while (_local1 < (_local2.positions.length - 1)) {
_local3 = _local3 + _local2.positions[_local1].dist;
_local1++;
}
return(_local3);
};
TrailMC.prototype.setType = function (t) {
var _local1 = this;
_local1.trailType = t;
if (t == _local1.TYPE_LINE) {
_local1.bgMC.setMask(null);
_local1.bgMC._visible = false;
} else {
_local1.bgMC.setMask(_local1.drawMC);
_local1.bgMC._visible = true;
}
};
TrailMC.prototype.setMaxWidth = function (width) {
this.maxWidth = width;
};
TrailMC.prototype.setMaxPositions = function (num) {
this.maxPositions = num;
this.positions.splice(num);
};
TrailMC.prototype.addPosition = function (x, y) {
var _local1 = this;
var _local2 = _local1.positions.length;
if (_local1.maxPositions <= 0) {
if (_local2 > 0) {
_local1.positions = new Array();
}
} else {
var dist = 0;
if (_local2 > 0) {
var dx = (x - _local1.positions[0].x);
var _local3 = y - _local1.positions[0].y;
dist = Math.dist2D(dx, _local3);
}
if ((_local2 == 0) || (dist > _local1.minSegmentLength)) {
_local1.positions.unshift({x:x, y:y, dist:dist});
_local1.positions.splice(_local1.maxPositions);
} else if (_local2 > 0) {
_local1.positions.pop();
}
}
};
TrailMC.prototype.clearPositions = function () {
this.positions = new Array();
};
TrailMC.prototype.clearTrail = function () {
this.drawMC.clear();
};
TrailMC.prototype.drawTrail = function () {
var _local1 = this;
if (_local1.maxPositions <= 0) {
} else if (_local1.drawMC && (_local1.positions.length > 1)) {
if (_local1.trailType == _local1.TYPE_LINE) {
_local1.drawTrailLine();
} else {
_local1.drawTrailVolume();
}
}
};
TrailMC.prototype.drawTrailLine = function () {
var _local2 = this;
_local2.drawMC.lineStyle(2, 16777215);
var _local3 = _local2.positions.length;
_local2.drawMC.moveTo(_local2.positions[0].x, _local2.positions[0].y);
var _local1 = 1;
while (_local1 < _local3) {
_local2.drawMC.lineTo(_local2.positions[_local1].x, _local2.positions[_local1].y);
_local1++;
}
};
TrailMC.prototype.drawTrailVolume = function () {
var _local1 = this;
var numPositions = _local1.positions.length;
var lastIndex = (numPositions - 1);
var totalLength = _local1.getTrailLength();
var currentLength = 0;
var segmentWidths = new Array();
segmentWidths[lastIndex] = 0;
var _local2 = lastIndex - 1;
while (_local2 >= 0) {
currentLength = currentLength + _local1.positions[_local2].dist;
segmentWidths[_local2] = ((totalLength > 0) ? ((_local1.maxWidth * currentLength) / totalLength) : 0);
_local2--;
}
_local1.drawMC.lineStyle();
var _local3 = _local1.getTrailSegmentPoints(_local1.positions[lastIndex], segmentWidths[lastIndex], _local1.positions[lastIndex - 1], segmentWidths[lastIndex - 1]);
_local2 = lastIndex - 1;
while (_local2 > 0) {
segmentPoints = _local1.getTrailSegmentPoints(_local1.positions[_local2], segmentWidths[_local2], _local1.positions[_local2 - 1], segmentWidths[_local2 - 1]);
var crossProd = _local1.getCrossProductFromPoints(_local1.positions[_local2 + 1], _local1.positions[_local2], _local1.positions[_local2 - 1]);
if (crossProd > 0) {
_local1.drawShape(_local3.top2, segmentPoints.top1, _local1.positions[_local2]);
} else if (crossProd < 0) {
_local1.drawShape(segmentPoints.bottom1, _local3.bottom2, _local1.positions[_local2]);
}
_local1.drawShape(_local3.bottom1, _local1.positions[_local2 + 1], _local3.top1, _local3.top2, _local1.positions[_local2], _local3.bottom2);
_local3 = segmentPoints;
_local2--;
}
_local1.drawShape(_local3.bottom1, _local3.top1, _local3.top2, _local3.bottom2);
};
TrailMC.prototype.drawShape = function () {
this.drawMC.beginFill(0);
var _local2 = arguments;
var _local3 = _local2.length;
if ((this.drawMC == null) || (_local3 < 2)) {
return(false);
}
this.drawMC.moveTo(_local2[_local3 - 1].x, _local2[_local3 - 1].y);
var _local1 = 0;
while (_local1 < _local3) {
this.drawMC.lineTo(_local2[_local1].x, _local2[_local1].y);
_local1++;
}
this.drawMC.endFill();
return(undefined);
};
TrailMC.prototype.getTrailSegmentPoints = function (p1, width1, p2, width2) {
var _local3 = p2.x - p1.x;
var _local2 = p2.y - p1.y;
var dist = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var perpDx1 = (((width1 / 2) * _local2) / dist);
var perpDy1 = (((-(width1 / 2)) * _local3) / dist);
var perpDx2 = (((width2 / 2) * _local2) / dist);
var perpDy2 = (((-(width2 / 2)) * _local3) / dist);
var _local1 = new Object();
_local1.top1 = {x:p1.x + perpDx1, y:p1.y + perpDy1};
_local1.bottom1 = {x:p1.x - perpDx1, y:p1.y - perpDy1};
_local1.top2 = {x:p2.x + perpDx2, y:p2.y + perpDy2};
_local1.bottom2 = {x:p2.x - perpDx2, y:p2.y - perpDy2};
return(_local1);
};
TrailMC.prototype.getLine = function (p1, p2) {
var _local2 = p2;
var _local1 = new Object();
_local1.x = _local2.x;
_local1.y = _local2.y;
_local1.dx = _local2.x - p1.x;
_local1.dy = _local2.y - p1.y;
return(_local1);
};
TrailMC.prototype.getLinesIntersectionPoint = function (line1, line2) {
var _local1 = line1;
var _local2 = line2;
if ((_local1.dx == 0) && (_local2.dx != 0)) {
var t = ((_local1.x - _local2.x) / _local2.dx);
var y = (_local2.y + (t * _local2.dy));
return({x:_local1.x, y:y});
}
if ((_local2.dx == 0) && (_local1.dx != 0)) {
var t = ((_local2.x - _local1.x) / _local1.dx);
var y = (_local1.y + (t * _local1.dy));
return({x:_local2.x, y:y});
}
if ((_local1.dx == 0) && (_local2.dx == 0)) {
var y = _local1.y;
if ((_local1.dy < 0) && (_local2.dy < 0)) {
y = Math.min(_local1.y, _local2.y);
} else if ((_local1.dy > 0) && (_local2.dy > 0)) {
y = Math.max(_local1.y, _local2.y);
}
return({x:_local1.x, y:y});
}
var _local3 = _local1.dy / _local1.dx;
var b1 = (_local1.y - (_local1.x * _local3));
var m2 = (_local2.dy / _local2.dx);
var b2 = (_local2.y - (_local2.x * m2));
if (_local3 == m2) {
if (b2 != b1) {
return(false);
}
return({x:_local1.x, y:_local1.y});
}
var x = ((b2 - b1) / (_local3 - m2));
var y = ((_local3 * x) + b1);
return({x:x, y:y});
};
TrailMC.prototype.postOnTime = function () {
this.clearTrail();
this.drawTrail();
};
TrailMC.prototype.getCrossProductFromPoints = function (p1, p2, p3) {
var _local1 = p1;
var dx1 = (p2.x - _local1.x);
var _local3 = p2.y - _local1.y;
var dx2 = (p3.x - _local1.x);
var _local2 = p3.y - _local1.y;
return((dx1 * _local2) - (_local3 * dx2));
};
TrailMC.prototype.getAngle = function (p1, p2, p3) {
var _local2 = p2;
var theta1 = Math.atan2(p1.y - _local2.y, p1.x - _local2.x);
var _local3 = Math.atan2(p3.y - _local2.y, p3.x - _local2.x);
var _local1 = Math.abs(theta1 - _local3);
if (_local1 > Math.PI) {
_local1 = (Math.PI*2) - _local1;
}
return(_local1);
};
_global.BlockerMC = function () {
super();
this.targetMCs = new Array();
};
BlockerMC.prototype = new GameObjectMC();
BlockerMC.prototype.addTargetMC = function (mc) {
this.targetMCs.push(mc);
};
BlockerMC.prototype.getTargetMCs = function () {
return(this.targetMCs);
};
_global.WallMC = function () {
super();
this.sticky = false;
this.setCollideSound("PuckHitWall");
};
WallMC.prototype = new GameObjectMC();
WallMC.prototype.getSticky = function () {
return(this.sticky);
};
WallMC.prototype.setSticky = function (sticky) {
this.sticky = sticky;
};
_global.WallLeftMC = function () {
super();
};
WallLeftMC.prototype = new WallMC();
_global.WallTopLeftMC = function () {
super();
};
WallTopLeftMC.prototype = new WallMC();
_global.WallTopRightMC = function () {
super();
};
WallTopRightMC.prototype = new WallMC();
_global.WallHiddenMC = function () {
super();
};
WallHiddenMC.prototype = new WallMC();
_global.WallCornerMC = function () {
super();
};
WallCornerMC.prototype = new WallMC();
_global.GoalMC = function () {
var _local1 = this;
super();
_local1.playerID = PLAYER_NONE;
_local1.scored = false;
_local1.scoreSound = null;
};
GoalMC.prototype = new GameObjectMC();
GoalMC.prototype.getPlayerID = function () {
return(this.playerID);
};
GoalMC.prototype.getScored = function () {
return(this.scored);
};
GoalMC.prototype.getScoreSound = function () {
return(this.scoreSound);
};
GoalMC.prototype.getScoreSoundVolume = function () {
return(this.scoreSoundVolume);
};
GoalMC.prototype.setPlayerID = function (id) {
this.playerID = id;
};
GoalMC.prototype.setScored = function (scored) {
this.scored = scored;
};
GoalMC.prototype.setScoreSound = function (soundName) {
this.scoreSound = soundName;
};
GoalMC.prototype.onScore = function () {
var _local1 = this;
_local1.gotoAndPlay(_local1.theme + "_score");
_local1.scored = true;
if (_local1.scoreSound != null) {
var _local2 = new Sound(_local1);
_local2.attachSound(_local1.scoreSound);
_local2.start();
}
};
_global.TableMC = function () {
super();
};
TableMC.prototype = new GameObjectMC();
_global.SceneMC = function () {
var _local1 = this;
super();
_local1.active = false;
_local1.maxCollisionLoops = 2;
_local1.puckObjects = new Array();
_local1.puckObject = null;
_local1.tableObject = null;
_local1.puckTrailObjects = new Array();
_local1.mobileObjects = new Array();
_local1.wallObjects = new Array();
_local1.goalObjects = new Array();
_local1.blockerObjects = new Array();
_local1.tableBounds = null;
_local1.goalBounds = null;
_local1.theme = null;
};
SceneMC.prototype = new MovieClip();
SceneMC.prototype.onLoad = function () {
var _local1 = this;
for (var _local2 in _local1) {
if (!(_local1[_local2] instanceof GameObjectMC)) {
continue;
}
_local1[_local2].updateBoundingBox();
_local1[_local2].setTheme(_local1.theme);
if (_local1[_local2] instanceof PuckMC) {
_local1.puckObjects.push(_local1[_local2]);
} else if (_local1[_local2] instanceof TableMC) {
_local1.tableObject = _local1[_local2];
} else if (_local1[_local2] instanceof MobileGameObjectMC) {
_local1.mobileObjects.push(_local1[_local2]);
} else if (_local1[_local2] instanceof WallMC) {
_local1.wallObjects.push(_local1[_local2]);
} else if (_local1[_local2] instanceof BlockerMC) {
_local1.blockerObjects.push(_local1[_local2]);
} else if (_local1[_local2] instanceof GoalMC) {
_local1.goalObjects.push(_local1[_local2]);
} else if (_local1[_local2] instanceof TrailMC) {
_local1.puckTrailObjects.push(_local1[_local2]);
}
}
_local1.puckObject = _local1.puckObjects[0];
_local1.updateBounds();
_local1.customOnLoad();
};
SceneMC.prototype.getActive = function () {
return(this.active);
};
SceneMC.prototype.setActive = function (active) {
this.active = active;
if (active) {
this.UpdatePlayerMalletPosition();
}
};
SceneMC.prototype.setTheme = function (theme) {
var _local1 = this;
var _local2 = theme;
_local1.theme = _local2;
for (var _local3 in _local1) {
if (_local1[_local3] instanceof GameObjectMC) {
_local1[_local3].setTheme(_local2);
}
}
};
SceneMC.prototype.setPuckMaxVelocity = function (v) {
var _local1 = this;
var _local2 = v;
for (var _local3 in _local1.puckObjects) {
_local1.puckObjects[_local3].setMaxVelocity(_local2);
}
};
SceneMC.prototype.SetComputerMalletMaxVelocity = function (v) {
this.computerMalletMC.setMaxVelocity(v);
};
SceneMC.prototype.setPuckFriction = function (friction) {
var _local1 = this;
var _local3 = friction;
for (var _local2 in _local1.puckObjects) {
_local1.puckObjects[_local2].setFriction(_local3);
}
};
SceneMC.prototype.setPuckTrailMaxWidth = function (w) {
var _local1 = this;
var _local3 = w;
for (var _local2 in _local1.puckTrailObjects) {
_local1.puckTrailObjects[_local2].setMaxWidth(_local3);
}
};
SceneMC.prototype.setPuckTrailMaxPositions = function (positions) {
var _local1 = this;
var _local3 = positions;
for (var _local2 in _local1.puckTrailObjects) {
_local1.puckTrailObjects[_local2].setMaxPositions(_local3);
}
};
SceneMC.prototype.setPuckTrailType = function (t) {
var _local1 = this;
var _local2 = t;
for (var _local3 in _local1.puckTrailObjects) {
_local1.puckTrailObjects[_local3].setType(_local2);
}
};
SceneMC.prototype.setObjectScale = function (scale) {
var _local1 = this;
var _local2 = scale;
for (var _local3 in _local1.puckObjects) {
_local1.puckObjects[_local3]._xscale = (_local1.puckObjects[_local3]._yscale = _local2 * 100);
_local1.puckObjects[_local3].getBoundingArea().setRadius(_local1.puckObjects[_local3]._height / 2);
}
_local1.playerMalletMC._xscale = (_local1.playerMalletMC._yscale = _local2 * 100);
_local1.computerMalletMC._xscale = (_local1.computerMalletMC._yscale = _local2 * 100);
_local1.playerMalletMC.getBoundingArea().setRadius(_local1.playerMalletMC._height / 2);
_local1.computerMalletMC.getBoundingArea().setRadius(_local1.computerMalletMC._height / 2);
_local1.UpdateBounds();
};
SceneMC.prototype.setGoalScale = function (scale) {
var _local1 = this;
for (var k in _local1.goalObjects) {
_local1.goalObjects[k]._xscale = scale * 100;
_local1.goalObjects[k].getBoundingArea().setXMax(_local1.goalObjects[k]._width / 2);
_local1.goalObjects[k].getBoundingArea().setXMin((-_local1.goalObjects[k]._width) / 2);
}
var goalX = _local1.goalObjects[0].getCenterX();
var _local2 = _local1.goalObjects[0].getBoundingArea().getXMin();
var _local3 = _local1.goalObjects[0].getBoundingArea().getXMax();
_local1.wall1MC.getBoundingArea().setX2((goalX + _local2) - _local1.wall1MC.getX());
_local1.wall5MC.getBoundingArea().setX2((goalX + _local2) - _local1.wall5MC.getX());
_local1.wall2MC.getBoundingArea().setX1((goalX + _local3) - _local1.wall2MC.getX());
_local1.wall4MC.getBoundingArea().setX1((goalX + _local3) - _local1.wall4MC.getX());
_local1.wall8MC.getBoundingArea().setX2(_local3);
_local1.wall8MC.getBoundingArea().setX1(_local2);
_local1.wall11MC.getBoundingArea().setX2(_local3);
_local1.wall11MC.getBoundingArea().setX1(_local2);
_local1.wall9MC.setX(_local3);
_local1.corner2MC.setX(_local3);
_local1.wall12MC.setX(_local3);
_local1.corner4MC.setX(_local3);
_local1.wall7MC.setX(_local2);
_local1.corner1MC.setX(_local2);
_local1.wall10MC.setX(_local2);
_local1.corner3MC.setX(_local2);
_local1.UpdateBounds();
};
SceneMC.prototype.init = function (lastPointWinner) {
var _local1 = this;
_local1.playerPuckBlockerMC.setActive(false);
_local1.computerPuckBlockerMC.setActive(false);
_local1.centerPuckBlockerMC.setActive(false);
switch (lastPointWinner) {
case PLAYER_HUMAN :
_local1.puckObject.setX(_local1.computerPuckBlockerMC.getX());
_local1.puckObject.setY(_local1.computerPuckBlockerMC.getY());
_local1.computerPuckBlockerMC.setActive(true);
break;
case PLAYER_COMPUTER :
_local1.puckObject.setX(_local1.playerPuckBlockerMC.getX());
_local1.puckObject.setY(_local1.playerPuckBlockerMC.getY());
_local1.playerPuckBlockerMC.setActive(true);
break;
case PLAYER_NONE :
default :
_local1.centerPuckBlockerMC.setActive(true);
}
_local1.active = true;
_local1.playerMalletMC.setMobile(true);
_local1.updatePlayerMalletPosition();
};
SceneMC.prototype.startPoint = function () {
var _local1 = this;
_local1.playerPuckBlockerMC.setActive(false);
_local1.computerPuckBlockerMC.setActive(false);
_local1.centerPuckBlockerMC.setActive(false);
_local1.puckObject.setMobile(true);
_local1.computerMalletMC.setMobile(true);
};
SceneMC.prototype.updateBounds = function () {
var _local1 = this;
var _local3 = _local1.puckObjects[0].getBoundingArea().getRadius();
var _local2 = _local1.tableObject.getBoundingArea();
_local1.tableBounds = {xMin:_local2.getXMin() + _local3, xMax:_local2.getXMax() - _local3, yMin:_local2.getYMin() + _local3, yMax:_local2.getYMax() - _local3};
_local1.goalBounds = new Object();
for (var k in _local1.goalObjects) {
_local2 = _local1.goalObjects[k].getBoundingArea();
var xMin = ((_local1.goalObjects[k].getX() + _local2.getXMin()) + _local3);
if ((_local1.goalBounds.xMin === undefined) || (xMin < _local1.goalBounds.xMin)) {
_local1.goalBounds.xMin = xMin;
}
var xMax = ((_local1.goalObjects[k].getX() + _local2.getXMax()) - _local3);
if ((_local1.goalBounds.xMax === undefined) || (xMax > _local1.goalBounds.xMax)) {
_local1.goalBounds.xMax = xMax;
}
var yMin = ((_local1.goalObjects[k].getY() + _local2.getYMin()) + _local3);
if ((_local1.goalBounds.yMin === undefined) || (yMin < _local1.goalBounds.yMin)) {
_local1.goalBounds.yMin = yMin;
}
var yMax = ((_local1.goalObjects[k].getY() + _local2.getYMax()) - _local3);
if ((_local1.goalBounds.yMax === undefined) || (yMax > _local1.goalBounds.yMax)) {
_local1.goalBounds.yMax = yMax;
}
}
};
SceneMC.prototype.onEnterFrame = function () {
var _local1 = this;
if (_local1.active && (_local1.puckObject.getMobile())) {
_local1.puckObject.onTime();
_local1.playerMalletMC.onTime();
_local1.computerMalletMC.onTime();
_local1.resolveBlockerOverlaps();
_local1.resolveCollisions();
_local1.resolveOverlaps();
_local1.puckTrailObjects[0].addPosition(_local1.puckObject.getCenterX(), _local1.puckObject.getCenterY());
_local1.puckTrailObjects[0].postOnTime();
_local1.puckObject.postOnTime();
_local1.playerMalletMC.postOnTime();
_local1.computerMalletMC.postOnTime();
_local1.checkWinner();
}
};
SceneMC.prototype.updatePlayerMalletPosition = function () {
var _local1 = this;
_local1.playerMalletMC.setX(_local1._xmouse);
_local1.playerMalletMC.setY(_local1._ymouse);
_local1.playerMalletMC.updateBoundingBox();
if (_local1.centerPuckBlockerMC.getActive()) {
_local1.resolveCircleCircleOverlap(_local1.playerMalletMC, _local1.centerPuckBlockerMC, false);
}
if (_local1.playerPuckBlockerMC.getActive()) {
_local1.resolveCircleCircleOverlap(_local1.playerMalletMC, _local1.playerPuckBlockerMC, false);
}
_local1.resolveCircleCircleOverlap(_local1.playerMalletMC, _local1.playerGoalBlockerMC, false);
};
SceneMC.prototype.onMouseMove = function () {
var _local1 = this;
if (_local1.active && (_local1.playerMalletMC.getMobile())) {
_local1.updatePlayerMalletPosition();
updateAfterEvent();
}
};
SceneMC.prototype.incrementTime = function (dt) {
var _local1 = this;
var _local2 = dt;
_local1.puckObject.setPrevX(_local1.puckObject.getPrevX() + (_local2 * _local1.puckObject.getVx()));
_local1.puckObject.setPrevY(_local1.puckObject.getPrevY() + (_local2 * _local1.puckObject.getVy()));
for (var _local3 in _local1.mobileObjects) {
_local1.mobileObjects[_local3].setPrevX(_local1.mobileObjects[_local3].getPrevX() + (_local2 * _local1.mobileObjects[_local3].getVx()));
_local1.mobileObjects[_local3].setPrevY(_local1.mobileObjects[_local3].getPrevY() + (_local2 * _local1.mobileObjects[_local3].getVy()));
}
};
SceneMC.prototype.resolveCollisions = function () {
var _local2 = this;
var _local3 = 0;
var done = false;
var k;
var prevC = null;
k = 0;
while ((k < _local2.maxCollisionLoops) && (!done)) {
done = true;
var _local1 = _local2.getFirstCollision(prevC);
if (!(_local1.t === false)) {
done = false;
var dt = (_local1.t * (1 - _local3));
_local3 = _local3 + dt;
_local2.incrementTime(dt);
prevC = _local1;
if (_local1.mc2 instanceof WallMC) {
_local2.resolvePuckWallCollision(_local1.mc1, _local1.mc2);
} else if (_local1.mc2 instanceof PuckMC) {
_local2.resolvePuckPuckCollision(_local1.mc1, _local1.mc2);
} else if (_local1.mc2 instanceof MobileGameObjectMC) {
_local2.resolvePuckMalletCollision(_local1.mc1, _local1.mc2);
}
_local1.mc1.setX(_local1.mc1.getPrevX() + ((1 - _local3) * _local1.mc1.getVx()));
_local1.mc1.setY(_local1.mc1.getPrevY() + ((1 - _local3) * _local1.mc1.getVy()));
if (_local1.mc2 instanceof PuckMC) {
_local1.mc2.setX(_local1.mc2.getPrevX() + ((1 - _local3) * _local1.mc2.getVx()));
_local1.mc2.setY(_local1.mc2.getPrevY() + ((1 - _local3) * _local1.mc2.getVy()));
}
for (var j in _local2.puckObjects) {
_local2.puckObjects[j].updateBoundingBox();
}
for (var j in _local2.mobileObjects) {
_local2.mobileObjects[j].updateBoundingBox();
}
_local1.mc1.onCollide();
_local1.mc2.onCollide();
}
k++;
}
};
SceneMC.prototype.MCBoundingBoxesOverlap = function (mc1, mc2) {
var _local2 = mc1.getBoundingBox();
var _local1 = mc2.getBoundingBox();
var box1 = {xMin:_local2.getXMin(), xMax:_local2.getXMax(), yMin:_local2.getYMin(), yMax:_local2.getYMax()};
var _local3 = {xMin:_local1.getXMin(), xMax:_local1.getXMax(), yMin:_local1.getYMin(), yMax:_local1.getYMax()};
return(Collisions.AABBOverlapsAABB(box1, _local3));
};
SceneMC.prototype.puckInsideTable = function (puck) {
var _local1 = {x:puck.GetCenterX(), y:puck.GetCenterY()};
return(Collisions.pointInBox(_local1, this.tableBounds));
};
SceneMC.prototype.getFirstCollision = function (prevC) {
var _local1 = this;
var _local3 = prevC;
var t = false;
var mc1 = _local1.puckObject;
for (var k in _local1.mobileObjects) {
if (_local1.mobileObjects[k] === _local3.mc2) {
continue;
}
var _local2 = _local1.puckCollidesMallet(mc1, _local1.mobileObjects[k]);
if ((!(_local2 === false)) && ((t === false) || (_local2 < t))) {
t = _local2;
mc2 = _local1.mobileObjects[k];
}
}
if (!_local1.puckInsideTable(mc1)) {
for (var k in _local1.wallObjects) {
if (!(_local1.wallObjects[k] === _local3.mc2)) {
var _local2 = _local1.puckCollidesWall(mc1, _local1.wallObjects[k]);
if ((!(_local2 === false)) && ((t === false) || (_local2 < t))) {
t = _local2;
mc2 = _local1.wallObjects[k];
}
}
}
}
return({t:t, mc1:mc1, mc2:mc2});
};
SceneMC.prototype.puckCollidesMallet = function (puck, mallet) {
var _local1 = puck;
var _local2 = mallet;
if (!this.MCBoundingBoxesOverlap(_local1, _local2)) {
return(false);
}
var puckArea = _local1.getBoundingArea();
var _local3 = _local2.getBoundingArea();
var puckData = {x1:_local1.getPrevCenterX(), x2:_local1.getCenterX(), y1:_local1.getPrevCenterY(), y2:_local1.getCenterY(), r:puckArea.getRadius()};
var malletData = {x1:_local2.getPrevCenterX(), x2:_local2.getCenterX(), y1:_local2.getPrevCenterY(), y2:_local2.getCenterY(), r:_local3.getRadius()};
return(Collisions.circleCollidesCircle(puckData, malletData));
};
SceneMC.prototype.puckCollidesPuck = function (puck1, puck2) {
var _local1 = puck2;
var _local2 = puck1;
if (!this.MCBoundingBoxesOverlap(_local2, _local1)) {
return(false);
}
var puck1Area = _local2.getBoundingArea();
var _local3 = _local1.getBoundingArea();
var puck1Data = {x1:_local2.getPrevCenterX(), x2:_local2.getCenterX(), y1:_local2.getPrevCenterY(), y2:_local2.getCenterY(), r:puck1Area.getRadius()};
var puck2Data = {x1:_local1.getPrevCenterX(), x2:_local1.getCenterX(), y1:_local1.getPrevCenterY(), y2:_local1.getCenterY(), r:_local3.getRadius()};
return(Collisions.circleCollidesCircle(puck1Data, puck2Data));
};
SceneMC.prototype.puckCollidesWall = function (puck, wall) {
var _local1 = wall;
var _local3 = puck;
if (!this.MCBoundingBoxesOverlap(_local3, _local1)) {
return(false);
}
var area1 = _local3.getBoundingArea();
var _local2 = _local1.getBoundingArea();
var puckData = {x1:_local3.getPrevCenterX(), x2:_local3.getCenterX(), y1:_local3.getPrevCenterY(), y2:_local3.getCenterY(), r:area1.getRadius()};
if (_local2 instanceof BoundingLine) {
var wallData = {x1:_local1.getX() + _local2.getX1(), x2:_local1.getX() + _local2.getX2(), y1:_local1.getY() + _local2.getY1(), y2:_local1.getY() + _local2.getY2()};
return(Collisions.circleCollidesLine(puckData, wallData));
}
if (_local2 instanceof BoundingCircle) {
var wallData = {x1:_local1.getCenterX(), x2:_local1.getCenterX(), y1:_local1.getCenterY(), y2:_local1.getCenterY(), r:_local2.getRadius()};
return(Collisions.circleCollidesCircle(puckData, wallData));
}
return(false);
};
SceneMC.prototype.resolvePuckMalletCollision = function (puck, mallet) {
var _local1 = puck;
var _local2 = mallet;
var _local3 = {x:_local1.getPrevCenterX(), y:_local1.getPrevCenterY(), vx:_local1.getVx(), vy:_local1.getVy(), mass:_local1.getMass()};
var malletResolveData = {x:_local2.getPrevCenterX(), y:_local2.getPrevCenterY(), vx:_local2.getVx(), vy:_local2.getVy(), mass:_local2.getMass()};
Collisions.resolveCircleCircleCollision(_local3, malletResolveData);
_local1.setVelocity(_local3.vx, _local3.vy);
};
SceneMC.prototype.resolvePuckPuckCollision = function (puck1, puck2) {
var _local1 = puck2;
var _local2 = puck1;
var puck1ResolveData = {x:_local2.getPrevCenterX(), y:_local2.getPrevCenterY(), vx:_local2.getVx(), vy:_local2.getVy(), mass:_local2.getMass()};
var _local3 = {x:_local1.getPrevCenterX(), y:_local1.getPrevCenterY(), vx:_local1.getVx(), vy:_local1.getVy(), mass:_local1.getMass()};
Collisions.resolveCircleCircleCollision(puck1ResolveData, _local3);
_local2.setVelocity(puck1ResolveData.vx, puck1ResolveData.vy);
_local1.setVelocity(_local3.vx, _local3.vy);
};
SceneMC.prototype.resolvePuckWallCollision = function (puck, wall) {
var _local1 = wall;
var _local3 = puck;
if (!_local1.getSticky()) {
var _local2 = _local1.getBoundingArea();
var puckResolveData = {x:_local3.getPrevCenterX(), y:_local3.getPrevCenterY(), vx:_local3.getVx(), vy:_local3.getVy(), mass:_local3.getMass()};
if (_local2 instanceof BoundingLine) {
var wallResolveData = {x1:_local1.getX() + _local2.getX1(), x2:_local1.getX() + _local2.getX2(), y1:_local1.getY() + _local2.getY1(), y2:_local1.getY() + _local2.getY2()};
Collisions.resolveCircleLineCollision(puckResolveData, wallResolveData);
} else if (_local2 instanceof BoundingCircle) {
var wallResolveData = {x:_local1.getCenterX(), y:_local1.getCenterY(), vx:0, vy:0, mass:0};
Collisions.resolveCircleCircleCollision(puckResolveData, wallResolveData);
}
_local3.setVelocity(puckResolveData.vx, puckResolveData.vy);
} else {
_local3.setVelocity(0, 0);
}
};
SceneMC.prototype.resolveOverlaps = function () {
var _local1 = this;
for (var _local2 in _local1.mobileObjects) {
_local1.resolveCircleCircleOverlap(_local1.puckObject, _local1.mobileObjects[_local2], true);
}
_local1.resolvePuckWallOverlaps(_local1.puckObject);
for (var _local2 in _local1.mobileObjects) {
_local1.resolveCircleCircleOverlap(_local1.mobileObjects[_local2], _local1.puckObject, false);
}
};
SceneMC.prototype.resolveBlockerOverlaps = function () {
var _local2 = this;
for (var j in _local2.blockerObjects) {
if (!_local2.blockerObjects[j].getActive()) {
continue;
}
var _local1 = _local2.blockerObjects[j].getTargetMCs();
for (var _local3 in _local1) {
_local2.resolveCircleCircleOverlap(_local1[_local3], _local2.blockerObjects[j], false);
_local1[_local3].updateVelocity();
}
}
};
SceneMC.prototype.resolveCircleCircleOverlap = function (object1, object2, updateVelocity) {
var _local1 = object1;
if (!this.MCBoundingBoxesOverlap(_local1, object2)) {
return(false);
}
var _local3 = object2.getCenterX() - _local1.getCenterX();
var _local2 = object2.getCenterY() - _local1.getCenterY();
if ((_local3 == 0) && (_local2 == 0)) {
_local2 = 0.1;
}
var area1 = _local1.getBoundingArea();
var area2 = object2.getBoundingArea();
var minDist = (area1.getRadius() + area2.getRadius());
var dist = Math.dist2D(_local3, _local2);
var overlapDist = (minDist - dist);
if ((overlapDist > 0) && (dist > 0)) {
_local3 = _local3 * ((-overlapDist) / dist);
_local2 = _local2 * ((-overlapDist) / dist);
_local1.setX(_local1.getX() + _local3);
_local1.setY(_local1.getY() + _local2);
if (updateVelocity) {
_local1.setVx(_local1.getVx() + _local3);
_local1.setVy(_local1.getVy() + _local2);
}
_local1.updateBoundingBox();
}
return(undefined);
};
SceneMC.prototype.resolvePuckWallOverlaps = function (puck) {
var _local1 = this;
var r = puck.getBoundingArea().getRadius();
var _local3 = puck.getX();
var _local2 = puck.getY();
var vx = puck.getVx();
var vy = puck.getVy();
if (_local3 <= _local1.tableBounds.xMin) {
_local3 = _local1.tableBounds.xMin;
vx = Math.abs(vx);
} else if (_local3 >= _local1.tableBounds.xMax) {
_local3 = _local1.tableBounds.xMax;
vx = -Math.abs(vx);
}
if ((_local3 < (_local1.goalBounds.xMin - r)) || (_local3 > (_local1.goalBounds.xMax + r))) {
if (_local2 <= _local1.tableBounds.yMin) {
_local2 = _local1.tableBounds.yMin;
vy = Math.abs(vy);
} else if (_local2 >= _local1.tableBounds.yMax) {
_local2 = _local1.tableBounds.yMax;
vy = -Math.abs(vy);
}
} else {
if ((_local2 <= _local1.goalBounds.yMin) || (_local2 >= _local1.goalBounds.yMax)) {
_local2 = Math.min(_local1.goalBounds.yMax, Math.max(_local1.goalBounds.yMin, _local2));
vx = 0;
vy = 0;
}
if ((_local2 <= (_local1.tableBounds.yMin - t)) || (_local2 >= (_local1.tableBounds.yMax + r))) {
_local3 = Math.min(_local1.goalBounds.xMax, Math.max(_local1.goalBounds.xMin, _local3));
}
}
puck.setX(_local3);
puck.setY(_local2);
puck.setVx(vx);
puck.setVy(vy);
};
SceneMC.prototype.checkWinner = function () {
var _local1 = this;
var puckPos = {x:_local1.puckObject.getCenterX(), y:_local1.puckObject.getCenterY()};
for (var k in _local1.goalObjects) {
if (_local1.goalObjects[k].getScored()) {
return;
}
var _local2 = _local1.goalObjects[k].getBoundingArea();
var _local3 = {xMin:_local1.goalObjects[k].getX() + _local2.getXMin(), xMax:_local1.goalObjects[k].getX() + _local2.getXMax(), yMin:_local1.goalObjects[k].getY() + _local2.getYMin(), yMax:_local1.goalObjects[k].getY() + _local2.getYMax()};
if (Collisions.pointInBox(puckPos, _local3)) {
_local1.onWin(_local1.goalObjects[k].getPlayerID());
_local1.computerMalletMC.setMobile(false);
_local1.goalObjects[k].onScore();
}
}
};
_global.MultiballSceneMC = function () {
super();
this.maxCollisionLoops = 5;
};
MultiballSceneMC.prototype = new SceneMC();
MultiballSceneMC.prototype.init = function (lastPointWinner) {
var _local1 = this;
_local1.active = true;
_local1.playerMalletMC.setMobile(true);
_local1.updatePlayerMalletPosition();
};
MultiballSceneMC.prototype.startPoint = function () {
var _local1 = this;
_local1.leftPuckBlockerMC.setActive(false);
_local1.centerPuckBlockerMC.setActive(false);
_local1.rightPuckBlockerMC.setActive(false);
for (var _local2 in _local1.puckObjects) {
_local1.puckObjects[_local2].setMobile(true);
}
_local1.computerMalletMC.setMobile(true);
};
MultiballSceneMC.prototype.onEnterFrame = function () {
var _local1 = this;
if (_local1.active) {
for (var _local2 in _local1.puckObjects) {
_local1.puckObjects[_local2].onTime();
}
_local1.playerMalletMC.onTime();
_local1.computerMalletMC.onTime();
_local1.resolveBlockerOverlaps();
_local1.resolveCollisions();
_local1.resolveOverlaps();
for (var _local2 in _local1.puckObjects) {
_local1.puckTrailObjects[_local2].addPosition(_local1.puckObjects[_local2].getCenterX(), _local1.puckObjects[_local2].getCenterY());
_local1.puckTrailObjects[_local2].postOnTime();
_local1.puckObjects[_local2].postOnTime();
}
_local1.playerMalletMC.postOnTime();
_local1.computerMalletMC.postOnTime();
_local1.checkWinner();
}
};
MultiballSceneMC.prototype.updatePlayerMalletPosition = function () {
var _local1 = this;
_local1.playerMalletMC.setX(_local1._xmouse);
_local1.playerMalletMC.setY(_local1._ymouse);
_local1.playerMalletMC.updateBoundingBox();
if (_local1.centerPuckBlockerMC.getActive()) {
_local1.resolveCircleCircleOverlap(_local1.playerMalletMC, _local1.centerPuckBlockerMC, false);
}
if (_local1.leftPuckBlockerMC.getActive()) {
_local1.resolveCircleCircleOverlap(_local1.playerMalletMC, _local1.leftPuckBlockerMC, false);
}
if (_local1.rightPuckBlockerMC.getActive()) {
_local1.resolveCircleCircleOverlap(_local1.playerMalletMC, _local1.rightPuckBlockerMC, false);
}
_local1.resolveCircleCircleOverlap(_local1.playerMalletMC, _local1.playerGoalBlockerMC, false);
};
MultiballSceneMC.prototype.onMouseMove = function () {
var _local1 = this;
if (_local1.active && (_local1.playerMalletMC.getMobile())) {
_local1.updatePlayerMalletPosition();
updateAfterEvent();
}
};
MultiballSceneMC.prototype.incrementTime = function (dt) {
var _local1 = this;
var _local2 = dt;
for (var _local3 in _local1.puckObjects) {
_local1.puckObjects[_local3].setPrevX(_local1.puckObjects[_local3].getPrevX() + (_local2 * _local1.puckObjects[_local3].getVx()));
_local1.puckObjects[_local3].setPrevY(_local1.puckObjects[_local3].getPrevY() + (_local2 * _local1.puckObjects[_local3].getVy()));
}
for (var _local3 in _local1.mobileObjects) {
_local1.mobileObjects[_local3].setPrevX(_local1.mobileObjects[_local3].getPrevX() + (_local2 * _local1.mobileObjects[_local3].getVx()));
_local1.mobileObjects[_local3].setPrevY(_local1.mobileObjects[_local3].getPrevY() + (_local2 * _local1.mobileObjects[_local3].getVy()));
}
};
MultiballSceneMC.prototype.getFirstCollision = function (prevC) {
var _local1 = this;
var t = false;
var mc1 = null;
var mc2 = null;
for (var j in _local1.puckObjects) {
mc1 = _local1.puckObjects[j];
var puckInC = ((mc1 === prevC.mc1) || (mc1 === prevC.mc2));
for (var k in _local1.mobileObjects) {
if (_local1.mobileObjects[k] === prevC.mc2) {
continue;
}
var _local2 = _local1.puckCollidesMallet(mc1, _local1.mobileObjects[k]);
if ((!(_local2 === false)) && ((t === false) || (_local2 < t))) {
t = _local2;
mc2 = _local1.mobileObjects[k];
}
}
for (var k in _local1.puckObjects) {
if (((_local1.puckObjects[k] === prevC.mc1) || (_local1.puckObjects[k] === prevC.mc2)) && (puckInC)) {
continue;
}
var _local2 = _local1.puckCollidesPuck(mc1, _local1.puckObjects[k]);
if ((!(_local2 === false)) && ((t === false) || (_local2 < t))) {
t = _local2;
mc2 = _local1.puckObjects[k];
}
}
if (!_local1.puckInsideTable(mc1)) {
for (var k in _local1.wallObjects) {
if (!(_local1.wallObjects[k] === prevC.mc2)) {
var _local3 = _local1.puckCollidesWall(mc1, _local1.wallObjects[k]);
if ((!(_local3 === false)) && ((t === false) || (_local3 < t))) {
t = _local3;
mc2 = _local1.wallObjects[k];
}
}
}
}
}
return({t:t, mc1:mc1, mc2:mc2});
};
MultiballSceneMC.prototype.resolveOverlaps = function () {
var _local1 = this;
for (var _local3 in _local1.puckObjects) {
for (var _local2 in _local1.mobileObjects) {
_local1.resolveCircleCircleOverlap(_local1.puckObjects[_local3], _local1.mobileObjects[_local2], true);
}
for (var _local2 in _local1.puckObjects) {
if (_local3 != _local2) {
_local1.resolveCircleCircleOverlap(_local1.puckObjects[_local3], _local1.puckObjects[_local2], false);
}
}
}
for (var _local2 in _local1.puckObjects) {
_local1.resolvePuckWallOverlaps(_local1.puckObjects[_local2]);
}
for (var _local3 in _local1.puckObjects) {
for (var _local2 in _local1.puckObjects) {
if (_local3 != _local2) {
_local1.resolveCircleCircleOverlap(_local1.puckObjects[_local3], _local1.puckObjects[_local2], false);
}
}
for (var _local2 in _local1.mobileObjects) {
_local1.resolveCircleCircleOverlap(_local1.mobileObjects[_local2], _local1.puckObjects[_local3], false);
}
}
};
MultiballSceneMC.prototype.checkWinner = function () {
var _local1 = this;
for (var k in _local1.goalObjects) {
var _local3 = _local1.goalObjects[k].getBoundingArea();
var box = {xMin:_local1.goalObjects[k].getX() + _local3.getXMin(), xMax:_local1.goalObjects[k].getX() + _local3.getXMax(), yMin:_local1.goalObjects[k].getY() + _local3.getYMin(), yMax:_local1.goalObjects[k].getY() + _local3.getYMax()};
for (var j in _local1.puckObjects) {
var _local2 = {x:_local1.puckObjects[j].getCenterX(), y:_local1.puckObjects[j].getCenterY()};
if (Collisions.pointInBox(_local2, box)) {
_local1.onPoint(_local1.goalObjects[k].getPlayerID());
_local1.puckTrailObjects[j].clearPositions();
_local1.puckObjects[j].SetX(75);
_local1.puckObjects[j].SetY(150);
_local1.puckObjects[j].SetVx(0);
_local1.puckObjects[j].SetVy(0);
}
}
}
};
_global.ButtonMC = function () {
var _local1 = this;
super();
_local1.stop();
_local1.label = "";
_local1.state = _local1.STATE_UP;
_local1.hitArea = _local1.hitAreaMC;
_local1.hitAreaMC._visible = false;
_local1.upOnDragOut = true;
};
ButtonMC.prototype = new MovieClip();
ButtonMC.prototype.STATE_UP = 0;
ButtonMC.prototype.STATE_OVER = 1;
ButtonMC.prototype.STATE_DOWN = 2;
ButtonMC.prototype.STATE_DISABLED = 3;
ButtonMC.prototype.GetUpOnDragOut = function () {
return(this.upOnDragOut);
};
ButtonMC.prototype.GetState = function () {
return(this.state);
};
ButtonMC.prototype.GetLabel = function () {
return(this.label);
};
ButtonMC.prototype.SetUpOnDragOut = function (release) {
this.upOnDragOut = release;
};
ButtonMC.prototype.SetLabel = function (label) {
this.label = label;
};
ButtonMC.prototype.SetState = function (state) {
this.state = state;
this.UpdateState();
};
ButtonMC.prototype.UpdateState = function () {
var _local1 = this;
switch (_local1.state) {
case _local1.STATE_DISABLED :
_local1.gotoAndStop("disabled");
return;
case _local1.STATE_OVER :
_local1.gotoAndStop("over");
return;
case _local1.STATE_DOWN :
_local1.gotoAndStop("over");
_local1.gotoAndStop("down");
return;
case _local1.STATE_UP :
default :
_local1.gotoAndStop("up");
}
};
ButtonMC.prototype.MouseIsOver = function () {
return(this.hitTest(_root._xmouse, _root._ymouse, true));
};
ButtonMC.prototype.onRollOver = function () {
var _local1 = this;
if (_local1.state != _local1.STATE_DISABLED) {
_local1.SetState(_local1.STATE_OVER);
_local1.OnOver();
}
};
ButtonMC.prototype.onDragOver = function () {
var _local1 = this;
if (_local1.state != _local1.STATE_DISABLED) {
_local1.SetState(_local1.STATE_DOWN);
_local1.OnDown();
}
};
ButtonMC.prototype.onRollOut = function () {
var _local1 = this;
if (_local1.state != _local1.STATE_DISABLED) {
_local1.SetState(_local1.STATE_UP);
_local1.OnUp();
}
};
ButtonMC.prototype.onDragOut = function () {
var _local1 = this;
if ((_local1.state != _local1.STATE_DISABLED) && (_local1.upOnDragOut)) {
_local1.SetState(_local1.STATE_UP);
_local1.OnUp();
}
};
ButtonMC.prototype.onPress = function () {
var _local1 = this;
if (_local1.state != _local1.STATE_DISABLED) {
_local1.SetState(_local1.STATE_DOWN);
_local1.OnDown();
}
};
ButtonMC.prototype.onRelease = function () {
var _local1 = this;
if (_local1.state != _local1.STATE_DISABLED) {
_local1.SetState(_local1.STATE_OVER);
_local1.OnUp();
_local1.onClick();
}
};
ButtonMC.prototype.onReleaseOutside = function () {
var _local1 = this;
if ((_local1.state != _local1.STATE_DISABLED) && (!_local1.upOnDragOut)) {
_local1.SetState(_local1.STATE_UP);
_local1.OnUp();
_local1.onClick();
}
};
ButtonMC.prototype.Enable = function () {
var _local1 = this;
if (_local1.MouseIsOver()) {
_local1.SetState(_local1.STATE_OVER);
} else {
_local1.SetState(_local1.STATE_UP);
}
_local1.useHandCursor = true;
};
ButtonMC.prototype.Disable = function () {
var _local1 = this;
_local1.SetState(_local1.STATE_DISABLED);
_local1.useHandCursor = false;
};
_global.SmallButtonMC = function () {
super();
};
SmallButtonMC.prototype = new ButtonMC();
_global.MediumButtonMC = function () {
super();
};
MediumButtonMC.prototype = new ButtonMC();
_global.WebLinkButtonMC = function () {
super();
};
WebLinkButtonMC.prototype = new ButtonMC();
_global.BooleanButtonMC = function () {
var _local1 = this;
super();
_local1.checked = false;
_local1.value = null;
_local1.group = null;
};
BooleanButtonMC.prototype = new ButtonMC();
BooleanButtonMC.prototype.GetChecked = function () {
return(this.checked);
};
BooleanButtonMC.prototype.GetValue = function () {
return(this.value);
};
BooleanButtonMC.prototype.GetGroup = function () {
return(this.group);
};
BooleanButtonMC.prototype.SetChecked = function (checked) {
this.checked = checked;
this.UpdateState();
};
BooleanButtonMC.prototype.SetValue = function (value) {
this.value = value;
};
BooleanButtonMC.prototype.SetGroup = function (group) {
this.group = group;
};
BooleanButtonMC.prototype.UpdateState = function () {
var _local1 = this;
if (_local1.checked) {
switch (_local1.state) {
case _local1.STATE_DISABLED :
_local1.gotoAndStop("disabled");
_local1.gotoAndStop("disabled_checked");
break;
case _local1.STATE_OVER :
_local1.gotoAndStop("over");
_local1.gotoAndStop("over_checked");
break;
case _local1.STATE_DOWN :
_local1.gotoAndStop("over");
_local1.gotoAndStop("over_checked");
_local1.gotoAndStop("down");
_local1.gotoAndStop("down_checked");
break;
case _local1.STATE_UP :
default :
_local1.gotoAndStop("up");
_local1.gotoAndStop("up_checked");
}
} else {
super.UpdateState();
}
};
BooleanButtonMC.prototype.Check = function () {
var _local1 = this;
if ((_local1.state != _local1.STATE_DISABLED) && (!_local1.checked)) {
_local1.SetChecked(true);
}
};
BooleanButtonMC.prototype.Uncheck = function () {
var _local1 = this;
if ((_local1.state != _local1.STATE_DISABLED) && (_local1.checked)) {
_local1.SetChecked(false);
}
};
_global.BooleanButtonGroup = function () {
this.buttons = new Array();
};
BooleanButtonGroup.prototype.AddButton = function (mc, value) {
var _local1 = mc;
var _local2 = this;
_local2.buttons[value] = _local1;
_local1.SetValue(value);
_local1.SetGroup(_local2);
_local1.Uncheck();
_local1.OnCheck = function () {
this.GetGroup().OnButtonChecked(this.GetValue());
};
_local1.OnUncheck = function () {
this.GetGroup().OnButtonUnchecked(this.GetValue());
};
};
BooleanButtonGroup.prototype.GetValue = function () {
var _local1 = this;
var _local2 = new Array();
for (var _local3 in _local1.buttons) {
if (_local1.buttons[_local3].GetChecked()) {
_local2.push(_local1.buttons[_local3].GetValue());
}
}
return(_local2);
};
BooleanButtonGroup.prototype.SetValue = function (value) {
var _local1 = this;
var _local2 = value;
for (var _local3 in _local1.buttons) {
_local1.buttons[_local3].Uncheck();
}
if (typeof(_local2) == "object") {
for (var _local3 in _local2) {
if (!(_local1.buttons[_local2[_local3]] === undefined)) {
_local1.buttons[_local2[_local3]].Check();
}
}
} else if (!(_local1.buttons[_local2] === undefined)) {
_local1.buttons[_local2].Check();
}
};
BooleanButtonGroup.prototype.OnButtonChecked = function (value) {
this.OnChangeValue(this.GetValue());
};
BooleanButtonGroup.prototype.OnButtonUnchecked = function (value) {
this.OnChangeValue(this.GetValue());
};
_global.RadioButtonMC = function () {
super();
};
RadioButtonMC.prototype = new BooleanButtonMC();
RadioButtonMC.prototype.OnClick = function () {
var _local1 = this;
if (!_local1.checked) {
_local1.SetChecked(true);
_local1.OnCheck();
}
};
_global.SmallRadioButtonMC = function () {
super();
};
SmallRadioButtonMC.prototype = new RadioButtonMC();
_global.IconRadioButtonMC = function () {
super();
this.symbol = null;
};
IconRadioButtonMC.prototype = new RadioButtonMC();
IconRadioButtonMC.prototype.onLoad = function () {
this.RemoveIcon();
this.CreateIcon();
super.onLoad();
};
IconRadioButtonMC.prototype.SetSymbol = function (symbol) {
var _local1 = this;
_local1.RemoveIcon();
_local1.symbol = symbol;
_local1.CreateIcon();
};
IconRadioButtonMC.prototype.CreateIcon = function () {
var _local1 = this;
if (_local1.symbol != null) {
_local1.iconMC.attachMovie(_local1.symbol, "icon", 0);
}
};
IconRadioButtonMC.prototype.RemoveIcon = function () {
this.iconMC.icon.removeMovieClip();
};
_global.RadioButtonGroup = function () {
this.buttons = new Array();
};
RadioButtonGroup.prototype = new BooleanButtonGroup();
RadioButtonGroup.prototype.GetValue = function () {
var _local1 = super.GetValue();
if (_local1.length > 0) {
return(_local1[0]);
}
return(null);
};
RadioButtonGroup.prototype.SetValue = function (value) {
var _local1 = value;
var _local2 = _local1;
if (typeof(_local1) == "object") {
for (var _local3 in _local1) {
_local2 = _local1[_local3];
break;
}
}
super.SetValue(_local2);
};
RadioButtonGroup.prototype.OnButtonChecked = function (value) {
var _local2 = this;
var _local3 = value;
var _local1 = 0;
while (_local1 < _local2.buttons.length) {
if (_local2.buttons[_local1].GetValue() != _local3) {
_local2.buttons[_local1].Uncheck();
}
_local1++;
}
super.OnButtonChecked(_local3);
};
_global.SlideBarSliderMC = function () {
var _local1 = this;
super();
_local1.upOnDragOut = false;
_local1.minX = 0;
_local1.maxX = 0;
_local1.mouseOffsetX = 0;
_local1.mouseOffsetY = 0;
};
SlideBarSliderMC.prototype = new ButtonMC();
SlideBarSliderMC.prototype.GetMinX = function () {
return(this.minX);
};
SlideBarSliderMC.prototype.GetMaxX = function () {
return(this.maxX);
};
SlideBarSliderMC.prototype.GetX = function () {
return(this._x);
};
SlideBarSliderMC.prototype.SetMinX = function (x) {
this.minX = x;
};
SlideBarSliderMC.prototype.SetMaxX = function (x) {
this.maxX = x;
};
SlideBarSliderMC.prototype.SetX = function (x) {
var _local1 = this;
_local1._x = Math.max(_local1.minX, Math.min(_local1.maxX, x));
};
SlideBarSliderMC.prototype.StartDrag = function () {
var _local1 = this;
_local1.SetState(_local1.STATE_DOWN);
_local1.mouseOffsetX = 0;
_local1.UpdatePosition();
_local1.OnStartDrag();
};
SlideBarSliderMC.prototype.StopDrag = function () {
var _local1 = this;
if (_local1.MouseIsOver()) {
_local1.SetState(_local1.STATE_OVER);
} else {
_local1.SetState(_local1.STATE_UP);
}
_local1.OnStopDrag();
};
SlideBarSliderMC.prototype.OnUp = function () {
this.OnStopDrag();
};
SlideBarSliderMC.prototype.OnDown = function () {
this.OnStartDrag();
};
SlideBarSliderMC.prototype.onMouseMove = function () {
var _local1 = this;
if (_local1.state == _local1.STATE_DOWN) {
_local1.UpdatePosition();
}
};
SlideBarSliderMC.prototype.UpdatePosition = function () {
var _local1 = this;
var _local2 = _local1._x;
_local1.SetX(_local1._parent._xmouse - _local1.mouseOffsetX);
if (_local2 != _local1._x) {
_local1.OnMove();
updateAfterEvent();
}
};
SlideBarSliderMC.prototype.onPress = function () {
var _local1 = this;
if (_local1.status != _local1.STATUS_DISABLED) {
_local1.mouseOffsetX = _local1._parent._xmouse - _local1._x;
_local1.mouseOffsetY = _local1._parent._ymouse - _local1._y;
}
super.onPress();
};
_global.SlideBarBarMC = function () {
super();
this.upOnDragOut = false;
};
SlideBarBarMC.prototype = new ButtonMC();
_global.SlideBarMC = function () {
var _local1 = this;
super();
_local1.stop();
_local1.value = 0;
_local1.sliderMaxX = null;
_local1.sliderMinX = null;
_local1.minValue = 0;
_local1.maxValue = 1;
_local1.intervalSize = 0;
};
SlideBarMC.prototype = new MovieClip();
SlideBarMC.prototype.onLoad = function () {
var _local1 = this;
var _local2 = _local1.barMC.getBounds(_local1);
var _local3 = _local1.sliderMC.getBounds(_local1);
if (_local1.sliderMaxX === null) {
_local1.sliderMaxX = _local2.xMax - (_local3.xMax - _local1.sliderMC._x);
}
if (_local1.sliderMinX === null) {
_local1.sliderMinX = _local2.xMin - (_local3.xMin - _local1.sliderMC._x);
}
_local1.sliderMC.SetMinX(_local1.sliderMinX);
_local1.sliderMC.SetMaxX(_local1.sliderMaxX);
_local1.sliderMC.OnMove = function () {
this._parent.OnSliderMove();
};
_local1.barMC.OnDown = function () {
this._parent.sliderMC.StartDrag();
};
_local1.barMC.OnUp = function () {
this._parent.sliderMC.StopDrag();
};
_local1.UpdateSliderPosition();
};
SlideBarMC.prototype.GetScaledValue = function () {
return(this.value);
};
SlideBarMC.prototype.GetValue = function () {
var _local1 = this;
var _local2 = _local1.minValue + ((_local1.maxValue - _local1.minValue) * _local1.value);
if (_local1.intervalSize > 0) {
_local2 = Math.round(_local2 / _local1.intervalSize) * _local1.intervalSize;
}
return(_local2);
};
SlideBarMC.prototype.GetSliderMinX = function () {
return(this.sliderMinX);
};
SlideBarMC.prototype.GetSliderMaxX = function () {
return(this.sliderMaxX);
};
SlideBarMC.prototype.GetMinValue = function () {
return(this.minValue);
};
SlideBarMC.prototype.GetMaxValue = function () {
return(this.maxValue);
};
SlideBarMC.prototype.GetIntervalSize = function () {
return(this.intervalSize);
};
SlideBarMC.prototype.SetValue = function (value) {
var _local1 = this;
var _local2 = value;
if (_local1.intervalSize > 0) {
_local2 = Math.round(_local2 / _local1.intervalSize) * _local1.intervalSize;
}
_local1.value = (_local2 - _local1.minValue) / (_local1.maxValue - _local1.minValue);
_local1.UpdateSliderPosition();
};
SlideBarMC.prototype.SetScaledValue = function (scaledValue) {
var _local1 = this;
var _local2 = _local1.minValue + (scaledValue * (_local1.maxValue - _local1.minValue));
_local1.SetValue(_local2);
};
SlideBarMC.prototype.SetSliderMinX = function (x) {
var _local1 = this;
_local1.sliderMinX = x;
_local1.sliderMC.SetMinX(x);
_local1.UpdateSliderPosition();
};
SlideBarMC.prototype.SetSliderMaxX = function (x) {
var _local1 = this;
_local1.sliderMaxX = x;
_local1.sliderMC.SetMaxX(x);
_local1.UpdateSliderPosition();
};
SlideBarMC.prototype.SetMinValue = function (value) {
this.minValue = value;
};
SlideBarMC.prototype.SetMaxValue = function (value) {
this.maxValue = value;
};
SlideBarMC.prototype.SetIntervalSize = function (intervalSize) {
this.intervalSize = intervalSize;
};
SlideBarMC.prototype.UpdateSliderPosition = function () {
var _local1 = this;
_local1.sliderMC.SetX(_local1.sliderMinX + (_local1.value * (_local1.sliderMaxX - _local1.sliderMinX)));
};
SlideBarMC.prototype.OnSliderMove = function () {
var _local1 = this;
var _local2 = _local1.sliderMaxX - _local1.sliderMinX;
if (_local2 <= 0) {
} else {
var _local3 = _local1.value;
_local1.SetScaledValue((_local1.sliderMC.GetX() - _local1.sliderMinX) / _local2);
_local1.UpdateSliderPosition();
if (_local3 != _local1.value) {
_local1.OnChangeValue(_local1.GetValue());
}
}
};
_global.WindowMC = function () {
var _local1 = this;
super();
_local1.label = "";
_local1.message = "";
_local1.enabled = true;
};
WindowMC.prototype = new MovieClip();
WindowMC.prototype.Close = function () {
this.OnClose();
this.removeMovieClip();
};
WindowMC.prototype.GetLabel = function () {
return(this.label);
};
WindowMC.prototype.GetMessage = function () {
return(this.message);
};
WindowMC.prototype.GetEnabled = function () {
return(this.enabled);
};
WindowMC.prototype.SetLabel = function (label) {
this.label = label;
};
WindowMC.prototype.SetMessage = function (message) {
this.message = message;
};
WindowMC.prototype.Focus = function () {
var _local1 = this;
_local1.enabled = true;
_local1.EnableElements();
_local1.OnFocus();
};
WindowMC.prototype.Blur = function () {
var _local1 = this;
_local1.enabled = false;
_local1.DisableElements();
_local1.OnBlur();
};
WindowMC.prototype.Center = function (x, y) {
var _local2 = this;
var _local1 = _local2.getBounds(_local2._parent);
_local2._x = _local2._x + (x - ((_local1.xMin + _local1.xMax) / 2));
_local2._y = _local2._y + (y - ((_local1.yMin + _local1.yMax) / 2));
};
_global.StartPointWindowMC = function () {
super();
};
StartPointWindowMC.prototype = new WindowMC();
StartPointWindowMC.prototype.OnMouseClick = function () {
if (this.enabled) {
this.Close();
}
};
StartPointWindowMC.prototype.Blur = function () {
super.Blur();
this._visible = false;
};
StartPointWindowMC.prototype.Focus = function () {
super.Focus();
this._visible = true;
};
_global.UnpauseWindowMC = function () {
super();
};
UnpauseWindowMC.prototype = new WindowMC();
UnpauseWindowMC.prototype.OnMouseClick = function () {
if (this.enabled) {
this.Close();
}
};
UnpauseWindowMC.prototype.Blur = function () {
super.Blur();
this._visible = false;
};
UnpauseWindowMC.prototype.Focus = function () {
super.Focus();
this._visible = true;
};
_global.GamePausedWindowMC = function () {
super();
};
GamePausedWindowMC.prototype = new WindowMC();
GamePausedWindowMC.prototype.Blur = function () {
var _local1 = this;
_local1.optionsButtonMC.Disable();
_local1.quitGameButtonMC.Disable();
_local1.restartGameButtonMC.Disable();
_local1.resumeGameButtonMC.Disable();
};
GamePausedWindowMC.prototype.Focus = function () {
var _local1 = this;
_local1.optionsButtonMC.Enable();
_local1.quitGameButtonMC.Enable();
_local1.restartGameButtonMC.Enable();
_local1.resumeGameButtonMC.Enable();
};
_global.SubmitWindowMC = function () {
super();
this.values = new Object();
this.valueProperties = new Object();
};
SubmitWindowMC.prototype = new WindowMC();
SubmitWindowMC.prototype.onLoad = function () {
this.UpdateElements();
super.onLoad();
};
SubmitWindowMC.prototype.GetValues = function () {
return(this.values);
};
SubmitWindowMC.prototype.GetValueProperties = function (valueName) {
return(this.valueProperties[valueName]);
};
SubmitWindowMC.prototype.GetElement = function (elementName) {
return(null);
};
SubmitWindowMC.prototype.SetValue = function (valueName, value) {
this.values[valueName] = value;
var _local1 = this.GetElement(valueName);
if (_local1) {
_local1.SetValue(value);
}
};
SubmitWindowMC.prototype.SetValueProperties = function (valueName, minValue, maxValue, intervalSize) {
var _local2 = minValue;
var _local3 = intervalSize;
this.valueProperties[valueName] = {minValue:_local2, maxValue:maxValue, intervalSize:_local3};
var _local1 = this.GetElement(valueName);
if (_local1) {
_local1.SetMinValue(_local2);
_local1.SetMaxValue(maxValue);
_local1.SetIntervalSize(_local3);
}
};
SubmitWindowMC.prototype.UpdateElements = function () {
var _local2 = this;
for (var _local3 in _local2.values) {
var _local1 = _local2.GetElement(_local3);
if (_local1) {
_local1.SetMinValue(_local2.valueProperties[_local3].minValue);
_local1.SetMaxValue(_local2.valueProperties[_local3].maxValue);
_local1.SetIntervalSize(_local2.valueProperties[_local3].intervalSize);
_local1.SetValue(_local2.values[_local3]);
}
}
};
SubmitWindowMC.prototype.Submit = function () {
var _local1 = this;
_local1.OnSubmit(_local1.values);
_local1.Close();
};
SubmitWindowMC.prototype.Cancel = function () {
this.OnCancel();
this.Close();
};
_global.EndGameWindowMC = function () {
super();
};
EndGameWindowMC.prototype = new SubmitWindowMC();
_global.OptionsWindowMC = function () {
super();
};
OptionsWindowMC.prototype = new SubmitWindowMC();
OptionsWindowMC.prototype.onLoad = function () {
var _local1 = this;
_local1.puckTrailSliderMC.OnChangeValue = function (newValue) {
this._parent.SetValue("puckTrailLength", newValue);
this._parent.UpdatePuckTrailDiagramLength();
};
_local1.volumeSliderMC.OnChangeValue = function (newValue) {
this._parent.SetValue("volume", newValue);
};
super.onLoad();
};
OptionsWindowMC.prototype.GetElement = function (valueName) {
switch (valueName) {
case "puckTrailLength" :
return(this.puckTrailSliderMC);
case "volume" :
return(this.volumeSliderMC);
}
return(null);
};
OptionsWindowMC.prototype.UpdatePuckTrailDiagramLength = function () {
this.puckTrailDiagramMC.trailMC._xscale = 100 * this.puckTrailSliderMC.GetScaledValue();
};
OptionsWindowMC.prototype.UpdateElements = function () {
super.UpdateElements();
this.UpdatePuckTrailDiagramLength();
};
_global.RestartGameWindowMC = function () {
super();
};
RestartGameWindowMC.prototype = new SubmitWindowMC();
_global.QuitGameWindowMC = function () {
super();
};
QuitGameWindowMC.prototype = new SubmitWindowMC();
_global.AnimationWindowMC = function () {
super();
};
AnimationWindowMC.prototype = new WindowMC();
AnimationWindowMC.prototype.Blur = function () {
super.Blur();
this._visible = false;
this.stop();
};
AnimationWindowMC.prototype.Focus = function () {
super.Focus();
this._visible = true;
this.play();
};
_global.CountdownWindowMC = function () {
super();
};
CountdownWindowMC.prototype = new AnimationWindowMC();
_global.HumanGoalWindowMC = function () {
super();
};
HumanGoalWindowMC.prototype = new AnimationWindowMC();
_global.ComputerGoalWindowMC = function () {
super();
};
ComputerGoalWindowMC.prototype = new AnimationWindowMC();
_global.HumanWinsWindowMC = function () {
super();
};
HumanWinsWindowMC.prototype = new AnimationWindowMC();
_global.ComputerWinsWindowMC = function () {
super();
};
ComputerWinsWindowMC.prototype = new AnimationWindowMC();
_global.WindowContainerMC = function () {
super();
this.windows = new Array();
};
WindowContainerMC.prototype = new ContainerMC();
WindowContainerMC.prototype.AddWindow = function (symbol, x, y) {
var _local2 = this;
var _local1 = _local2.AddMC(symbol, 0, 0);
_local1.Center(x, y);
var _local3 = _local2.GetTopWindow();
if (_local3) {
_local3.Blur();
}
_local2.windows.push(_local1);
_local1.Focus();
_local1.onUnload = function () {
this._parent.OnWindowClose(this);
};
return(_local1);
};
WindowContainerMC.prototype.Empty = function () {
super.Empty();
this.windows = new Array();
};
WindowContainerMC.prototype.CloseTopWindow = function () {
var _local2 = this.windows.pop();
_local2.Close();
var _local1 = this.GetTopWindow();
if (_local1) {
_local1.Focus();
}
};
WindowContainerMC.prototype.OnWindowClose = function (mc) {
var _local2 = this;
var _local3 = _local2.windows.length - 1;
var _local1 = _local3;
while (_local1 >= 0) {
if (_local2.windows[_local1] == mc) {
_local2.windows.splice(_local1, 1);
if (_local1 == _local3) {
_local2.windows[_local1 - 1].Focus();
}
return;
}
_local1--;
}
};
WindowContainerMC.prototype.GetTopWindow = function () {
return(this.windows[this.windows.length - 1]);
};
_global.PuckTrailDiagramMC = function () {
super();
};
PuckTrailDiagramMC.prototype = new MovieClip();
PuckTrailDiagramMC.prototype.SetTrailLength = function (len) {
this.trailMC._xscale = len;
};
_global.Timer = function () {
this.elapsedTime = 0;
this.startTime = -1;
};
Timer.prototype.Start = function () {
this.startTime = getTimer();
this.elapsedTime = 0;
};
Timer.prototype.Pause = function () {
var _local1 = this;
if (_local1.startTime >= 0) {
_local1.elapsedTime = _local1.elapsedTime + (getTimer() - _local1.startTime);
}
_local1.startTime = -1;
};
Timer.prototype.Unpause = function () {
this.startTime = getTimer();
};
Timer.prototype.Stop = function () {
this.startTime = -1;
this.elapsedTime = 0;
};
Timer.prototype.GetElapsedTime = function () {
var _local1 = this;
if (_local1.startTime >= 0) {
return((_local1.elapsedTime + getTimer()) - _local1.startTime);
}
return(_local1.elapsedTime);
};
_global.KeyLog = function () {
var _local1 = this;
Key.addListener(_local1);
_local1.keyPressesAscii = new Array();
_local1.keyPressesVirtual = new Array();
_local1.maxKeyPresses = 100;
_local1.enabled = true;
};
KeyLog.prototype.GetMaxKeyPresses = function () {
return(this.maxKeyPresses);
};
KeyLog.prototype.GetEnabled = function () {
return(this.enabled);
};
KeyLog.prototype.GetAsciiKeyPresses = function () {
return(this.keyPressesAscii);
};
KeyLog.prototype.GetVirtualKeyPresses = function () {
return(this.keyPressesVirtual);
};
KeyLog.prototype.GetLastAsciiKeyPress = function () {
return(this.keyPressesAscii[0]);
};
KeyLog.prototype.GetLastVirtualKeyPress = function () {
return(this.keyPressesVirtual[0]);
};
KeyLog.prototype.SetMaxKeyPresses = function (max) {
var _local1 = this;
var _local2 = max;
_local1.maxKeyPresses = _local2;
_local1.keyPressesAscii.splice(_local2);
_local1.keyPressesVirtual.splice(_local2);
};
KeyLog.prototype.ClearKeyPresses = function () {
this.keyPressesAscii = new Array();
this.keyPressesVirtual = new Array();
};
KeyLog.prototype.onKeyUp = function () {
var _local1 = this;
if (!_local1.enabled) {
} else {
_local1.keyPressesAscii.unshift(Key.getAscii());
if (_local1.keyPressesAscii.length > _local1.maxKeyPresses) {
_local1.keyPressesAscii.splice(_local1.maxKeyPresses);
}
_local1.keyPressesVirtual.unshift(Key.getCode());
if (_local1.keyPressesVirtual.length > _local1.maxKeyPresses) {
_local1.keyPressesVirtual.splice(_local1.maxKeyPresses);
}
_local1.OnKeyPress();
}
};
KeyLog.prototype.Disable = function () {
var _local1 = this;
if (_local1.enabled) {
_local1.enabled = false;
Key.removeListener(_local1);
}
};
KeyLog.prototype.Enable = function () {
var _local1 = this;
if (!_local1.enabled) {
_local1.enabled = true;
Key.addListener(_local1);
}
};
_global.Game = function () {
var _local1 = this;
_local1.points = new Array();
_local1.points[PLAYER_NONE] = (_local1.points[PLAYER_HUMAN] = (_local1.points[PLAYER_COMPUTER] = 0));
_local1.maxPoints = 5;
_local1.lastPointWinner = PLAYER_NONE;
_local1.state = _local1.STATE_INACTIVE;
_local1.pointTimer = new Timer();
};
Game.prototype.STATE_INACTIVE = 0;
Game.prototype.STATE_PAUSED = 1;
Game.prototype.STATE_ACTIVE = 2;
Game.prototype.getPlayerPoints = function (id) {
return(this.points[id]);
};
Game.prototype.getMaxPoints = function () {
return(this.maxPoints);
};
Game.prototype.getLastPointWinner = function () {
return(this.lastPointWinner);
};
Game.prototype.getState = function () {
return(this.state);
};
Game.prototype.getWinner = function () {
var _local2 = this;
var _local1 = 1;
while (_local1 < _local2.points.length) {
if (_local2.points[_local1] >= _local2.maxPoints) {
return(_local1);
}
_local1++;
}
return(PLAYER_NONE);
};
Game.prototype.getPointTime = function () {
return(this.pointTimer.GetElapsedTime());
};
Game.prototype.setPlayerPoints = function (id) {
this.points[id] = points;
};
Game.prototype.setMaxPoints = function (points) {
this.maxPoints = points;
};
Game.prototype.setLastPointWinner = function (winner) {
this.lastPointWinner = winner;
};
Game.prototype.setState = function (state) {
this.state = state;
};
Game.prototype.addPlayerPoint = function (id) {
this.points[id]++;
this.lastPointWinner = id;
};
Game.prototype.startPoint = function () {
this.pointTimer.Start();
};
Game.prototype.endPoint = function () {
this.pointTimer.Pause();
};
Game.prototype.pause = function () {
var _local1 = this;
if (_local1.state == _local1.STATE_ACTIVE) {
_local1.state = _local1.STATE_PAUSED;
_local1.pointTimer.Pause();
}
};
Game.prototype.unpause = function () {
var _local1 = this;
if (_local1.state == _local1.STATE_PAUSED) {
_local1.state = _local1.STATE_ACTIVE;
_local1.pointTimer.Unpause();
}
};
_global.StatsLog = function () {
this.stats = new Object();
};
StatsLog.prototype.GetStat = function (levelID, statName) {
if (typeof(this.stats[levelID]) == "object") {
var _local1 = this.stats[levelID][statName];
if (!(_local1 === undefined)) {
return(_local1);
}
}
return(0);
};
StatsLog.prototype.GetStatTotal = function (statName) {
var _local2 = this;
var _local3 = 0;
for (var k in _local2.stats) {
if (typeof(_local2.stats[k]) == "object") {
var _local1 = _local2.stats[k][statName];
if (!(_local1 === undefined)) {
_local3 = _local3 + _local1;
}
}
}
return(_local3);
};
StatsLog.prototype.GetStatMin = function (statName) {
var _local3 = this;
var _local2 = null;
for (var k in _local3.stats) {
if (typeof(_local3.stats[k]) == "object") {
var _local1 = _local3.stats[k][statName];
if (!(_local1 === undefined)) {
if (_local2 === null) {
_local2 = _local1;
} else {
_local2 = Math.min(_local1, _local2);
}
}
}
}
return(_local2);
};
StatsLog.prototype.GetStatMax = function (statName) {
var _local2 = this;
var _local3 = 0;
for (var k in _local2.stats) {
if (typeof(_local2.stats[k]) == "object") {
var _local1 = _local2.stats[k][statName];
if (!(_local1 === undefined)) {
_local3 = Math.max(_local1, _local3);
}
}
}
return(_local3);
};
StatsLog.prototype.SetStat = function (levelID, statName, statValue) {
var _local1 = levelID;
var _local2 = this;
if (typeof(_local2.stats[_local1]) != "object") {
_local2.stats[_local1] = new Object();
}
_local2.stats[_local1][statName] = statValue;
};
StatsLog.prototype.IncrementStat = function (levelID, statName) {
this.SetStat(levelID, statName, this.GetStat(levelID, statName) + 1);
};
StatsLog.prototype.UpdateStatMax = function (levelID, statName, value) {
var _local2 = levelID;
var _local3 = this;
if (typeof(_local3.stats[_local2]) == "object") {
var _local1 = _local3.stats[_local2][statName];
if ((!(_local1 === undefined)) && (value <= _local1)) {
return;
}
} else {
_local3.SetStat(_local2, statName, value);
}
};
StatsLog.prototype.UpdateStatMin = function (levelID, statName, value) {
var _local2 = levelID;
var _local3 = this;
if (typeof(_local3.stats[_local2]) == "object") {
var _local1 = _local3.stats[_local2][statName];
if ((!(_local1 === undefined)) && (value >= _local1)) {
return;
}
} else {
_local3.SetStat(_local2, statName, value);
}
};
StatsLog.prototype.ClearStats = function () {
this.stats = new Object();
};
_global.WINDOW_X = 200;
_global.WINDOW_Y = 200;
_global.SCENE_WINDOW_X = 280;
_global.SCENE_WINDOW_Y = 200;
_global.PUCK_FRICTION = 0.01;
_global.MAX_PUCK_TRAIL_POSITIONS = 10;
_global.MIN_PUCK_TRAIL_POSITIONS = 0;
_global.MIN_VOLUME = 0;
_global.MAX_VOLUME = 100;
_global.PLAYER_NONE = 0;
_global.PLAYER_HUMAN = 1;
_global.PLAYER_COMPUTER = 2;
_global.SKILL_LEVEL_EASY = 0;
_global.SKILL_LEVEL_MEDIUM = 1;
_global.SKILL_LEVEL_HARD = 2;
_global.SKILL_LEVEL_IMPOSSIBLE = 3;
_global.SKILL_LEVEL_DATA = new Array();
SKILL_LEVEL_DATA[SKILL_LEVEL_EASY] = {name:"easy", puckMaxVelocity:8, computerMalletMaxVelocity:2.5};
SKILL_LEVEL_DATA[SKILL_LEVEL_MEDIUM] = {name:"medium", puckMaxVelocity:12, computerMalletMaxVelocity:3.8};
SKILL_LEVEL_DATA[SKILL_LEVEL_HARD] = {name:"hard", puckMaxVelocity:14, computerMalletMaxVelocity:5.3};
SKILL_LEVEL_DATA[SKILL_LEVEL_IMPOSSIBLE] = {name:"impossible", puckMaxVelocity:16, computerMalletMaxVelocity:7.4};
_global.THEME_STANDARD = 0;
_global.THEME_TRON = 1;
_global.THEME_MINIMAL = 2;
_global.THEME_SOCCER = 3;
_global.THEME_JELLY = 4;
_global.TRAIL_TYPE_VOLUME = 0;
_global.TRAIL_TYPE_LINE = 1;
_global.THEME_DATA = new Array();
THEME_DATA[THEME_STANDARD] = {frame:"standard", puckTrailType:TRAIL_TYPE_VOLUME, puckTrailMaxWidth:16};
THEME_DATA[THEME_TRON] = {frame:"tron", puckTrailType:TRAIL_TYPE_VOLUME, puckTrailMaxWidth:16};
THEME_DATA[THEME_MINIMAL] = {frame:"minimal", puckTrailType:TRAIL_TYPE_VOLUME, puckTrailMaxWidth:6};
THEME_DATA[THEME_SOCCER] = {frame:"soccer", puckTrailType:TRAIL_TYPE_VOLUME, puckTrailMaxWidth:16};
THEME_DATA[THEME_JELLY] = {frame:"jelly", puckTrailType:TRAIL_TYPE_VOLUME, puckTrailMaxWidth:16};
_global.gGame = null;
_global.gSceneMC = null;
_global.gPreferences = {maxPoints:4, theme:THEME_STANDARD, skillLevel:SKILL_LEVEL_MEDIUM, puckTrailLength:5, volume:80, multiball:false};
_global.gStats = new StatsLog();
_global.gKeyLog = new KeyLog();
_global.gMouseClickFocusMC = _root;
_global.gSound = new Sound();
gSound.setVolume(gPreferences.volume);
_root.onMouseUp = function () {
gMouseClickFocusMC.OnMouseClick();
};
_root.OnMouseClick = function () {
if (gGame && (gGame.GetState() == gGame.STATE_ACTIVE)) {
PauseGame();
}
};
gKeyLog.OnKeyPress = function () {
if (this.GetLastVirtualKeyPress() == 13) {
var _local2 = this.GetAsciiKeyPresses();
var _local3 = "";
var keyCodes = this.GetVirtualKeyPresses().slice(1);
keyCodes.reverse();
var _local1 = _local2.length - 1;
while (_local1 > 0) {
_local3 = _local3 + String.fromCharCode(_local2[_local1]);
_local1--;
}
this.ClearKeyPresses();
if (_local3.length > 0) {
ExecuteCommandString(_local3, keyCodes);
}
}
};
_global.InitGame = function () {
_global.gGame = new Game();
gGame.setMaxPoints(gPreferences.maxPoints);
_root.scoreboardMC.maxPoints = gPreferences.maxPoints;
InitPoint();
};
_global.InitPoint = function () {
var _local1 = this;
var _local3 = (gPreferences.multiball ? "MultiballSceneMC" : "SceneMC");
_global.gSceneMC = _root.sceneContainerMC.AddMC(_local3, 0, 0);
gSceneMC.customOnLoad = function () {
var _local1 = this;
_local1.init(gGame.getLastPointWinner());
_local1.setTheme(THEME_DATA[gPreferences.theme].frame);
_local1.setComputerMalletMaxVelocity(SKILL_LEVEL_DATA[gPreferences.skillLevel].computerMalletMaxVelocity);
_local1.setPuckMaxVelocity(SKILL_LEVEL_DATA[gPreferences.skillLevel].puckMaxVelocity);
_local1.setPuckFriction(PUCK_FRICTION);
_local1.setPuckTrailMaxWidth(THEME_DATA[gPreferences.theme].puckTrailMaxWidth);
_local1.setPuckTrailMaxPositions(gPreferences.puckTrailLength);
_local1.setPuckTrailType(THEME_DATA[gPreferences.theme].puckTrailType);
};
gSceneMC.onWin = function (winner) {
OnWinPoint(winner);
};
gSceneMC.onPoint = function (winner) {
OnPoint(winner);
};
var _local2 = ShowWindow("StartPointWindowMC", SCENE_WINDOW_X, SCENE_WINDOW_Y);
_local2.OnClose = function () {
StartCountdown();
};
_global.gMouseClickFocusMC = _local2;
_root.scoreboardMC.computerPoints = gGame.getPlayerPoints(PLAYER_COMPUTER);
_root.scoreboardMC.humanPoints = gGame.getPlayerPoints(PLAYER_HUMAN);
Mouse.hide();
gGame.setState(gGame.STATE_ACTIVE);
};
_global.StartCountdown = function () {
_global.gMouseClickFocusMC = _root;
var _local1 = ShowWindow("CountdownWindowMC", SCENE_WINDOW_X, SCENE_WINDOW_Y);
_local1.OnClose = function () {
StartPoint();
};
};
_global.StartPoint = function () {
gSceneMC.startPoint();
gGame.startPoint();
};
_global.PauseGame = function () {
if (gGame && (gGame.getState() == gGame.STATE_ACTIVE)) {
Mouse.show();
gSceneMC.setActive(false);
gGame.pause();
var _local1 = ShowWindow("UnpauseWindowMC", SCENE_WINDOW_X, SCENE_WINDOW_Y);
_global.gMouseClickFocusMC = _local1;
_local1.OnClose = function () {
UnpauseGame();
};
ShowWindow("GamePausedWindowMC", WINDOW_X, WINDOW_Y);
}
};
_global.UnpauseGame = function () {
if (gGame && (gGame.getState() == gGame.STATE_PAUSED)) {
Mouse.hide();
gSceneMC.setActive(true);
gGame.unpause();
_global.gMouseClickFocusMC = _root;
}
};
_global.ShowWindow = function (symbol, x, y) {
return(_root.windowsMC.AddWindow(symbol, x, y));
};
_global.ShowOptionsWindow = function () {
var _local1 = ShowWindow("OptionsWindowMC", WINDOW_X, WINDOW_Y);
_local1.SetValueProperties("puckTrailLength", MIN_PUCK_TRAIL_POSITIONS, MAX_PUCK_TRAIL_POSITIONS, 1);
_local1.SetValue("puckTrailLength", gPreferences.puckTrailLength);
_local1.SetValueProperties("volume", MIN_VOLUME, MAX_VOLUME, 1);
_local1.SetValue("volume", gPreferences.volume);
_local1.OnSubmit = function (values) {
SetPuckTrailLength(values.puckTrailLength);
SetVolume(values.volume);
};
};
_global.SetPuckTrailLength = function (len) {
gPreferences.puckTrailLength = len;
if (gSceneMC) {
gSceneMC.setPuckTrailMaxPositions(Math.round(len));
}
};
_global.ShowRestartGameWindow = function () {
var _local1 = ShowWindow("RestartGameWindowMC", WINDOW_X, WINDOW_Y);
_local1.OnSubmit = function (options) {
DeinitGame();
InitGame();
};
};
_global.ShowQuitGameWindow = function () {
var _local1 = ShowWindow("QuitGameWindowMC", WINDOW_X, WINDOW_Y);
_local1.OnSubmit = function (options) {
DeinitGame();
_root.gotoAndStop("main");
};
};
_global.DeinitPoint = function () {
Mouse.show();
_root.sceneContainerMC.Empty();
_global.gSceneMC = null;
};
_global.DeinitGame = function () {
DeinitPoint();
_root.windowsMC.Empty();
_global.gGame = null;
};
_global.OnWinPoint = function (winner) {
gGame.addPlayerPoint(winner);
gGame.endPoint();
var _local2 = gGame.getPointTime();
gStats.UpdateStatMin(gPreferences.skillLevel, "shortestPoint", _local2);
gStats.UpdateStatMax(gPreferences.skillLevel, "longestPoint", _local2);
if (winner == PLAYER_HUMAN) {
gStats.IncrementStat(gPreferences.skillLevel, "points");
}
var _local3 = gGame.getWinner();
var _local1;
if (_local3 == PLAYER_HUMAN) {
gStats.IncrementStat(gPreferences.skillLevel, "wins");
_local1 = ShowWindow("HumanWinsWindowMC", SCENE_WINDOW_X, SCENE_WINDOW_Y);
_local1.OnClose = function () {
EndGame();
};
} else if (_local3 == PLAYER_COMPUTER) {
_local1 = ShowWindow("ComputerWinsWindowMC", SCENE_WINDOW_X, SCENE_WINDOW_Y);
_local1.OnClose = function () {
EndGame();
};
} else {
if (winner == PLAYER_HUMAN) {
_local1 = ShowWindow("HumanGoalWindowMC", SCENE_WINDOW_X, SCENE_WINDOW_Y);
} else {
_local1 = ShowWindow("ComputerGoalWindowMC", SCENE_WINDOW_X, SCENE_WINDOW_Y);
}
_local1.OnClose = function () {
EndPoint();
};
}
};
_global.EndPoint = function () {
DeinitPoint();
InitPoint();
};
_global.EndGame = function () {
Mouse.show();
gSceneMC.setActive(false);
gGame.SetState(gGame.STATE_INACTIVE);
var _local1 = ShowWindow("EndGameWindowMC", WINDOW_X, WINDOW_Y);
_local1.OnSubmit = function () {
DeinitGame();
InitGame();
};
_local1.OnCancel = function () {
DeInitGame();
_root.gotoAndStop("main");
};
};
_global.ShowStats = function (mc) {
var _local1 = mc;
var ySpacing = 30;
var y = 0;
var _local3 = null;
var statRows = {Easy:SKILL_LEVEL_EASY, Medium:SKILL_LEVEL_MEDIUM, Hard:SKILL_LEVEL_HARD, Impossible:SKILL_LEVEL_IMPOSSIBLE, Total:null};
for (var k in statRows) {
var _local2 = statRows[k];
_local1 = _root.statsContainerMC.AddMC("StatsRow", 0, y);
_local3 = ((_local3 == "even") ? "odd" : "even");
_local1.gotoAndStop(_local3);
_local1.skillLevel = k;
if (!(_local2 === null)) {
_local1.wins = gStats.GetStat(_local2, "wins");
_local1.points = gStats.GetStat(_local2, "points");
_local1.shortestPoint = Math.round(gStats.GetStat(_local2, "shortestPoint") / 1000);
_local1.longestPoint = Math.round(gStats.GetStat(_local2, "longestPoint") / 1000);
} else {
_local1.wins = gStats.GetStatTotal("wins");
_local1.points = gStats.GetStatTotal("points");
_local1.shortestPoint = Math.round(gStats.GetStatMin("shortestPoint") / 1000);
_local1.longestPoint = Math.round(gStats.GetStatMax("longestPoint") / 1000);
}
y = y + ySpacing;
}
};
_global.InitOptions = function () {
var _local1 = _root;
var _local3 = new RadioButtonGroup();
_local3.AddButton(_local1.easyButtonMC, SKILL_LEVEL_EASY);
_local3.AddButton(_local1.mediumButtonMC, SKILL_LEVEL_MEDIUM);
_local3.AddButton(_local1.hardButtonMC, SKILL_LEVEL_HARD);
if (gStats.GetStat(SKILL_LEVEL_HARD, "points") > 0) {
_local3.AddButton(_local1.impossibleButtonMC, SKILL_LEVEL_IMPOSSIBLE);
} else {
_local1.impossibleButtonMC._visible = false;
}
_local3.SetValue(gPreferences.skillLevel);
_local3.OnChangeValue = function (value) {
if (value != null) {
gPreferences.skillLevel = value;
}
};
var _local2 = new RadioButtonGroup();
_local2.AddButton(_local1.points2ButtonMC, 2);
_local2.AddButton(_local1.points3ButtonMC, 3);
_local2.AddButton(_local1.points4ButtonMC, 4);
_local2.AddButton(_local1.points5ButtonMC, 5);
_local2.AddButton(_local1.points6ButtonMC, 6);
_local2.AddButton(_local1.points7ButtonMC, 7);
_local2.SetValue(gPreferences.maxPoints);
_local2.OnChangeValue = function (value) {
if (value != null) {
gPreferences.maxPoints = value;
}
};
var themeButtonGroup = new RadioButtonGroup();
themeButtonGroup.AddButton(_local1.standardThemeButtonMC, THEME_STANDARD);
themeButtonGroup.AddButton(_local1.minimalThemeButtonMC, THEME_MINIMAL);
themeButtonGroup.AddButton(_local1.soccerThemeButtonMC, THEME_SOCCER);
if ((gStats.GetStat(SKILL_LEVEL_IMPOSSIBLE, "points") > 0) || (gStats.GetStat(SKILL_LEVEL_HARD, "wins"))) {
themeButtonGroup.AddButton(_local1.tronThemeButtonMC, THEME_TRON);
} else {
_local1.tronThemeButtonMC._visible = false;
}
themeButtonGroup.SetValue(gPreferences.theme);
themeButtonGroup.OnChangeValue = function (value) {
if (value != null) {
gPreferences.theme = value;
}
};
_local1.puckTrailSliderMC.SetMinValue(MIN_PUCK_TRAIL_POSITIONS);
_local1.puckTrailSliderMC.SetMaxValue(MAX_PUCK_TRAIL_POSITIONS);
_local1.puckTrailSliderMC.SetIntervalSize(1);
_local1.puckTrailSliderMC.SetValue(gPreferences.puckTrailLength);
_local1.puckTrailSliderMC.OnChangeValue = function (newVal) {
gPreferences.puckTrailLength = newVal;
_root.puckTrailDiagramMC.SetTrailLength(100 * this.GetScaledValue());
};
_local1.puckTrailDiagramMC.SetTrailLength(100 * _local1.puckTrailSliderMC.GetScaledValue());
_local1.volumeSliderMC.SetMinValue(MIN_VOLUME);
_local1.volumeSliderMC.SetMaxValue(MAX_VOLUME);
_local1.volumeSliderMC.SetIntervalSize(1);
_local1.volumeSliderMC.SetValue(gPreferences.volume);
_local1.volumeSliderMC.OnChangeValue = function (newVal) {
SetVolume(newVal);
};
};
_global.ExecuteCommandString = function (str, keyCodes) {
var _local3 = str.split(" ");
var command = _local3[0].toLowerCase();
switch (command) {
case "theme" :
SetThemeByName(_local3[1]);
break;
case "puckmaxv" :
SetPuckMaxVelocity(_local3[1]);
break;
case "compmaxv" :
SetComputerMalletMaxVelocity(_local3[1]);
break;
case "skill" :
SetSkillLevelByName(_local3[1]);
break;
case "volume" :
SetVolume(_local3[1]);
break;
case "trailtype" :
SetPuckTrailType(_local3[1]);
break;
case "traillength" :
SetPuckTrailLength(_local3[1]);
break;
case "trailwidth" :
SetPuckTrailWidth(_local3[1]);
break;
case "embiggen" :
SetObjectScale(_local3[1]);
break;
case "hidepuck" :
SetPuckVisible(false);
break;
case "showpuck" :
SetPuckVisible(true);
break;
case "quit" :
QuitGame();
break;
case "scale" :
SetScale(_local3[1]);
break;
case "downontheupside" :
FlipScene();
break;
case "uuddlrlrba" :
SetMaxPoints(9);
break;
case "multiball" :
ToggleMultiball();
break;
case "icecreamsocial" :
SetGoalScale(_local3[1]);
}
var _local2 = new Array(38, 38, 40, 40, 37, 39, 37, 39, 66, 65);
if (keyCodes.length == _local2.length) {
var codeMatch = true;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] != keyCodes[_local1]) {
codeMatch = false;
break;
}
_local1++;
}
if (codeMatch) {
SetMaxPoints(99);
}
}
};
_global.SetThemeByName = function (themeName) {
var _local1 = themeName;
_local1 = _local1.toLowerCase();
for (var _local2 in THEME_DATA) {
if (THEME_DATA[_local2].frame == _local1) {
gPreferences.theme = _local2;
if (gSceneMC instanceof SceneMC) {
gSceneMC.setTheme(_local1);
}
break;
}
}
};
_global.SetPuckMaxVelocity = function (maxV) {
var _local1 = maxV;
if (gSceneMC instanceof SceneMC) {
if (_local1 == undefined) {
_local1 = -1;
}
gSceneMC.setPuckMaxVelocity(Math.round(_local1));
}
};
_global.SetComputerMalletMaxVelocity = function (maxV) {
var _local1 = maxV;
if (gSceneMC instanceof SceneMC) {
if (_local1 == undefined) {
_local1 = -1;
}
gSceneMC.setComputerMalletMaxVelocity(Math.round(_local1));
}
};
_global.SetSkillLevelByName = function (skillLevel) {
var _local1 = skillLevel;
_local1 = _local1.toLowerCase();
for (var _local2 in SKILL_LEVEL_DATA) {
if (SKILL_LEVEL_DATA[_local2].name == _local1) {
gPreferences.skillLevel = _local2;
break;
}
}
};
_global.SetVolume = function (vol) {
gPreferences.volume = Math.min(MAX_VOLUME, Math.max(MIN_VOLUME, vol));
gSound.setVolume(gPreferences.volume);
};
_global.SetPuckTrailType = function (trailType) {
var _local1 = trailType;
if (!gSceneMC) {
} else {
_local1 = _local1.toLowerCase();
switch (_local1) {
case "volume" :
gSceneMC.setPuckTrailType(TRAIL_TYPE_VOLUME);
return;
case "line" :
gSceneMC.setPuckTrailType(TRAIL_TYPE_LINE);
}
}
};
_global.SetPuckTrailWidth = function (w) {
if (gSceneMC) {
gSceneMC.setPuckTrailMaxWidth(Math.round(w));
}
};
_global.SetObjectScale = function (scale) {
var _local1 = scale;
if (gSceneMC) {
if (_local1 == undefined) {
_local1 = 2;
}
_local1 = Math.min(4, Math.max(0, _local1));
gSceneMC.setObjectScale(_local1);
}
};
_global.SetPuckVisible = function (visible) {
if (gSceneMC) {
gSceneMC.puckMC._visible = visible;
}
};
_global.QuitGame = function () {
if (gGame && (gGame.getState() != gGame.STATE_INACTIVE)) {
DeinitGame();
_root.gotoAndStop("main");
}
};
_global.SetScale = function (scale) {
var _local1 = scale;
if (gSceneMC) {
if ((_local1 <= 0) || (_local1 == undefined)) {
_local1 = 0.5;
}
gSceneMC._xscale = _local1 * 100;
gSceneMC._yscale = _local1 * 100;
}
};
_global.SetMaxPoints = function (points) {
if (gGame && (gGame.getState() != gGame.STATE_INACTIVE)) {
gGame.setMaxPoints(points);
}
if (_root.scoreboardMC) {
_root.scoreboardMC.maxPoints = points;
}
};
_global.FlipScene = function () {
if (gSceneMC) {
var _local1 = gSceneMC.getBounds(_root);
var _local2 = _local1.yMin;
gSceneMC._yscale = gSceneMC._yscale * -1;
_local1 = gSceneMC.getBounds(_root);
gSceneMC._y = gSceneMC._y + (_local2 - _local1.yMin);
}
};
_global.ToggleMultiball = function () {
gPreferences.multiball = !gPreferences.multiball;
};
_global.SetGoalScale = function (scale) {
var _local1 = scale;
if (gSceneMC) {
if (_local1 == undefined) {
_local1 = 2;
}
_local1 = Math.max(0, Math.min(3, _local1));
gSceneMC.setGoalScale(_local1);
}
};
Object.registerClass("ContainerMC", ContainerMC);
Object.registerClass("WindowContainerMC", WindowContainerMC);
Object.registerClass("SceneMC", SceneMC);
Object.registerClass("MultiballSceneMC", MultiballSceneMC);
Object.registerClass("ComputerMalletMC", ComputerMalletMC);
Object.registerClass("HumanMalletMC", HumanMalletMC);
Object.registerClass("PuckMC", PuckMC);
Object.registerClass("TrailMC", TrailMC);
Object.registerClass("BlockerMC", BlockerMC);
Object.registerClass("WallMC", WallMC);
Object.registerClass("WallLeftMC", WallLeftMC);
Object.registerClass("WallTopLeftMC", WallTopLeftMC);
Object.registerClass("WallTopRightMC", WallTopRightMC);
Object.registerClass("WallHiddenMC", WallHiddenMC);
Object.registerClass("WallCornerMC", WallCornerMC);
Object.registerClass("GoalMC", GoalMC);
Object.registerClass("TableMC", TableMC);
Object.registerClass("ButtonMC", ButtonMC);
Object.registerClass("SmallButtonMC", SmallButtonMC);
Object.registerClass("MediumButtonMC", MediumButtonMC);
Object.registerClass("WebLinkButtonMC", WebLinkButtonMC);
Object.registerClass("RadioButtonMC", RadioButtonMC);
Object.registerClass("SmallRadioButtonMC", SmallRadioButtonMC);
Object.registerClass("IconRadioButtonMC", IconRadioButtonMC);
Object.registerClass("SlideBarMC", SlideBarMC);
Object.registerClass("SlideBarSliderMC", SlideBarSliderMC);
Object.registerClass("SlideBarBarMC", SlideBarBarMC);
Object.registerClass("UnpauseWindowMC", UnpauseWindowMC);
Object.registerClass("GamePausedWindowMC", GamePausedWindowMC);
Object.registerClass("StartPointWindowMC", StartPointWindowMC);
Object.registerClass("EndGameWindowMC", EndGameWindowMC);
Object.registerClass("OptionsWindowMC", OptionsWindowMC);
Object.registerClass("RestartGameWindowMC", RestartGameWindowMC);
Object.registerClass("QuitGameWindowMC", QuitGameWindowMC);
Object.registerClass("CountdownWindowMC", CountdownWindowMC);
Object.registerClass("HumanGoalWindowMC", HumanGoalWindowMC);
Object.registerClass("ComputerGoalWindowMC", ComputerGoalWindowMC);
Object.registerClass("HumanWinsWindowMC", HumanWinsWindowMC);
Object.registerClass("ComputerWinsWindowMC", ComputerWinsWindowMC);
Object.registerClass("PuckTrailDiagramMC", PuckTrailDiagramMC);
Frame 9
stop();
Instance of Symbol 165 MovieClip [ButtonMC] in Frame 9
onClipEvent (load) {
this.label = "New Game";
this.onClick = function () {
_root.gotoAndPlay("play");
};
}
Instance of Symbol 165 MovieClip [ButtonMC] in Frame 9
onClipEvent (load) {
this.label = "Options";
this.onClick = function () {
_root.gotoAndStop("options");
};
}
Instance of Symbol 154 MovieClip [WebLinkButtonMC] in Frame 9
onClipEvent (load) {
this.OnClick = function () {
getURL ("http://www.chewonglass.com");
};
}
Instance of Symbol 165 MovieClip [ButtonMC] in Frame 9
onClipEvent (load) {
this.label = "Stats";
this.onClick = function () {
_root.gotoAndStop("stats");
};
}
Frame 14
ShowStats(_root.statsContainerMC);
Instance of Symbol 165 MovieClip [ButtonMC] in Frame 14
onClipEvent (load) {
this.SetLabel("Main Menu");
this.OnClick = function () {
_root.gotoAndStop("main");
};
}
Frame 20
InitOptions();
Instance of Symbol 150 MovieClip [SmallRadioButtonMC] "points2ButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("2");
}
Instance of Symbol 150 MovieClip [SmallRadioButtonMC] "points3ButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("3");
}
Instance of Symbol 150 MovieClip [SmallRadioButtonMC] "points4ButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("4");
}
Instance of Symbol 150 MovieClip [SmallRadioButtonMC] "points5ButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("5");
}
Instance of Symbol 150 MovieClip [SmallRadioButtonMC] "points6ButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("6");
}
Instance of Symbol 150 MovieClip [SmallRadioButtonMC] "points7ButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("7");
}
Instance of Symbol 146 MovieClip [RadioButtonMC] "easyButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("easy");
}
Instance of Symbol 146 MovieClip [RadioButtonMC] "mediumButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("medium");
}
Instance of Symbol 146 MovieClip [RadioButtonMC] "hardButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("hard");
}
Instance of Symbol 146 MovieClip [RadioButtonMC] "impossibleButtonMC" in Frame 20
onClipEvent (load) {
this.SetLabel("impossible");
}
Instance of Symbol 142 MovieClip [IconRadioButtonMC] "standardThemeButtonMC" in Frame 20
onClipEvent (load) {
this.SetSymbol("StandardThemeIcon");
this.SetLabel("Standard");
}
Instance of Symbol 142 MovieClip [IconRadioButtonMC] "tronThemeButtonMC" in Frame 20
onClipEvent (load) {
this.SetSymbol("TronThemeIcon");
this.SetLabel("Tron");
}
Instance of Symbol 142 MovieClip [IconRadioButtonMC] "minimalThemeButtonMC" in Frame 20
onClipEvent (load) {
this.SetSymbol("MinimalThemeIcon");
this.SetLabel("Minimal");
}
Instance of Symbol 142 MovieClip [IconRadioButtonMC] "soccerThemeButtonMC" in Frame 20
onClipEvent (load) {
this.SetSymbol("SoccerThemeIcon");
this.SetLabel("Soccer");
}
Instance of Symbol 165 MovieClip [ButtonMC] in Frame 20
onClipEvent (load) {
this.SetLabel("Main Menu");
this.OnClick = function () {
_root.gotoAndStop("main");
};
}
Frame 27
stop();
InitGame();
Symbol 10 MovieClip [HumanGoalWindowMC] Frame 67
this.Close();
Symbol 21 MovieClip [HumanWinsWindowMC] Frame 112
this.Close();
Symbol 26 MovieClip [ComputerWinsWindowMC] Frame 115
this.Close();
Symbol 28 MovieClip [ComputerGoalWindowMC] Frame 74
this.Close();
Symbol 34 MovieClip [CountdownWindowMC] Frame 45
this.Close();
Symbol 70 MovieClip [PuckMC] Frame 11
gotoAndStop ("tron");
Symbol 70 MovieClip [PuckMC] Frame 25
gotoAndStop ("jelly");
Symbol 75 MovieClip [HumanMalletMC] Frame 11
gotoAndStop ("tron");
Symbol 75 MovieClip [HumanMalletMC] Frame 25
gotoAndStop ("jelly");
Symbol 77 MovieClip [ComputerMalletMC] Frame 11
gotoAndStop ("tron");
Symbol 77 MovieClip [ComputerMalletMC] Frame 25
gotoAndStop ("jelly");
Instance of Symbol 44 MovieClip [TableMC] "tableMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingBox(0, 150, 0, 300);
this.setBoundingArea(area);
}
Instance of Symbol 49 MovieClip [WallTopLeftMC] "wall1MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, 1);
this.setBoundingArea(area);
}
Instance of Symbol 49 MovieClip [WallTopLeftMC] "wall4MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, -1);
this.setBoundingArea(area);
}
Instance of Symbol 53 MovieClip [WallTopRightMC] "wall2MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, -1);
this.setBoundingArea(area);
}
Instance of Symbol 53 MovieClip [WallTopRightMC] "wall5MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, -1);
this.setBoundingArea(area);
}
Instance of Symbol 57 MovieClip [WallLeftMC] "wall6MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -150, 0, 150, 1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 57 MovieClip [WallLeftMC] "wall3MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -150, 0, 150, -1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall7MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, 1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall8MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, 1);
this.setBoundingArea(area);
this.setSticky(true);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall9MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, -1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall10MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, 1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall11MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, 1);
this.setBoundingArea(area);
this.setSticky(true);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall12MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, -1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner1MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner2MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner3MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner4MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 63 MovieClip [BlockerMC] "centerPuckBlockerMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 25);
this.setBoundingArea(area);
this.addTargetMC(this._parent.playerMalletMC);
this.addTargetMC(this._parent.computerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "rightPuckBlockerMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 25);
this.setBoundingArea(area);
this.addTargetMC(this._parent.playerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "leftPuckBlockerMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 25);
this.setBoundingArea(area);
this.addTargetMC(this._parent.computerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "computerGoalBlockerMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 15);
this.setBoundingArea(area);
this.addTargetMC(this._parent.computerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "playerGoalBlockerMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 15);
this.setBoundingArea(area);
this.addTargetMC(this._parent.playerMalletMC);
}
Instance of Symbol 70 MovieClip [PuckMC] "puck2MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 8);
this.setBoundingArea(area);
this.setMass(1);
}
Instance of Symbol 75 MovieClip [HumanMalletMC] "playerMalletMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
this.setBounds(0, 150, 150, 300);
var area = new BoundingCircle(0, 0, 10);
this.setBoundingArea(area);
}
Instance of Symbol 77 MovieClip [ComputerMalletMC] "computerMalletMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
this.setBounds(0, 150, 0, 150);
var area = new BoundingCircle(0, 0, 10);
this.setBoundingArea(area);
this.setTargetMC(this._parent.puckMC);
}
Instance of Symbol 70 MovieClip [PuckMC] "puck1MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 8);
this.setBoundingArea(area);
this.setMass(1);
}
Instance of Symbol 70 MovieClip [PuckMC] "puck3MC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 8);
this.setBoundingArea(area);
this.setMass(1);
}
Instance of Symbol 82 MovieClip [GoalMC] "playerGoalMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingBox(-25, 25, 0, 20);
this.setBoundingArea(area);
this.setPlayerID(PLAYER_COMPUTER);
}
Instance of Symbol 82 MovieClip [GoalMC] "computerGoalMC" in Symbol 83 MovieClip [MultiballSceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingBox(-25, 25, -20, 0);
this.setBoundingArea(area);
this.setPlayerID(PLAYER_HUMAN);
}
Instance of Symbol 44 MovieClip [TableMC] "tableMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingBox(0, 150, 0, 300);
this.setBoundingArea(area);
}
Instance of Symbol 49 MovieClip [WallTopLeftMC] "wall1MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, 1);
this.setBoundingArea(area);
}
Instance of Symbol 49 MovieClip [WallTopLeftMC] "wall4MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, -1);
this.setBoundingArea(area);
}
Instance of Symbol 53 MovieClip [WallTopRightMC] "wall2MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, -1);
this.setBoundingArea(area);
}
Instance of Symbol 53 MovieClip [WallTopRightMC] "wall5MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, -1);
this.setBoundingArea(area);
}
Instance of Symbol 57 MovieClip [WallLeftMC] "wall6MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -150, 0, 150, 1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 57 MovieClip [WallLeftMC] "wall3MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -150, 0, 150, -1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall7MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, 1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall8MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, 1);
this.setBoundingArea(area);
this.setSticky(true);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall9MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, -1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall10MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, 1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall11MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(-25, 0, 25, 0, 0, 1);
this.setBoundingArea(area);
this.setSticky(true);
}
Instance of Symbol 58 MovieClip [WallHiddenMC] "wall12MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingLine(0, -10, 0, 10, -1, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner1MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner2MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner3MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 59 MovieClip [WallCornerMC] "corner4MC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 0);
this.setBoundingArea(area);
}
Instance of Symbol 63 MovieClip [BlockerMC] "centerPuckBlockerMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 25);
this.setBoundingArea(area);
this.addTargetMC(this._parent.playerMalletMC);
this.addTargetMC(this._parent.computerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "playerPuckBlockerMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 25);
this.setBoundingArea(area);
this.addTargetMC(this._parent.playerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "computerPuckBlockerMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 25);
this.setBoundingArea(area);
this.addTargetMC(this._parent.computerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "computerGoalBlockerMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 15);
this.setBoundingArea(area);
this.addTargetMC(this._parent.computerMalletMC);
}
Instance of Symbol 63 MovieClip [BlockerMC] "playerGoalBlockerMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 15);
this.setBoundingArea(area);
this.addTargetMC(this._parent.playerMalletMC);
}
Instance of Symbol 70 MovieClip [PuckMC] "puckMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingCircle(0, 0, 8);
this.setBoundingArea(area);
this.setMass(1);
}
Instance of Symbol 75 MovieClip [HumanMalletMC] "playerMalletMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
this.setBounds(0, 150, 150, 300);
var area = new BoundingCircle(0, 0, 10);
this.setBoundingArea(area);
this.setCollideSound("MalletHitPuck");
}
Instance of Symbol 77 MovieClip [ComputerMalletMC] "computerMalletMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
this.setBounds(0, 150, 0, 150);
var area = new BoundingCircle(0, 0, 10);
this.setBoundingArea(area);
this.setTargetMC(this._parent.puckMC);
this.setCollideSound("MalletHitPuck");
}
Instance of Symbol 82 MovieClip [GoalMC] "playerGoalMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingBox(-25, 25, 2, 20);
this.setBoundingArea(area);
this.setPlayerID(PLAYER_COMPUTER);
this.setScoreSound("GoalScore");
}
Instance of Symbol 82 MovieClip [GoalMC] "computerGoalMC" in Symbol 84 MovieClip [SceneMC] Frame 1
onClipEvent (load) {
var area = new BoundingBox(-25, 25, -20, -2);
this.setBoundingArea(area);
this.setPlayerID(PLAYER_HUMAN);
this.setScoreSound("GoalScore");
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "okButtonMC" in Symbol 104 MovieClip [EndGameWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Yes");
this.OnClick = function () {
this._parent.Submit();
};
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "cancelButtonMC" in Symbol 104 MovieClip [EndGameWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("No");
this.OnClick = function () {
this._parent.Cancel();
};
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "okButtonMC" in Symbol 107 MovieClip [QuitGameWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Yes");
this.OnClick = function () {
this._parent.Submit();
};
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "cancelButtonMC" in Symbol 107 MovieClip [QuitGameWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("No");
this.OnClick = function () {
this._parent.Cancel();
};
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "okButtonMC" in Symbol 110 MovieClip [RestartGameWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Yes");
this.OnClick = function () {
this._parent.Submit();
};
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "cancelButtonMC" in Symbol 110 MovieClip [RestartGameWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("No");
this.OnClick = function () {
this._parent.Cancel();
};
}
Instance of Symbol 121 MovieClip [SlideBarMC] "volumeSliderMC" in Symbol 126 MovieClip [OptionsWindowMC] Frame 1
onClipEvent (load) {
this.OnChangeValue = function (newValue) {
};
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "okButtonMC" in Symbol 126 MovieClip [OptionsWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Ok");
this.OnClick = function () {
this._parent.Submit();
};
}
Instance of Symbol 103 MovieClip [SmallButtonMC] "cancelButtonMC" in Symbol 126 MovieClip [OptionsWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Cancel");
this.OnClick = function () {
this._parent.Cancel();
};
}
Instance of Symbol 130 MovieClip [MediumButtonMC] "optionsButtonMC" in Symbol 132 MovieClip [GamePausedWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Options");
this.OnClick = function () {
ShowOptionsWindow();
};
}
Instance of Symbol 130 MovieClip [MediumButtonMC] "restartGameButtonMC" in Symbol 132 MovieClip [GamePausedWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Restart Game");
this.OnClick = function () {
ShowRestartGameWindow();
};
}
Instance of Symbol 130 MovieClip [MediumButtonMC] "quitGameButtonMC" in Symbol 132 MovieClip [GamePausedWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Quit Game");
this.OnClick = function () {
ShowQuitGameWindow();
};
}
Instance of Symbol 130 MovieClip [MediumButtonMC] "resumeGameButtonMC" in Symbol 132 MovieClip [GamePausedWindowMC] Frame 1
onClipEvent (load) {
this.SetLabel("Resume Game");
this.OnClick = function () {
this._parent.Close();
};
}