[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 9 (4.17 KiB) ●
function CN_Game_Object() {
this.timedScreenArray = new Array();
this.depth_i = 0;
this.offScreenOffset = 700;
this.curScreen = null;
}
function CN_Timer(screen, parent, endTime) {
this.screen = screen;
this.mc = screen.mc.timer;
this.parent = parent;
this.mc.caller = this;
this.endTime = endTime * 1000;
this.active = false;
}
function CN_PreloadTicker(text) {
this._mc = _root.preloadTickerMC;
this._mc.textBlockMC.createTextField("textField1", 1, 0, 0, 200, 15);
this._mc.textBlockMC.textField1.text = text;
}
CN_Game_Object.prototype.Continue = function () {
if (this.curScreen != null) {
this.RemoveScreen(this.curScreen);
}
if (this.timedScreenArray.length == 0) {
gotoAndStop (215);
} else {
this.curScreen = this.timedScreenArray.shift();
this.ShowScreen(this.curScreen);
gotoAndStop (214);
}
};
CN_Game_Object.prototype.ExternalGraphicsAreLoaded = function () {
var allLoaded = true;
var i = 0;
while (i < this.timedScreenArray.length) {
if (!this.timedScreenArray[i].isLoaded) {
allLoaded = false;
break;
}
i++;
}
return(allLoaded);
};
CN_Game_Object.prototype.GetExternalParameters = function () {
if (_root.sw1 != null) {
this.timedScreenArray[0] = new Object();
this.timedScreenArray[0].path = _root.sw1;
this.timedScreenArray[0].duration = _root.sw2;
this.timedScreenArray[0].link = _root.sw4;
}
if (_root.sw5 == 1) {
var array_i = this.timedScreenArray.length;
this.timedScreenArray[array_i] = new Object();
if (_root.sw5 != 1) {
this.timedScreenArray[array_i].path = _root.sw5;
} else {
this.timedScreenArray[array_i].path = "orbitPowered/orbitPowered.swf";
}
if (_root.sw6 != null) {
this.timedScreenArray[array_i].duration = _root.sw6;
} else {
this.timedScreenArray[array_i].duration = "3";
}
if (_root.sw7 != null) {
this.timedScreenArray[array_i].link = _root.sw7;
} else {
this.timedScreenArray[array_i].link = null;
}
}
var array_i = this.timedScreenArray.length;
var next_i = 8;
while (_root["sw" + next_i] != null) {
this.timedScreenArray[array_i] = new Object();
this.timedScreenArray[array_i].path = _root["sw" + next_i];
if (_root.sw6 != null) {
this.timedScreenArray[array_i].duration = _root["sw" + (++next_i)];
} else {
this.timedScreenArray[array_i].duration = "5";
}
if (_root.sw7 != null) {
this.timedScreenArray[array_i].link = _root["sw" + (++next_i)];
} else {
this.timedScreenArray[array_i].link = null;
}
array_i++;
next_i++;
}
};
CN_Game_Object.prototype.LaunchOrbitPopup = function () {
if (_root.sw5 == 1) {
getURL ("javascript:popupOrbitCode( )");
}
};
CN_Game_Object.prototype.LoadExternalGraphic = function (screen, depth) {
_root.attachMovie("externalFileHolder", "holder" + depth, depth);
screen.mc = _root["holder" + depth];
screen.mc.caller = screen;
screen.mc.slot.loadMovie(screen.path);
};
CN_Game_Object.prototype.MainMovieIsLoaded = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
return(true);
}
return(false);
};
CN_Game_Object.prototype.PreloadExternalGraphics = function () {
var i = 0;
while (i < this.timedScreenArray.length) {
this.LoadExternalGraphic(this.timedScreenArray[i], i + 1);
this.timedScreenArray[i].mc._x = this.offScreenOffset;
i++;
}
};
CN_Game_Object.prototype.RemoveScreen = function (screen) {
screen.mc.slot.unloadMovie();
screen.mc.removeMovieClip();
delete screen;
};
CN_Game_Object.prototype.ShowScreen = function (screen) {
screen.mc._x = 0;
screen.mc._y = 0;
screen.timer = new CN_Timer(screen, this, screen.duration);
screen.timer.Start();
};
CN_Game_Object.prototype.toString = function () {
return("CN_Game_Object");
};
CN_Timer.prototype.Start = function () {
this.active = true;
this.startTime = getTimer();
};
CN_Timer.prototype.Tick = function () {
if ((getTimer() - this.startTime) >= this.endTime) {
_root.EndTimerAdapter(this.parent);
this.active = false;
}
};
CN_Timer.prototype.toString = function () {
return("CN_Timer");
};
EndTimerAdapter = function (parent) {
parent.Continue();
};
myGameObject = new CN_Game_Object();
Frame 10 (8 B)
play();
Frame 11 (160 B)
if (myGameObject.MainMovieIsLoaded()) {
myGameObject.GetExternalParameters();
myGameObject.PreloadExternalGraphics();
play();
} else {
prevFrame();
}
Frame 212 (8 B)
play();
Frame 213 (109 B)
if (myGameObject.ExternalGraphicsAreLoaded()) {
_root.myGameObject.Continue();
} else {
prevFrame();
}
Frame 215 (8 B)
stop();
Instance of Symbol 119 MovieClip in Frame 215 (380 B)
onClipEvent (load) {
this.doAction = function () {
_root.play();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Frame 216 (8 B)
stop();
Instance of Symbol 145 MovieClip in Frame 216 (380 B)
onClipEvent (load) {
this.doAction = function () {
_root.play();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Frame 218 (8 B)
stop();
Instance of Symbol 287 MovieClip in Frame 218 (47 B)
onClipEvent (load) {
this.swapDepths(15001);
}
Instance of Symbol 316 MovieClip "soundMC" in Frame 218 (47 B)
onClipEvent (load) {
this.swapDepths(11000);
}
Instance of Symbol 323 MovieClip "overlayMC" in Frame 218 (47 B)
onClipEvent (load) {
this.swapDepths(15000);
}
Frame 219 (104.43 KiB) ● ● ● ●
function LinkedList() {
this.listHead = null;
}
function Angle() {
if (arguments.length == 1) {
var radians = arguments[0];
this.cosine = Math.cos(radians);
this.sine = Math.sin(radians);
} else if (arguments.length == 2) {
var x = arguments[0];
var y = arguments[1];
var r = Math.sqrt((x * x) + (y * y));
if (r == 0) {
if ((x == 0) && (y == 0)) {
}
}
this.cosine = x / r;
this.sine = y / r;
}
}
function Vect() {
switch (arguments.length) {
case 1 :
var iAngle = arguments[0];
var iLength = 1;
if (iAngle == null) {
}
this._theta = iAngle;
this._r = iLength;
this._mode = -1;
return;
case 2 :
if (arguments[0] instanceof Angle) {
var iAngle = arguments[0];
var iLength = arguments[1];
if (iAngle == null) {
}
if (iLength == 0) {
this._theta = _root.Angle.ZERO;
this._r = 0;
} else if (iLength > 0) {
this._theta = iAngle;
this._r = iLength;
} else {
this._theta = iAngle.plus(_root.Angle.RAD_PI);
this._r = -iLength;
}
this._mode = -1;
} else {
var x = arguments[0];
var y = arguments[1];
this._x = x;
this._y = y;
this._mode = 1;
}
return;
case 4 :
var x = arguments[0];
var y = arguments[1];
var r = arguments[2];
var theta = arguments[3];
if (r < 0) {
r = -r;
}
this._x = x;
this._y = y;
this._r = r;
this._theta = theta;
this._mode = 0;
}
}
function Point2D() {
}
function Point() {
switch (arguments.length) {
case 0 :
this.x = 0;
this.y = 0;
return;
case 1 :
this.x = arguments[0].x;
this.y = arguments[0].y;
return;
case 2 :
this.x = arguments[0];
this.y = arguments[1];
}
}
function Circle() {
if (arguments.length == 2) {
var center = arguments[0];
var r = arguments[1];
if ((r < 0) || (center == null)) {
}
} else if (arguments.length == 3) {
var x = arguments[0];
var y = arguments[1];
var r = arguments[2];
var center = new Vect(x, y);
}
this._centerPoint = center;
this._radius = r;
this.setBounds();
}
function compareTo(a, b) {
if (a > b) {
return(1);
}
if (a < b) {
return(-1);
}
return(0);
}
function binarySearch(aArray, value) {
var low = 0;
var high = (aArray.length - 1);
while (low <= high) {
var mid = Math.floor((low + high) / 2);
var c = compareTo(value, aArray[mid]);
if (c < 0) {
high = mid - 1;
} else if (c > 0) {
low = mid + 1;
} else {
return(mid);
}
}
return(-1);
}
function binarySearchForClosest(aArray, value) {
var low = 0;
var high = (aArray.length - 1);
while (low <= high) {
var mid = Math.floor((low + high) / 2);
var c = compareTo(value, aArray[mid]);
if (c < 0) {
high = mid - 1;
} else if (c > 0) {
low = mid + 1;
} else {
return(mid);
}
}
if ((aArray[high] != null) && (Math.abs(aArray[high] - value) < Math.abs(aArray[low] - value))) {
return(high);
}
if (aArray[low] != null) {
return(low);
}
return(mid);
}
function GameObject(x, y, parent, objectNum) {
this._x = x;
this._y = y;
this._parent = parent;
this._objectNum = objectNum;
this.ID = ++GameObject.count;
GameObject.objectHash[this.ID] = this;
}
function Engine(sActionFunction) {
this._actionObjects = new Array();
this._actionFunction = sActionFunction;
}
function FrameBasedEngine(sActionFunction) {
super(sActionFunction);
}
function MouseController() {
this._listeners = new Object();
this._listeners.onMouseDown = new Object();
this._listeners.onMouseUp = new Object();
this._listeners.onMouseMove = new Object();
}
function Command(oReceiver, sFunctionName, aArgList) {
this._receiver = oReceiver;
this._functionName = sFunctionName;
if (aArgList != null) {
this._argList = aArgList;
}
}
function CommandObject(receiver, functionName, argList, bRequiresWatch) {
this.receiver = receiver;
this.functionName = functionName;
this.argList = argList;
if (bRequiresWatch == null) {
this.requiresWatch = false;
} else {
this.requiresWatch = bRequiresWatch;
}
}
function Iterator(_list) {
this._list = _list;
this._current = 0;
}
function InstructionChain() {
this.id = ++InstructionChain.count;
this.list = new Array();
this.iterator = new Iterator(this.list);
}
function ArrowPointer(x, y, parent) {
super(x, y, parent, ++ArrowPointer.numCreated);
this._mc = this.createMC2("arrow", "arrowPointer mc", _root.arrowDepth);
this._mc._x = x;
this._mc._y = y;
this._direction = null;
this._targetDirections = new Array(0, 90, 180, 270, 360);
this._frameOffset = 10;
}
function FencepostTop(x, y, parent) {
super(x, y, parent, ++FencepostTop.numCreated);
this._depth = this._parent._parent._gameBoard.addToZSortList(this);
this._mc = this.createMC3("fencepostTop", "fencepostTop mc", this._depth);
this._z = _root.fenceHeight + 3;
this._mc._x = x;
this._mc._y = y - this._z;
this._radius = 3;
}
function Fencepost(x, y, parent, bActive) {
super(x, y, parent, ++Fencepost.numCreated);
this._depth = this._parent._gameBoard.addToZSortList(this);
this._mc = this.createMC3("fencepost", "fencepost mc", this._depth);
this._top = new FencepostTop(x, y + 1, this);
this._arrowPointer = new ArrowPointer(x, y, this);
this._mc._x = x;
this._mc._y = y;
this._arrowPointer._x = x;
this._arrowPointer._y = y;
this._radius = 4;
this._vel = new Vect(0, 0);
this._type = "fencepost";
this._connectedFences = new Object();
this.updateBoundingBox();
myMouseController.addListener(this, "onMouseDown");
if (bActive) {
this.mouseDownAction();
mySoundModule.playSound("postUp");
}
}
function Fence(x, y, direction, parent, state, x1, y1) {
super(x, y, parent, ++Fence.numCreated);
this._direction = direction;
this._counterDirection = (this._direction + 180) % 360;
this._horizontal = (((this._direction == 90) || (this._direction == 270)) ? true : false);
if (this._horizontal) {
this._depth = this._parent._gameBoard.addToZSortList(this);
this._mc = this.createMC3("fence", "fence mc", this._depth);
} else if (state == "expanding") {
this._armNeedingPosts = [];
this._mc = this.createMC3("fence", "fence mc", _root.electricFenceDepth + this._objectNum);
} else {
this._mc = this.createMC3("fence", "fence mc", _root.verticalFenceDepth + this._objectNum);
}
this._nodes = new LinkedList();
myMouseController.addListener(this, "onMouseDown");
this._x1 = x;
this._y1 = y;
this._z = _root.fenceHeight;
this._mc._x = x;
this._mc._y = y - _root.fenceHeight;
this._mc._rotation = this._direction;
this._solidSegmentsCreated = 0;
this._solidSegmentHeight = 10;
if ((this._direction == 180) || (this._direction == 270)) {
this._solidLinkageID = "solidSegmentMC2";
} else {
this._solidLinkageID = "solidSegmentMC";
}
this._electricLinkageID = "electricSegmentMC";
this._state = state;
if (this._state == "expanding") {
var dRad = ((this._direction + 270) * (Math.PI/180));
this._vel = new Vect(15 * Math.cos(dRad), 15 * Math.sin(dRad));
this._type = "electricFence";
this._head = this._parent.createNewFenceHead(this._x + this._vel.unitSize().getX(), this._y + this._vel.unitSize().getY(), direction, this);
this._electricSegmentsCreated = 0;
this._electricSegmentHeight = 17;
} else {
this._vel = new Vect(0, 0);
this._type = "solidFence";
this._mc.gotoAndStop("solid");
this.resize(x1, y1);
this.updateBoundingBox();
if (this._horizontal) {
this.createShadow();
}
var i = 1;
while (i <= this._solidSegmentsCreated) {
this._mc[this._solidLinkageID + i].fencePieceMC.gotoAndStop("solid");
i++;
}
}
}
function FenceHead(x, y, direction, parent, fence) {
super(x, y, parent, ++FenceHead.numCreated);
this._direction = direction;
this._fence = fence;
this._mc = this.createMC("fenceHead", "fence head mc");
this._radius = 3;
this._type = "electricFence";
var dRad = ((this._direction + 270) * (Math.PI/180));
this.updateVel(new Vect(15 * Math.cos(dRad), 15 * Math.sin(dRad)));
}
function Animal(x, y, vx, vy, parent, numCreated) {
super(x, y, parent, numCreated);
myMouseController.addListener(this, "onMouseDown");
this._vel = new Vect(vx, vy);
this._vx = vx;
this._vy = vy;
this._depth = this._parent._gameBoard.addToZSortList(this);
}
function Chicken(x, y, vx, vy, speed, parent) {
super(x, y, vx, vy, parent, ++Animal.numCreated);
this._mc = this.createMC3("chicken", "chicken mc", this._depth);
this._radius = 10;
this._type = "chicken";
this._speed = speed;
this._normalVel = this._speed;
this._mc._x = x;
this._mc._y = y;
this._mc.gotoAndStop("hide");
this._isRunning = false;
}
function Rooster(x, y, vx, vy, parent) {
super(x, y, vx, vy, parent, ++Animal.numCreated);
this._mc = this.createMC3("Rooster", "Rooster mc", this._depth);
this._radius = 13;
this._type = "rooster";
this._normalVel = 0;
this._mc._x = x;
this._mc._y = y;
this._peckTime = 2500 + random(1000);
this._runTime = 5500 + random(1000);
if (vx < 0) {
this._mc.gotoAndStop("peckLeft");
} else {
this._mc.gotoAndStop("peckRight");
}
this._oldVel = this._vel;
this._vel = _root._zeroVel;
this._isRunning = false;
}
function TestCircle(x, y, vx, vy, parent) {
super(x, y, vx, vy, parent, ++TestCircle.numCreated);
this._mc = this.createMC2("TestCircle", "TestCircle mc", 5000);
this._radius = 10;
this._type = "TestCircle";
this._normalVel = 7;
this._mc._x = x;
this._mc._y = y;
this._mc.num = this._objectNum;
}
function DeeDee(x, y, parent) {
super(x, y, parent, ++DeeDee.numCreated);
this._mc = this.createMC2("DeeDee", "dee dee", _root.DeeDeeDepth);
this._radius = 6;
this._type = "DeeDee";
this._normalVel = 7;
this._mc._x = x;
this._mc._y = y;
this._mc.gotoAndStop("hide");
}
function Negative500(centerX, centerY, parent) {
super(centerX, centerY, parent, ++BonusPoints.numCreated);
this._mc = this.createMC2("negative500", "negative500", _root.Negative500Depth);
this._mc.parent = this;
this._mc._x = centerX;
this._mc._y = centerY;
this._mc.gotoAndPlay("show");
}
function BonusPoints(centerX, centerY, points, parent) {
super(centerX, centerY, parent, ++BonusPoints.numCreated);
this._mc = this.createMC2("bonusPoints", "bonusPoints", _root.bonusPointsDepth);
this._mc.parent = this;
var digitNum = this.setPoints(this._mc, points);
this._mc._x = centerX + (16 * (4 - digitNum));
this._mc._y = centerY - _root.fenceHeight;
var minX = (this._mc._x - 75);
var maxX = ((this._mc._x + 75) - (32 * (4 - digitNum)));
var boardMinX = this._parent._mainBox._x1;
var boardMaxX = this._parent._mainBox._x2;
if (minX < boardMinX) {
this._mc._x = this._mc._x + (boardMinX - minX);
} else if (maxX > boardMaxX) {
this._mc._x = this._mc._x + (boardMaxX - maxX);
}
this._mc.gotoAndPlay("show");
}
function BonusFloor(x1, y1, x2, y2, parent) {
super(x, y, parent, ++BonusPoints.numCreated);
this._mc = this.createMC2("bonusFloor", "bonusFloor", _root.bonusFloorDepth);
this._mc.parent = this;
this._mc._x = x1;
this._mc._y = y1;
this._mc._width = x2 - x1;
this._mc._height = y2 - y1;
myMouseController.addListener(this, "onMouseDown");
}
function ScoreBoard(mc, parent) {
this._mc = mc;
this._parent = parent;
this._timeLimit = 60;
this._timerFrames = 90;
this.resetScore();
}
function FourWalledWorld(parent, gameBoard, x1, y1, x2, y2) {
this._parent = parent;
this._gameBoard = gameBoard;
this._x1 = x1;
this._y1 = y1;
this._x2 = x2;
this._y2 = y2;
this._staticCircles = new Array();
this._movingCircles = new Array();
this._staticLines = new Array();
this._verticalLines = new LinkedList();
this._horizontalLines = new LinkedList();
this._xBoundsList = new Array();
this._yBoundsList = new Array();
this._boxes = new Array();
this._objectNum = ++FourWalledWorld.numCreated;
}
function compareTo(a, b) {
if (a > b) {
return(1);
}
if (a < b) {
return(-1);
}
return(0);
}
function binarySearchForClosestBounds(aArray, value, prop) {
var low = 0;
var high = (aArray.length - 1);
while (low <= high) {
var mid = Math.floor((low + high) / 2);
var c = compareTo(value, aArray[mid][prop]);
if (c < 0) {
high = mid - 1;
} else if (c > 0) {
low = mid + 1;
} else {
return(mid);
}
}
if ((aArray[high] != null) && (Math.abs(aArray[high][prop] - value) < Math.abs(aArray[low][prop] - value))) {
return(high);
}
if (aArray[low] != null) {
return(low);
}
return(mid);
}
function insertByValue(aArray, obj, propType) {
var closest = binarySearchForClosestBounds(aArray, obj[propType], propType);
if (obj[propType] <= aArray[closest][propType]) {
aArray.splice(closest, 0, obj);
} else {
aArray.splice(closest + 1, 0, obj);
}
}
function getNodesBetweenValues(aArray, prop, minVal, maxVal) {
var i = 0;
while ((minVal > aArray[i][prop]) && (i < aArray.length)) {
start = ++i;
}
while ((maxVal >= aArray[i][prop]) && (i < aArray.length)) {
end = ++i;
}
if (start != end) {
return(aArray.slice(start, end));
}
return(false);
}
function collisionSort(a, b) {
var name1 = a.stepPortion;
var name2 = b.stepPortion;
if (name1 < name2) {
return(-1);
}
if (name1 > name2) {
return(1);
}
return(0);
}
function activeQuadSort(a, b) {
var name1 = a._objectNum;
var name2 = b._objectNum;
if (name1 < name2) {
return(-1);
}
if (name1 > name2) {
return(1);
}
return(0);
}
function ASTraceStack(oObj, bLastMethodOnly) {
var p;
var meth;
var t;
for (p in oObj) {
if (typeof(oObj[p]) != "function") {
continue;
}
meth = oObj[p];
oObj[p] = function () {
t = getTimer() - arguments.callee.__traceMessages.intLastCallTime;
arguments.callee.__traceMessages.intLastCallTime = getTimer();
return(arguments.callee.__originalMethod.apply(this, arguments));
};
oObj[p].__methodName = p;
oObj[p].__originalMethod = meth;
oObj[p].__traceMessages = arguments.callee;
if (bLastMethodOnly) {
return("");
}
}
return("");
}
function GameBoard() {
this._scoreBoard = new ScoreBoard(_root.scoreboardMC, this);
myEngine.addListener(this);
this.initializeLevels();
}
function xGraphic(x, y, parent) {
super(x, y, parent, ++xGraphic.numCreated);
this._mc = this.createMC2("xGraphic", "xGraphic", _root.xGraphicDepth);
this._mc._x = x;
this._mc._y = y;
}
function SoundModule(mc) {
this._mc = mc;
this.launchFence = new Sound(this._mc.launchFenceMC);
this.zapChicken = new Sound(this._mc.zapChickenMC);
this.postUp = new Sound(this._mc.postUpMC);
this.bgLoop = new Sound(this._mc.bgLoopMC);
this.levelLose = new Sound(this._mc.levelLoseMC);
this.levelClear = new Sound(this._mc.levelClearMC);
this.zapRooster = new Sound(this._mc.zapRooster);
this.arrowPoint = new Sound(this._mc.arrowPointMC);
this.chickenLand = new Sound(this._mc.chickenLandMC);
this.bonusSound = new Sound(this._mc.bonusSoundMC);
}
LinkedList.prototype.Push = function (val) {
this.InsertAfter(val, this.listHead.prev);
};
LinkedList.prototype.InsertAfter = function (val, prevItem) {
var item = {val:val};
if (this.listHead == null) {
this.listHead = item;
item.prev = item;
item.next = item;
} else {
item.prev = prevItem;
item.next = prevItem.next;
prevItem.next = item;
item.next.prev = item;
}
return(item);
};
LinkedList.prototype.InsertBefore = function (val, nextItem) {
var item = {};
item.val = val;
if (this.listHead == null) {
this.listHead = item;
item.prev = item;
item.next = item;
} else {
item.prev = nextItem.prev;
item.next = nextItem;
nextItem.prev = item;
item.prev.next = item;
if (nextItem == this.listHead) {
this.listHead = item;
}
}
return(item);
};
LinkedList.prototype.Remove = function (item) {
if (item != null) {
if (item.next == item) {
this.listHead = null;
} else {
item.prev.next = item.next;
item.next.prev = item.prev;
if (item == this.listHead) {
this.listHead = item.next;
}
}
}
};
LinkedList.prototype.RemoveByValue = function (item) {
if (item != null) {
var cur = this.listHead;
do {
if (cur.val == item) {
break;
}
cur = cur.next;
} while (cur != this.listHead);
if (cur.val == item) {
this.Remove(cur);
}
}
};
LinkedList.prototype.GetNodeByValue = function (val) {
if (val != null) {
var cur = this.listHead;
do {
if (cur.val == val) {
break;
}
cur = cur.next;
} while (cur != this.listHead);
if (cur.val == val) {
return(cur);
}
return(false);
}
};
LinkedList.prototype.InsertByValue = function (oObj, nodeProperty) {
var objPropVal = oObj[nodeProperty];
var insertPoint;
var cur = this.listHead;
var curPropVal = cur.val[nodeProperty];
if (objPropVal < curPropVal) {
insertPoint = cur;
return(this.InsertBefore(oObj, insertPoint));
}
do {
insertPoint = cur;
cur = cur.next;
curPropVal = cur.val[nodeProperty];
} while ((cur != this.listHead) && (objPropVal > curPropVal));
return(this.InsertAfter(oObj, insertPoint));
};
LinkedList.prototype.getNodesBetweenValues = function (nodeProperty, minVal, maxVal) {
var objPropVal = minVal;
var insertPoint;
var cur = this.listHead;
var curPropVal = cur.val[nodeProperty];
var startNode;
if (objPropVal <= curPropVal) {
startNode = cur;
} else {
do {
insertPoint = cur;
cur = cur.next;
curPropVal = cur.val[nodeProperty];
} while ((cur != this.listHead) && (objPropVal > curPropVal));
startNode = insertPoint.next;
}
objPropVal = maxVal;
cur = startNode;
curPropVal = cur.val[nodeProperty];
var endNode;
if (objPropVal < curPropVal) {
endNode = cur;
} else {
do {
insertPoint = cur;
cur = cur.next;
curPropVal = cur.val[nodeProperty];
} while ((cur != this.listHead) && (objPropVal >= curPropVal));
endNode = insertPoint.next;
}
var nodeAr = [];
cur = startNode;
while (cur != endNode) {
nodeAr.push(cur.val);
cur = cur.next;
}
return(nodeAr);
};
Angle.prototype.cos = function () {
return(this.cosine);
};
Angle.prototype.sin = function () {
return(this.sine);
};
Angle.prototype.tan = function () {
return(this.sine / this.cosine);
};
Angle.prototype.radians = function () {
var d = Math.atan2(this.sine, this.cosine);
if ((d > Math.PI) || (d < -3.14159265358979)) {
}
return(d);
};
Angle.prototype.flashDegrees = function () {
var r = this.radians();
var d = (r * 57.2957795130823);
d = d + 90;
if (d < 0) {
d = d + 360;
}
return(d);
};
Angle.prototype.plus = function (a) {
var cosine = ((this.cosine * a.cosine) - (this.sine * a.sine));
var sine = ((this.sine * a.cosine) + (this.cosine * a.sine));
return(new Angle(cosine, sine));
};
Angle.prototype.minus = function (a) {
var cosine = ((this.cosine * a.cosine) + (this.sine * a.sine));
var sine = ((this.sine * a.cosine) - (this.cosine * a.sine));
return(new Angle(cosine, sine));
};
Angle.prototype.toString = function () {
return(((("Angle(" + this.cosine) + ",") + this.sine) + ")");
};
Angle.SQRT = Math.SQRT1_2;
Angle.ZERO = new Angle(1, 0);
Angle.DEG_45 = new Angle(Angle.SQRT, Angle.SQRT);
Angle.DEG_90 = new Angle(0, 1);
Angle.DEG_135 = new Angle(-Angle.SQRT, Angle.SQRT);
Angle.DEG_180 = new Angle(-1, 0);
Angle.DEG_225 = new Angle(-Angle.SQRT, -Angle.SQRT);
Angle.DEG_270 = new Angle(0, -1);
Angle.DEG_315 = new Angle(Angle.SQRT, -Angle.SQRT);
Angle.RAD_PI_OVER_FOUR = Angle.DEG_45;
Angle.RAD_PI_OVER_TWO = Angle.DEG_90;
Angle.RAD_PI = Angle.DEG_180;
Vect.prototype.computeXY = function () {
if (this._mode < 0) {
this._x = this._r * this._theta.cos();
this._y = this._r * this._theta.sin();
this._mode = 0;
}
};
Vect.prototype.computeRT = function () {
if (this._mode > 0) {
this._r = Math.sqrt((this._x * this._x) + (this._y * this._y));
if (this._r == 0) {
this._theta = _root.Angle.ZERO;
} else {
this._theta = new Angle(this._x, this._y);
}
this._mode = 0;
}
};
Vect.prototype.angle = function () {
this.computeRT();
return(this._theta);
};
Vect.prototype.length = function () {
this.computeRT();
return(this._r);
};
Vect.prototype.getX = function () {
this.computeXY();
return(this._x);
};
Vect.prototype.getY = function () {
this.computeXY();
return(this._y);
};
Vect.prototype.distanceSquared = function (b) {
this.computeXY();
b.computeXY();
var width = (this._x - b._x);
var height = (this._y - b._y);
return((width * width) + (height * height));
};
Vect.prototype.plus = function (b) {
this.computeXY();
b.computeXY();
return(new Vect(this._x + b._x, this._y + b._y));
};
Vect.prototype.minus = function (b) {
this.computeXY();
b.computeXY();
return(new Vect(this._x - b._x, this._y - b._y));
};
Vect.prototype.rotateBy = function (a) {
this.computeRT();
return(new Vect(this._theta.plus(a), this._r));
};
Vect.prototype.neg = function () {
if (this._mode < 0) {
return(this.rotateBy(_root.Angle.RAD_PI));
}
if (this._mode > 0) {
return(new Vect(-this._x, -this._y));
}
return(new Vect(-this._x, -this._y, this._r, this._theta.plus(_root.Angle.RAD_PI)));
};
Vect.prototype.times = function (amt) {
if (this._mode < 0) {
return(new Vect(this._theta, this._r * amt));
}
if (this._mode > 0) {
return(new Vect(this._x * amt, this._y * amt));
}
return(new Vect(this._x * amt, this._y * amt, this._r * amt, this._theta));
};
Vect.prototype.projectOn = function (b) {
b.computeRT();
return(new Vect(b._theta, this.dot(b)));
};
Vect.prototype.unitSize = function () {
this.computeRT();
return(new Vect(this._theta, 1));
};
Vect.prototype.dot = function (b) {
if ((this._mode < 0) && (b._mode < 0)) {
return(this._r * this._theta.minus(b._theta).cos());
}
this.computeXY();
b.computeXY();
return((this._x * b._x) + (this._y * b._y));
};
Vect.prototype.toString = function () {
return(((("[" + this.getX()) + ",") + this.getY()) + "]");
};
Vect.ZERO = new Vect(0, 0, 0, _root.Angle.ZERO);
Vect.X_HAT = new Vect(1, 0, 1, _root.Angle.ZERO);
Vect.Y_HAT = new Vect(0, 1, 1, _root.Angle.DEG_90);
Point2D.prototype.distance2 = function (x, y) {
return(Math.sqrt(((this.x - x) * (this.x - x)) + ((this.y - y) * (this.y - y))));
};
Point2D.prototype.distance = function (pt) {
return(Math.sqrt(((this.x - pt.x) * (this.x - pt.x)) + ((this.y - pt.y) * (this.y - pt.y))));
};
Point.prototype = new Point2D();
Point.prototype.clone = function () {
return(new Point(this.x, this.y));
};
Point.prototype.getX = function () {
return(this.x);
};
Point.prototype.getY = function () {
return(this.y);
};
Point.prototype.move = function (x, y) {
this.x = x;
this.y = y;
};
Point.prototype.toString = function () {
return(((("Point [" + this.x) + ",") + this.y) + "]");
};
Point.prototype.translate = function (x, y) {
this.x = this.x + x;
this.y = this.y + y;
};
Circle.prototype.getCenter = function () {
return(this._centerPoint);
};
Circle.prototype.getRadius = function () {
return(this._radius);
};
Circle.prototype.setCenter = function (pCenter) {
this._centerPoint = pCenter;
};
Circle.prototype.moveCenter = function (x, y) {
this._centerPoint.move(x, y);
};
Circle.prototype.translateCenter = function (x, y) {
this._centerPoint.translate(x, y);
};
Circle.prototype.toString = function () {
return(((("Circle [center=" + this._centerPoint) + " radius=") + this._radius) + "]");
};
Circle.prototype.getBounds = function () {
return(this.bounds);
};
Circle.prototype.setBounds = function () {
this.bounds = new Rect(this._centerPoint.getX() - this._radius, this._centerPoint.getY() - this._radius, this._centerPoint.getX() + this._radius, this._centerPoint.getY() + this._radius);
};
Geometry = function () {
};
Geometry.chkForLineCollision2 = function (Ax, Ay, Ar, x1, y1, x2, y2, movevec) {
var horizontal = (Math.round(y1) == Math.round(y2));
if (horizontal) {
var perpPoint = new Point(Ax, y1);
var dist = Math.abs(y1 - Ay);
} else {
var perpPoint = new Point(x1, Ay);
var dist = Math.abs(x1 - Ax);
}
if ((dist - Ar) > movevec.length()) {
debug(" -------------------------------------------------------");
debug(" | LineCollsion: exit at test 1");
debug((((" | Subject at [" + Ax) + ",") + Ay) + "]");
debug((((((((" | Target at [" + x1) + ",") + y1) + ",") + x2) + ",") + y2) + "]");
debug(" | perpPoint: " + perpPoint);
debug(" | dist: " + dist);
debug(" | r: " + Ar);
debug(" | vel.length: " + movevec.length());
debug(" -------------------------------------------------------");
return(false);
}
var N = movevec.unitSize();
var C = new Vect(perpPoint.getX() - Ax, perpPoint.getY() - Ay);
var D = N.dot(C);
if (D <= 0) {
debug(" -------------------------------------------------------");
debug(" | LineCollsion: exit at test 2");
debug((((" | Subject at [" + Ax) + ",") + Ay) + "]");
debug((((((((" | Target at [" + x1) + ",") + y1) + ",") + x2) + ",") + y2) + "]");
debug(" | perpPoint: " + perpPoint);
debug(" | dist: " + dist);
debug(" | r: " + Ar);
debug(" | vel.length: " + movevec.length());
debug(" -------------------------------------------------------");
return(false);
}
var lengthC = C.length();
var F = ((lengthC * lengthC) - (D * D));
var sumRadiiSquared = (Ar * Ar);
if (F >= sumRadiiSquared) {
debug(" -------------------------------------------------------");
debug(" | LineCollsion: exit at test 3");
debug((((" | Subject at [" + Ax) + ",") + Ay) + "]");
debug((((((((" | Target at [" + x1) + ",") + y1) + ",") + x2) + ",") + y2) + "]");
debug(" | perpPoint: " + perpPoint);
debug(" | dist: " + dist);
debug(" | r: " + Ar);
debug(" | vel.length: " + movevec.length());
debug(" -------------------------------------------------------");
return(false);
}
var T = (sumRadiiSquared - F);
if (T < 0) {
debug(" -------------------------------------------------------");
debug(" | LineCollsion: exit at test 4");
debug((((" | Subject at [" + Ax) + ",") + Ay) + "]");
debug((((((((" | Target at [" + x1) + ",") + y1) + ",") + x2) + ",") + y2) + "]");
debug(" | perpPoint: " + perpPoint);
debug(" | dist: " + dist);
debug(" | r: " + Ar);
debug(" | vel.length: " + movevec.length());
debug(" -------------------------------------------------------");
return(false);
}
var distance = (D - Math.sqrt(T));
debug(" -------------------------------------------------------");
debug(" | LineCollsion: all the way");
debug((((" | Subject at [" + Ax) + ",") + Ay) + "]");
debug((((((((" | Target at [" + x1) + ",") + y1) + ",") + x2) + ",") + y2) + "]");
debug(" | perpPoint: " + perpPoint);
debug(" | dist: " + dist);
debug(" | r: " + Ar);
debug(" | vel.length: " + movevec.length());
debug(" | distance: " + distance);
debug(" -------------------------------------------------------");
return(distance);
};
Geometry.chkForCircleCollision = function (Ax, Ay, Ar, Bx, By, Br, movevec) {
var dist = Math.sqrt(((Bx - Ax) * (Bx - Ax)) + ((By - Ay) * (By - Ay)));
var sumRadii = (Br + Ar);
dist = dist - sumRadii;
if (movevec.length() < (dist + 0.0001)) {
return(false);
}
var N = movevec.unitSize();
var C = new Vect(Bx - Ax, By - Ay);
var D = N.dot(C);
if (D <= 0) {
return(false);
}
var lengthC = C.length();
var F = ((lengthC * lengthC) - (D * D));
var sumRadiiSquared = (sumRadii * sumRadii);
if (F >= sumRadiiSquared) {
return(false);
}
var T = (sumRadiiSquared - F);
if (T < 0) {
return(false);
}
var distance = (D - Math.sqrt(T));
var mag = movevec.length();
if (mag < distance) {
return(false);
}
return(distance);
};
Geometry.chkForCircleCollision3 = function (Ax, Ay, Ar, Bx, By, Br, velocity) {
var va = velocity.getX();
var vb = velocity.getY();
var distance = (Ar + Br);
var width = (Ax - Bx);
var height = (Ay - By);
var A = ((va * va) + (vb * vb));
var B = (2 * ((va * width) + (vb * height)));
var C = (((width * width) + (height * height)) - (distance * distance));
var ans = Geometry.minQuadraticSolution(A, B, C);
if (isNaN(ans)) {
return(false);
}
if (ans <= 0) {
if (((width * va) + (height * vb)) >= 0) {
return(false);
}
return(0);
}
if (ans <= 1) {
return(velocity.times(ans).length());
}
return(false);
};
Geometry.minQuadraticSolution = function (a, b, c) {
if (a == 0) {
if (b == 0) {
return(Number.NaN);
}
return((-c) / b);
}
var discriminant = ((b * b) - ((4 * a) * c));
if (discriminant < 0) {
return(Number.NaN);
}
var sqrt = Math.sqrt(discriminant);
var twoA = (2 * a);
var lesserNum = ((-b) - sqrt);
var greaterNum = ((-b) + sqrt);
if (a > 0) {
return(lesserNum / twoA);
}
return(greaterNum / twoA);
};
Geometry.reflectCircle = function (subject, target) {
var Ax = subject._x;
var Ay = subject._y;
var v1 = subject._vel;
var Bx = target._x;
var By = target._y;
var v2 = target._vel;
var tempX = (Bx - Ax);
var tempY = (By - Ay);
var r = Math.sqrt((tempX * tempX) + (tempY * tempY));
if (r == 0) {
var theta = _root.Angle.ZERO;
} else {
var theta = new Angle(tempX, tempY);
}
var n = new Vect(theta, 1);
var a1 = v1.dot(n);
var a2 = v2.dot(n);
var optimizedP = (a1 - a2);
var v1prime = v1.minus(n.times(optimizedP));
var v2prime = v2.plus(n.times(optimizedP));
return({subjectVel:v1prime, targetVel:v2prime});
};
Geometry.reflectLine = function (subject, target) {
if (target._horizontal) {
var v1prime = new Vect(subject._vel.getX(), -subject._vel.getY());
} else {
var v1prime = new Vect(-subject._vel.getX(), subject._vel.getY());
}
var v2prime = target._vel;
return({subjectVel:v1prime, targetVel:v2prime});
};
Geometry.checkForMovingCircleCollision = function (subject, target) {
var difVel = subject._vel.minus(target._vel);
var distance = Geometry.chkForCircleCollision(subject._x, subject._y, subject._radius, target._x, target._y, target._radius, difVel);
if (distance != false) {
var result = (distance / difVel.length());
var sVel = subject._vel.times(result);
var tVel = target._vel.times(result);
return({subjectVel:sVel, targetVel:tVel});
}
return(false);
};
Geometry.checkForStaticCircleCollision = function (subject, target) {
var distance = Geometry.chkForCircleCollision(subject._x, subject._y, subject._radius, target._x, target._y, target._radius, subject._vel);
if (distance != false) {
var sVel = subject._vel.unitSize().times(distance);
var tVel = target._vel;
return({subjectVel:sVel, targetVel:tVel});
}
return(false);
};
Geometry.checkForStaticLineCollision = function (subject, target) {
var distance = Geometry.chkForLineCollision(subject, target);
if (distance != false) {
var sVel = subject._vel.unitSize().times(distance);
var tVel = target._vel;
return({subjectVel:sVel, targetVel:tVel});
}
return(false);
};
Geometry.boundsIntersect = function (r1, r2) {
if ((((r1.x2 >= r2.x1) && (r2.x2 >= r1.x1)) && (r1.y2 >= r2.y1)) && (r2.y2 >= r1.y1)) {
return(true);
}
return(false);
};
Geometry.chkForLineCollision = function (subject, target) {
if (Geometry.boundsIntersect(subject.getBoundingBox(), target.getBoundingBox())) {
if (target._horizontal) {
var vy = subject._vel.getY();
if (vy > 0) {
if (target._y > subject._y) {
var vx = subject._vel.getX();
var newVY = ((target._y - subject._radius) - subject._y);
var newVX = (vx * (newVY / vy));
var newX = (subject._x + newVX);
if (((newX <= target._x) && (newX >= target._x1)) || ((newX >= target._x) && (newX <= target._x1))) {
return((newVY / vy) * subject._vel.length());
}
return(false);
}
return(false);
}
if (target._y < subject._y) {
var vx = subject._vel.getX();
var newVY = ((target._y + subject._radius) - subject._y);
var newVX = (vx * (newVY / vy));
var newX = (subject._x + newVX);
if (((newX <= target._x) && (newX >= target._x1)) || ((newX >= target._x) && (newX <= target._x1))) {
return((newVY / vy) * subject._vel.length());
}
return(false);
}
return(false);
}
var vx = subject._vel.getX();
if (vx > 0) {
if (target._x > subject._x) {
var vy = subject._vel.getY();
var newVX = ((target._x - subject._radius) - subject._x);
var newVY = (vy * (newVY / vy));
var newY = (subject._y + newVY);
if (((newY <= target._y) && (newY >= target._y1)) || ((newY >= target._y) && (newY <= target._y1))) {
return((newVX / vx) * subject._vel.length());
}
return(false);
}
return(false);
}
if (target._x < subject._x) {
var vy = subject._vel.getY();
var newVX = ((target._x + subject._radius) - subject._x);
var newVY = (vy * (newVY / vy));
var newY = (subject._y + newVY);
if (((newY <= target._y) && (newY >= target._y1)) || ((newY >= target._y) && (newY <= target._y1))) {
return((newVX / vx) * subject._vel.length());
}
return(false);
}
return(false);
}
return(false);
};
GameObject.count = 0;
GameObject.objectHash = new Object();
GameObject.prototype.getID = function () {
return(this.ID);
};
GameObject.getObject = function (ID) {
return(GameObject.objectHash[ID]);
};
GameObject.prototype.isAbove = function (gameObj) {
if (this._y > gameObj._y) {
return(true);
}
return(false);
};
GameObject.prototype.changeDepth = function (iDepth) {
this._depth = iDepth;
this._mc.swapDepths(iDepth);
};
GameObject.prototype.createMC2 = function (sMCNamePrefix, sLinkageID, iBaseDepth) {
var index = this._objectNum;
var mcName = (sMCNamePrefix + index);
_root.attachMovie(sLinkageID, mcName, iBaseDepth + index);
return(_root[mcName]);
};
GameObject.prototype.createMC3 = function (sMCNamePrefix, sLinkageID, iDepth) {
var index = this._objectNum;
var mcName = (sMCNamePrefix + index);
_root.attachMovie(sLinkageID, mcName, iDepth);
return(_root[mcName]);
};
GameObject.prototype.hitTest = function (x, y) {
return(this._mc.hitTest(x, y, true));
};
GameObject.prototype.destroy = function () {
this._mc.removeMovieClip();
};
Engine.prototype.doAction = function () {
for (obj in this._actionObjects) {
this._actionObjects[obj][this._actionFunction]();
}
};
Engine.prototype.addListener = function (oObject) {
this._actionObjects.push(oObject);
};
Engine.prototype.removeListener = function (oObject) {
var i = 0;
while (i < this._actionObjects.length) {
if (this._actionObjects[i] == oObject) {
this._actionObjects.splice(i, 1);
return;
}
i++;
}
};
Engine.prototype.removeAllListeners = function () {
this._actionObjects.length = 0;
};
FrameBasedEngine.prototype = new Engine();
FrameBasedEngine.prototype.start = function () {
_root.createEmptyMovieClip("myEngineMC", 500);
this._mc = _root.myEngineMC;
this._mc.parent = this;
this._mc.onEnterFrame = this.enterFrameAction;
};
FrameBasedEngine.prototype.enterFrameAction = function () {
this.parent.doAction();
updateAfterEvent();
};
FrameBasedEngine.prototype.stop = function () {
this._mc.onEnterFrame = null;
};
FrameBasedEngine.prototype.toString = function () {
return("FrameBasedEngine");
};
MouseController.prototype.addListener = function (oGameObject, sEventType) {
this._listeners[sEventType][oGameObject.getID()] = oGameObject;
};
MouseController.prototype.removeListener = function (oGameObject, sEventType) {
delete this._listeners[sEventType][oGameObject.getID()];
};
MouseController.prototype.removeAllListeners = function (sEventType) {
delete this._listeners[sEventType];
this._listeners[sEventType] = new Object();
};
MouseController.prototype.start = function () {
Mouse.addListener(this);
};
MouseController.prototype.stop = function () {
Mouse.removeListener(this);
};
MouseController.prototype.onMouseDown = function () {
var x = _root._xmouse;
var y = _root._ymouse;
var target = this.getTarget(x, y, this._listeners.onMouseDown);
if (target != null) {
target.mouseDownAction(x, y);
} else {
_root.myGameBoard.unclaimedPressEvent(x, y);
}
updateAfterEvent();
};
MouseController.prototype.onMouseUp = function () {
var aListener;
for (aListener in this._listeners.onMouseUp) {
this._listeners.onMouseUp[aListener].mouseUpAction(_root._xmouse, _root._ymouse);
}
updateAfterEvent();
};
MouseController.prototype.onMouseMove = function () {
var aListener;
for (aListener in this._listeners.onMouseMove) {
this._listeners.onMouseMove[aListener].mouseMoveAction(_root._xmouse, _root._ymouse);
}
updateAfterEvent();
};
MouseController.prototype.getTarget = function (x, y, targetList) {
var possibleTarget;
var confirmedTargets = [];
for (possibleTarget in targetList) {
if (targetList[possibleTarget].hitTest(x, y)) {
confirmedTargets.push(targetList[possibleTarget]);
}
}
if (confirmedTargets.length == 0) {
return(null);
}
if (confirmedTargets.length == 1) {
return(confirmedTargets[0]);
}
var sameTypeTargets = [];
var i = 0;
while (i < confirmedTargets.length) {
if (confirmedTargets[i] instanceof Fencepost) {
sameTypeTargets.push(confirmedTargets[i]);
}
i++;
}
if (sameTypeTargets.length == 1) {
return(sameTypeTargets[0]);
}
if (sameTypeTargets.length > 1) {
var lowest = {_y:0};
var i = 0;
while (i < sameTypeTargets.length) {
if (sameTypeTargets[i]._y > lowest._y) {
lowest = sameTypeTargets[i];
}
i++;
}
return(lowest);
}
var i = 0;
while (i < confirmedTargets.length) {
if (confirmedTargets[i] instanceof Fence) {
return(confirmedTargets[i]);
}
i++;
}
return(confirmedTargets[0]);
};
MouseController.prototype.toString = function () {
return("MouseController");
};
Command.prototype.execute = function (executeArgList) {
if (this._argList != null) {
this._receiver[this._functionName].apply(this._receiver, this._argList);
} else if (executeArgList != null) {
this._receiver[this._functionName].apply(this._receiver, executeArgList);
} else {
this._receiver[this._functionName]();
}
};
Command.prototype.toString = function () {
return(((((("Command(rcv: " + this._receiver) + ", fun: ") + this._functionName) + ", arg: ") + this._argList) + ")");
};
CommandObject.prototype.execute = function (executeArgList) {
if (this.argList != null) {
this.receiver[this.functionName].apply(this.receiver, this.argList);
} else if (executeArgList != null) {
this.receiver[this.functionName].apply(this.receiver, executeArgList);
} else {
this.receiver[this.functionName]();
}
};
CommandObject.prototype.toString = function () {
return(((((((("Command(rcv: " + this.receiver) + ", fun: ") + this.functionName) + ", arg: ") + this.argList) + ", requiresWatch: ") + this.requiresWatch) + ")");
};
Iterator.prototype.first = function () {
this._current = 0;
};
Iterator.prototype.next = function () {
this._current++;
};
Iterator.prototype.prev = function () {
this._current--;
};
Iterator.prototype.deleteCurrentItem = function () {
delete this._list[this._current];
};
Iterator.prototype.isDone = function () {
return(this._current >= this._list.length);
};
Iterator.prototype.currentItem = function () {
return(this._list[this._current]);
};
Iterator.prototype.toString = function () {
return("Iterator");
};
InstructionChain.count = 0;
InstructionChain.prototype.addCommand = function (command) {
this.list.push(command);
};
InstructionChain.prototype.next = function () {
this.iterator.deleteCurrentItem();
this.iterator.next();
if (!this.iterator.isDone()) {
this.execute();
} else {
this.iterator.prev();
}
};
InstructionChain.prototype.start = function () {
this.iterator.first();
this.execute();
};
InstructionChain.prototype.execute = function () {
var curCmd = this.iterator.currentItem();
curCmd.execute();
if (curCmd.requiresWatch) {
curCmd.myInterval = setInterval(this, "watchEnterFrame", 10, this.iterator.currentItem());
} else {
this.next();
}
};
InstructionChain.prototype.watchEnterFrame = function (oCommand) {
if (oCommand.receiver[oCommand.functionName + "_Complete"] == true) {
this.watchComplete(oCommand);
}
};
InstructionChain.prototype.watchComplete = function (oCommand) {
clearInterval(oCommand.myInterval);
this.next();
};
InstructionChain.prototype.toString = function () {
return(("InstructionChain(" + this.id) + ")");
};
ArrowPointer.prototype = new GameObject();
ArrowPointer.numCreated = 0;
ArrowPointer.prototype.mouseMoveAction = function (mouseX, mouseY) {
var dx = (mouseX - this._x);
var dy = (mouseY - this._y);
this._direction = this.getTargetDirection(this.getActualDirection(dx, dy));
if (this._direction == 360) {
this._direction = 0;
}
this._mc.gotoAndStop(this._frameOffset + this._direction);
};
ArrowPointer.prototype.show = function () {
myMouseController.addListener(this, "onMouseMove");
};
ArrowPointer.prototype.hide = function () {
myMouseController.removeListener(this, "onMouseMove");
this._mc.gotoAndStop("hide");
this._direction = null;
};
ArrowPointer.prototype.getTargetDirection = function (iActualDirection) {
var i = _root.binarySearchForClosest(this._targetDirections, iActualDirection);
if (Math.abs(iActualDirection - this._targetDirections[i]) > Math.abs(iActualDirection - (this._targetDirections[this._targetDirections.length - 1] - 360))) {
i = this._targetDirections.length - 1;
}
return(this._targetDirections[i]);
};
ArrowPointer.prototype.getActualDirection = function (x, y) {
var r = Math.sqrt((x * x) + (y * y));
var cosine = (x / r);
var sine = (y / r);
var rad = Math.atan2(sine, cosine);
var d = (rad * 57.2957795130823);
d = d + 90;
if (d < 0) {
d = d + 360;
}
return(d);
};
ArrowPointer.prototype.getDirection = function () {
return(this._direction);
};
ArrowPointer.prototype.removeTargetDirection = function (iDirection) {
var i = _root.binarySearchForClosest(this._targetDirections, iDirection);
this._targetDirections.splice(i, 1);
if (iDirection == 0) {
var i = _root.binarySearchForClosest(this._targetDirections, 360);
this._targetDirections.splice(i, 1);
} else if (iDirection == 360) {
var i = _root.binarySearchForClosest(this._targetDirections, 0);
this._targetDirections.splice(i, 1);
}
};
ArrowPointer.prototype.getTargetDirectionNumber = function () {
return(this._targetDirections.length);
};
ArrowPointer.prototype.destroy = function () {
this._mc.removeMovieClip();
};
ArrowPointer.prototype.toString = function () {
return("ArrowPointer");
};
FencepostTop.prototype = new GameObject();
FencepostTop.numCreated = 0;
FencepostTop.prototype.hitTest = function (x, y) {
return(this._mc.hitTest(x, y, true));
};
FencepostTop.prototype.updateBoundingBox = function () {
var x1;
var y1;
var x2;
var y2;
x1 = this._x - this._radius;
x2 = this._x + this._radius;
y1 = this._y - this._radius;
y2 = this._y + this._radius;
this._bounds = {x1:x1, y1:y1, x2:x2, y2:y2};
};
FencepostTop.prototype.getBoundingBox = function () {
return(this._bounds);
};
FencepostTop.prototype.toString = function () {
return(("FencepostTop(" + this._objectNum) + ")");
};
Fencepost.prototype = new GameObject();
Fencepost.numCreated = 0;
Fencepost.prototype.showBonus = function (minX, minY, maxX) {
this._top._mc.postMC.gotoAndPlay("bonus");
if ((this._y == minY) && ((this._x == minX) || (this._x == maxX))) {
this._mc.arm180.p1.gotoAndPlay("bonus");
this._mc.arm180.p2.gotoAndPlay("bonus");
}
};
Fencepost.prototype.skipAnimation = function () {
this._mc.postMC.gotoAndStop("up");
this._top._mc.postMC.gotoAndStop("up");
if (this._connectedFences[180] != null) {
this._mc.arm180.p1.gotoAndStop("solid");
this._mc.arm180.p2.gotoAndStop("solid");
}
};
Fencepost.prototype.hitTest = function (x, y) {
return(this._top.hitTest(x, y, true) || (this._mc.hitTest(x, y, true)));
};
Fencepost.prototype.mouseUpAction = function (x, y) {
myMouseController.removeListener(this, "onMouseUp");
var direction = this._arrowPointer.getDirection();
if (direction != null) {
mySoundModule.playSound("launchFence");
switch (direction) {
case 0 :
x = this._x;
y = this._y - 1;
break;
case 90 :
x = this._x + 1;
y = this._y;
break;
case 180 :
x = this._x;
y = this._y + 1;
break;
case 270 :
x = this._x - 1;
y = this._y;
}
this._parent.createNewFence(this._x, this._y, direction, this, "expanding");
this._parent._gameBoard._scoreBoard.resetDexterTap();
}
this._arrowPointer.hide();
};
Fencepost.prototype.showArm = function (bBlink) {
if (bBlink == false) {
this._mc.arm180.gotoAndStop("show");
this._mc.arm180.p1.gotoAndStop("solid");
this._mc.arm180.p2.gotoAndStop("solid");
} else {
this._mc.arm180.gotoAndStop("show");
}
};
Fencepost.prototype.mouseDownAction = function (x, y) {
if (this._arrowPointer.getTargetDirectionNumber()) {
myMouseController.addListener(this, "onMouseUp");
this._arrowPointer.show();
} else {
this._parent.createNewXGraphic(x, y);
}
};
Fencepost.prototype.connectFence = function (oFence, iDirection) {
this._connectedFences[iDirection] = oFence;
this._arrowPointer.removeTargetDirection(iDirection);
};
Fencepost.prototype.collision = function (sType) {
switch (sType) {
case "animal" :
case "chicken" :
case "fencepost" :
return;
case "electricFence" :
return;
case "solidFence" :
}
};
_root.fencepostTimerIterations = 0;
_root.fencepostTimerTotal = 0;
Fencepost.prototype.checkForCollision = function (subject) {
var result = Geometry.checkForStaticCircleCollision(subject, this);
return(result);
};
Fencepost.prototype.reflectCircle = function (subject) {
return(Geometry.reflectCircle(subject, this));
};
Fencepost.prototype.updateBoundingBox = function () {
var x1;
var y1;
var x2;
var y2;
x1 = this._x - this._radius;
x2 = this._x + this._radius;
y1 = this._y - this._radius;
y2 = this._y + this._radius;
this._bounds = {x1:x1, y1:y1, x2:x2, y2:y2};
};
Fencepost.prototype.getBoundingBox = function () {
return(this._bounds);
};
Fencepost.prototype.toString = function () {
return(("Fencepost(" + this._objectNum) + ")");
};
Fence.prototype = new GameObject();
Fence.numCreated = 0;
Fence.prototype.addPost = function (oPost) {
if (this._horizontal) {
this._nodes.InsertByValue(oPost, "_x");
} else {
this._nodes.InsertByValue(oPost, "_y");
}
};
Fence.prototype.mouseDownAction = function (x, y) {
if (this._horizontal) {
this._parent.addNewPostToFence(snapToGrid(x), this._y, this);
} else {
this._parent.addNewPostToFence(this._x, snapToGrid(y), this);
}
};
Fence.prototype.update = function () {
if (this._state == "expanding") {
this.move();
this._electricSegmentsCreated = this.sizeMC(this._electricSegmentHeight, this._electricLinkageID, this._electricSegmentsCreated);
this.updateBoundingBox();
}
};
Fence.prototype.createShadow = function () {
this._shadowMC = this.createMC3("fenceShadowMC", "fence shadow", _root.fenceShadowDepth + this._objectNum);
this._shadowMC._x = this._bounds.x1;
this._shadowMC._y = this._y;
this._shadowMC._width = this._bounds.x2 - this._bounds.x1;
};
Fence.prototype.resize = function (newX, newY) {
this._x1 = newX;
this._y1 = newY;
this._solidSegmentsCreated = this.sizeMC(this._solidSegmentHeight, this._solidLinkageID, this._solidSegmentsCreated);
};
Fence.prototype.sizeMC = function (iSegmentHeight, sSegmentPrefix, iSegmentsCreated) {
var h = Math.sqrt(((this._x - this._x1) * (this._x - this._x1)) + ((this._y - this._y1) * (this._y - this._y1)));
var segmentsNeeded = Math.ceil(h / iSegmentHeight);
if (iSegmentsCreated > 0) {
this._mc[sSegmentPrefix + iSegmentsCreated].gotoAndStop(iSegmentHeight);
}
var i;
while (iSegmentsCreated < segmentsNeeded) {
i = iSegmentsCreated + 1;
this._mc.attachMovie(sSegmentPrefix, sSegmentPrefix + i, 300 - i);
this._mc[sSegmentPrefix + i]._y = this._mc[sSegmentPrefix + i]._y - (iSegmentsCreated * iSegmentHeight);
this._mc[sSegmentPrefix + i].gotoAndStop(iSegmentHeight);
if (iSegmentsCreated > 0) {
this._mc[sSegmentPrefix + i].loopMC.gotoAndPlay(this._mc[sSegmentPrefix + 1].loopMC._currentframe);
}
iSegmentsCreated++;
}
if ((h % iSegmentHeight) > 0) {
this._mc[sSegmentPrefix + segmentsNeeded].gotoAndStop((h % iSegmentHeight) + 1);
}
return(iSegmentsCreated);
};
Fence.prototype.showBonus = function (x1, y1, x2, y2) {
switch (this._direction) {
case 90 :
var startSeg = Math.floor((x1 - this._x) / this._solidSegmentHeight);
var endSeg = Math.floor((x2 - this._x) / this._solidSegmentHeight);
var prefix = "solidSegmentMC";
break;
case 180 :
var startSeg = Math.floor((y1 - this._y) / this._solidSegmentHeight);
var endSeg = Math.floor((y2 - this._y) / this._solidSegmentHeight);
var prefix = "solidSegmentMC2";
break;
case 270 :
var startSeg = Math.floor((this._x - x2) / this._solidSegmentHeight);
var endSeg = Math.floor((this._x - x1) / this._solidSegmentHeight);
var prefix = "solidSegmentMC2";
break;
case 0 :
var startSeg = Math.floor((this._y - y2) / this._solidSegmentHeight);
var endSeg = Math.floor((this._y - y1) / this._solidSegmentHeight);
var prefix = "solidSegmentMC";
break;
}
startSeg++;
endSeg++;
var i = startSeg;
while (i < endSeg) {
this._mc[prefix + i].fencePieceMC.gotoAndPlay("bonus");
i++;
}
};
Fence.prototype.stopExpanding = function () {
this._type = "solidFence";
this._mc.gotoAndStop("solid");
this._state = "static";
this._solidSegmentsCreated = this.sizeMC(this._solidSegmentHeight, this._solidLinkageID, this._solidSegmentsCreated);
this.updateBoundingBox();
if (this._horizontal) {
this.createShadow();
} else {
this._mc.swapDepths(_root.verticalFenceDepth + this._objectNum);
if (this._direction == 180) {
var i = 0;
while (i < this._armNeedingPosts.length) {
this._armNeedingPosts[i].showArm();
i++;
}
}
}
};
Fence.prototype.move = function () {
this._x1 = this._head._x;
this._y1 = this._head._y;
};
Fence.prototype.hitTest = function (x, y) {
if (this._mc.hitTest(x, y, true)) {
return(true);
}
if (this._horizontal) {
if ((this._y == snapToGrid(y)) && (((x >= this._x1) && (x <= this._x)) || ((x >= this._x) && (x <= this._x1)))) {
return(true);
}
} else if ((this._x == snapToGrid(x)) && (((y >= this._y1) && (y <= this._y)) || ((y >= this._y) && (y <= this._y1)))) {
return(true);
}
return(false);
};
Fence.prototype.collision = function (sType) {
switch (sType) {
case "animal" :
case "chicken" :
return;
}
};
Fence.prototype.updateBoundingBox = function () {
var x1;
var y1;
var x2;
var y2;
if (this._x1 <= this._x) {
x1 = this._x1;
x2 = this._x;
} else {
x1 = this._x;
x2 = this._x1;
}
if (this._y1 <= this._y) {
y1 = this._y1;
y2 = this._y;
} else {
y1 = this._y;
y2 = this._y1;
}
this._bounds = {x1:x1, y1:y1, x2:x2, y2:y2};
};
Fence.prototype.getBoundingBox = function () {
return(this._bounds);
};
_root.fenceTimerIterations = 0;
_root.fenceTimerTotal = 0;
Fence.prototype.checkForCollision = function (subject) {
var result = Geometry.checkForStaticLineCollision(subject, this);
return(result);
};
Fence.prototype.reflectCircle = function (subject) {
return(Geometry.reflectLine(subject, this));
};
Fence.prototype.toString = function () {
return(("Fence(" + this._objectNum) + ")");
};
FenceHead.prototype = new GameObject();
FenceHead.numCreated = 0;
FenceHead.prototype.mouseDownAction = function (x, y) {
};
FenceHead.prototype.update = function () {
this._x = this._x + this._vx;
this._y = this._y + this._vy;
this._mc._x = this._x;
this._mc._y = this._y - _root.fenceHeight;
};
FenceHead.prototype.updateVel = function (vVel) {
this._vel = vVel;
this._vx = vVel.getX();
this._vy = vVel.getY();
};
FenceHead.prototype.remove = function () {
this._fence.stopExpanding();
this._parent.removeFromGroup("_movingCircles", this);
this._mc.removeMovieClip();
};
FenceHead.prototype.collision = function (sType, oTarget) {
switch (sType) {
case "animal" :
case "chicken" :
return;
case "fencepost" :
var radVect = this._vel.unitSize().times(oTarget._radius);
this._x = this._x - radVect.getX();
this._y = this._y - radVect.getY();
this._fence.update();
this.remove();
this._parent.addFenceToPost(this._fence, oTarget, this._fence._counterDirection);
if (this._fence._counterDirection == 180) {
oTarget.showArm();
}
this._parent.chkForCircuit(oTarget, this._fence._direction);
return;
case "electricFence" :
case "solidFence" :
if (oTarget._horizontal) {
var x = this._fence._x;
var y = oTarget._y;
} else {
var x = oTarget._x;
var y = this._fence._y;
}
this.remove();
var newPost = this._parent.appendNewPost(x, y, this._fence, oTarget);
if (!oTarget._horizontal) {
if (oTarget._state == "expanding") {
oTarget._armNeedingPosts.push(newPost);
} else {
newPost.showArm(false);
}
}
this._parent.chkForCircuit(newPost, this._fence._direction);
}
};
FenceHead.prototype.checkForCollision = function (subject) {
return(Geometry.checkForMovingCircleCollision(subject, this));
};
FenceHead.prototype.reflectCircle = function (subject) {
return(Geometry.reflectCircle(subject, this));
};
FenceHead.prototype.updateBoundingBox = function () {
var x1;
var y1;
var x2;
var y2;
if (this._vx >= 0) {
x1 = this._x - this._radius;
x2 = (this._x + this._vx) + this._radius;
} else {
x1 = (this._x + this._vx) - this._radius;
x2 = this._x + this._radius;
}
if (this._vy >= 0) {
y1 = this._y - this._radius;
y2 = (this._y + this._vy) + this._radius;
} else {
y1 = (this._y + this._vy) - this._radius;
y2 = this._y + this._radius;
}
this._bounds = {x1:x1, y1:y1, x2:x2, y2:y2};
};
FenceHead.prototype.getBoundingBox = function () {
return(this._bounds);
};
FenceHead.prototype.toString = function () {
return(("FenceHead(" + this._objectNum) + ")");
};
Animal.prototype = new GameObject();
Animal.numCreated = 0;
Animal.prototype.mouseDownAction = function (x, y) {
this._parent._gameBoard.createNewXGraphic(x, y);
};
Animal.prototype.updateVel = function (vVel) {
this._vel = vVel;
this._vx = vVel.getX();
this._vy = vVel.getY();
};
Animal.prototype.update = function () {
this._x = this._x + this._vx;
this._y = this._y + this._vy;
this._mc._x = this._x;
this._mc._y = this._y;
if (this._vy < 0) {
this._parent._gameBoard.checkForZMoveDown(this);
} else {
this._parent._gameBoard.checkForZMoveUp(this);
}
if (this._vel.length() != this._normalVel) {
this.updateVel(new Vect(this._vel.angle(), this._normalVel));
}
};
Animal.prototype.updateGraphic = function () {
var x = this._vel.getX();
var y = this._vel.getY();
var r = Math.sqrt((x * x) + (y * y));
var cosine = (x / r);
var sine = (y / r);
var rad = Math.atan2(sine, cosine);
var d = (rad * 57.2957795130823);
d = Math.round(d);
d = d + 90;
if (d <= 0) {
d = d + 360;
}
this._mc.gotoAndStop(d);
};
Animal.prototype.relax = function (iCenterX) {
this._parent.removeFromGroup("_movingCircles", this);
this._parent.addToGroup("_staticCircles", this);
if (this._x > iCenterX) {
this._mc.gotoAndStop("peckLeft");
} else {
this._mc.gotoAndStop("peckRight");
}
};
Animal.prototype.collision = function (sType) {
switch (sType) {
case "electricFence" :
case "fenceHead" :
this.killMe();
return;
case "animal" :
case "chicken" :
return;
case "fencepost" :
return;
case "solidFence" :
}
};
Animal.prototype.checkForCollision = function (subject) {
var result = Geometry.checkForMovingCircleCollision(subject, this);
return(result);
};
Animal.prototype.updateBoundingBox = function () {
var x1;
var y1;
var x2;
var y2;
if (this._vx >= 0) {
x1 = this._x - this._radius;
x2 = (this._x + this._vx) + this._radius;
} else {
x1 = (this._x + this._vx) - this._radius;
x2 = this._x + this._radius;
}
if (this._vy >= 0) {
y1 = this._y - this._radius;
y2 = (this._y + this._vy) + this._radius;
} else {
y1 = (this._y + this._vy) - this._radius;
y2 = this._y + this._radius;
}
this._bounds = {x1:x1, y1:y1, x2:x2, y2:y2};
};
Animal.prototype.getBoundingBox = function () {
return(this._bounds);
};
Animal.prototype.toString = function () {
return(("Animal(" + this._objectNum) + ")");
};
Chicken.prototype = new Animal();
Chicken.prototype.startup = function () {
this.updateGraphic();
};
Chicken.prototype.relax = function (iCenterX, bonusPoints) {
this._parent.removeFromGroup("_movingCircles", this);
this._parent.addToGroup("_staticCircles", this);
this._mc.bonusPoints = bonusPoints;
if (this._x > iCenterX) {
this._mc.gotoAndStop("peckLeft");
} else {
this._mc.gotoAndStop("peckRight");
}
};
Chicken.prototype.killMe = function () {
clearInterval(this._runInterval);
new Negative500(this._x, this._y, this._parent._gameBoard);
this._parent._gameBoard.scoreEvent("killChicken");
this._parent.removeFromGroup("_movingCircles", this);
mySoundModule.playSound("zapChicken");
this._mc.gotoAndStop("explode");
};
Chicken.prototype.toggleRun = function () {
if (this._isRunning) {
clearInterval(this._runInterval);
this._normalVel = this._speed;
this._isRunning = false;
} else {
this._normalVel = this._Speed * 2;
this._isRunning = true;
}
};
Chicken.prototype.collision = function (sType) {
this.updateGraphic();
switch (sType) {
case "electricFence" :
case "fenceHead" :
this.killMe();
return;
case "rooster" :
if (!this._isRunning) {
this.toggleRun();
}
clearInterval(this._runInterval);
this._runInterval = setInterval(this, "toggleRun", 6000);
return;
case "DeeDee" :
this.killMe();
return;
case "animal" :
case "chicken" :
return;
case "fencepost" :
return;
case "solidFence" :
}
};
Chicken.prototype.reflectCircle = function (subject) {
var reflectObj = Geometry.reflectCircle(subject, this);
return(reflectObj);
};
Chicken.prototype.toString = function () {
return(("Chicken(" + this._objectNum) + ")");
};
Rooster.prototype = new Animal();
Rooster.prototype.startup = function () {
this.toggleRun();
};
Rooster.prototype.toggleRun = function () {
if (this._isRunning) {
if (this._vx < 0) {
this._mc.gotoAndStop("peckLeft");
} else {
this._mc.gotoAndStop("peckRight");
}
this._oldVel = this._vel;
this.updateVel(_root._zeroVel);
this._normalVel = 0;
this._isRunning = false;
clearInterval(this._toggleInterval);
this._toggleInterval = setInterval(this, "toggleRun", this._peckTime);
} else {
this._normalVel = 10;
this.updateVel(this._oldVel);
this.updateGraphic();
this._isRunning = true;
clearInterval(this._toggleInterval);
this._toggleInterval = setInterval(this, "toggleRun", this._runTime);
}
};
Rooster.prototype.killMe = function () {
clearInterval(this._toggleInterval);
new Negative500(this._x, this._y, this._parent._gameBoard);
this._parent._gameBoard.scoreEvent("killRooster");
this._parent.removeFromGroup("_movingCircles", this);
mySoundModule.playSound("zapRooster");
this._mc.gotoAndStop("explode");
};
Rooster.prototype.relax = function (iCenterX) {
clearInterval(this._toggleInterval);
this._parent.removeFromGroup("_movingCircles", this);
this._parent.addToGroup("_staticCircles", this);
if (this._x > iCenterX) {
this._mc.gotoAndStop("peckLeft");
} else {
this._mc.gotoAndStop("peckRight");
}
};
Rooster.prototype.collision = function (sType) {
if (this._normalVel > 0) {
this.updateGraphic();
}
super.collision(sType);
};
Rooster.prototype.reflectCircle = function (subject) {
var reflectObj = Geometry.reflectCircle(subject, this);
return(reflectObj);
};
Rooster.prototype.toString = function () {
return(("Rooster(" + this._objectNum) + ")");
};
TestCircle.prototype = new Animal();
TestCircle.numCreated = 0;
TestCircle.prototype.collision = function (sType) {
super.collision(sType);
};
TestCircle.prototype.reflectCircle = function (subject) {
var reflectObj = Geometry.reflectCircle(subject, this);
return(reflectObj);
};
TestCircle.prototype.toString = function () {
return(("TestCircle(" + this._objectNum) + ")");
};
DeeDee.prototype = new GameObject();
DeeDee.numCreated = 0;
DeeDee.prototype.startup = function () {
this._showTimer = setInterval(this, "showTime", 1000);
};
DeeDee.prototype.showTime = function () {
clearInterval(this._showTimer);
this._mc.gotoAndPlay("strut");
this.updateVel(new Vect(-1, 0));
this._parent.addToGroup("_movingCircles", this);
};
DeeDee.prototype.updateVel = function (vVel) {
this._vel = vVel;
this._vx = vVel.getX();
this._vy = vVel.getY();
};
DeeDee.prototype.update = function () {
this._x = this._x + this._vx;
this._y = this._y + this._vy;
this._mc._x = this._x;
this._mc._y = this._y;
if (this._x < 0) {
this._parent.removeFromGroup("_movingCircles", this);
}
};
DeeDee.prototype.pickupChicken = function () {
this.updateVel(_root._zeroVel);
this._mc.gotoAndPlay("toss");
};
DeeDee.prototype.collision = function (sType, oTarget) {
switch (sType) {
case "electricFence" :
case "fenceHead" :
case "rooster" :
return;
case "chicken" :
this.pickupChicken();
return;
case "animal" :
return;
case "fencepost" :
return;
case "solidFence" :
}
};
DeeDee.prototype.toString = function () {
return(("DeeDee(" + this._objectNum) + ")");
};
Negative500.prototype = new GameObject();
BonusPoints.prototype = new GameObject();
BonusPoints.prototype.setPoints = function (mc, points) {
var pointArray = points.toString().split("");
var digitNum = pointArray.length;
while (pointArray.length < 4) {
pointArray.push(11);
}
var i = 0;
while (i < pointArray.length) {
pointArray[i] = int(pointArray[i]);
if (pointArray[i] == 0) {
pointArray[i] = 10;
}
i++;
}
mc.ones.gotoAndStop(pointArray[3]);
mc.tens.gotoAndStop(pointArray[2]);
mc.hundreds.gotoAndStop(pointArray[1]);
mc.thousands.gotoAndStop(pointArray[0]);
return(digitNum);
};
BonusPoints.prototype.destroy = function () {
this._mc.removeMovieClip();
};
BonusPoints.numCreated = 0;
BonusFloor.prototype = new GameObject();
BonusFloor.prototype.mouseDownAction = function (x, y) {
this._parent.createNewXGraphic(x, y);
};
BonusFloor.prototype.destroy = function () {
this._mc.removeMovieClip();
};
BonusFloor.numCreated = 0;
ScoreBoard.prototype.resetScore = function () {
this._curScore = 0;
};
ScoreBoard.prototype.resetTimer = function () {
this._curTime = 0;
this._timerInterval = setInterval(this, "updateTimer", (this._timeLimit / this._timerFrames) * 1000);
this.resetDexterTap();
};
ScoreBoard.prototype.resetDexterTap = function () {
clearInterval(this._dexterTapInterval);
this._dexterTapInterval = setInterval(this, "dexterTap", 8000);
};
ScoreBoard.prototype.dexterPress = function () {
this._mc.dexterMC.gotoAndPlay("press");
this._mc.dexterShadowMC.gotoAndPlay("press");
this.resetDexterTap();
};
ScoreBoard.prototype.dexterTap = function () {
clearInterval(this._dexterTapInterval);
this._mc.dexterMC.gotoAndPlay("tapping");
this._mc.dexterShadowMC.gotoAndPlay("tapping");
};
ScoreBoard.prototype.updateScorePanel = function () {
_root.previousScoreField.text = this._curScore - this._levelScore;
_root.currentScoreField.text = this._levelScore;
var timeBonus = (Math.floor(this._timeLimit - (this._timeLimit * (this._curTime / this._timerFrames))) * 10);
_root.timeBonusField.text = timeBonus;
this._curScore = this._curScore + timeBonus;
_root.totalScoreField.text = this._curScore;
};
ScoreBoard.prototype.updateScore = function (iPoints) {
this._curScore = this._curScore + iPoints;
this._levelScore = this._levelScore + iPoints;
var sPoints;
if (this._curScore >= 0) {
var leadingZeros = (6 - this._curScore.toString().length);
sPoints = "";
var i = 0;
while (i < leadingZeros) {
sPoints = sPoints + "0";
i++;
}
}
sPoints = sPoints + this._curScore;
this._mc.scoreField.text = sPoints;
};
ScoreBoard.prototype.resetChickensToCatch = function (iChickenCount) {
if (iChickenCount <= 3) {
var prefix = "chickenMC";
var i = 1;
while (i <= 4) {
this._mc["4chickenMC" + i].gotoAndStop("hide");
i++;
}
var totalGraphics = 3;
} else {
var prefix = "4chickenMC";
var i = 1;
while (i <= 3) {
this._mc["chickenMC" + i].gotoAndStop("hide");
i++;
}
var totalGraphics = 4;
}
var i = 0;
while (i < iChickenCount) {
this._mc[prefix + (totalGraphics - i)].gotoAndStop("ready");
i++;
}
while (i < totalGraphics) {
this._mc[prefix + (totalGraphics - i)].gotoAndStop("hide");
i++;
}
this._chickensToCatch = iChickenCount;
this._chickensKilled = 0;
};
ScoreBoard.prototype.resetTotalChickens = function (iChickenCount) {
this._totalChickens = iChickenCount;
this._chickensCaught = 0;
};
ScoreBoard.prototype.catchChicken = function (iChickenCount) {
if (this._chickensToCatch <= 3) {
var graphicIndex = 4;
var prefix = "chickenMC";
} else {
var graphicIndex = 5;
var prefix = "4chickenMC";
}
var graphicStart = (graphicIndex - this._chickensToCatch);
var graphicStart = (graphicIndex - this._chickensToCatch);
var remainingSlots = (this._chickensToCatch - this._chickensCaught);
var startI = (graphicStart + this._chickensCaught);
var endI = (startI + iChickenCount);
if ((endI - startI) > remainingSlots) {
endI = startI + remainingSlots;
}
var i = startI;
while (i < endI) {
this._mc[prefix + i].gotoAndPlay("blink");
i++;
}
this._chickensCaught = this._chickensCaught + iChickenCount;
if ((this._chickensCaught + this._chickensKilled) == this._totalChickens) {
if (this._chickensCaught >= this._chickensToCatch) {
this._parent.endLevel("inBetween");
} else {
this._parent.endLevel("lose");
}
}
this._mc.dexterMC.gotoAndPlay("happy");
this._mc.dexterShadowMC.gotoAndPlay("happy");
};
ScoreBoard.prototype.killChicken = function () {
this._chickensKilled++;
if (this._chickensToCatch <= 3) {
var graphicIndex = 4;
var prefix = "chickenMC";
} else {
var graphicIndex = 5;
var prefix = "4chickenMC";
}
if ((this._totalChickens - this._chickensKilled) < this._chickensToCatch) {
var graphicStart = (graphicIndex - this._chickensToCatch);
var i = (graphicStart + (this._totalChickens - this._chickensKilled));
this._mc[prefix + i].gotoAndStop("crossOff");
}
var frame = ("oops" + (1 + random(1)));
this._mc.dexterMC.gotoAndPlay(frame);
this._mc.dexterShadowMC.gotoAndPlay(frame);
if ((this._chickensCaught + this._chickensKilled) == this._totalChickens) {
if (this._chickensCaught >= this._chickensToCatch) {
this._parent.endLevel("inBetween");
} else {
this._parent.endLevel("lose");
}
}
};
ScoreBoard.prototype.updateLevel = function (iLevel) {
this._levelScore = 0;
this._mc.levelField.text = "LEVEL " + iLevel;
};
ScoreBoard.prototype.updateTimer = function () {
this._curTime++;
this._mc.timerMC.gotoAndStop(this._curTime);
if (this._curTime >= this._timerFrames) {
if (this._chickensCaught >= this._chickensToCatch) {
this._parent.endLevel("inBetween");
} else {
this._parent.endLevel("lose");
}
}
updateAfterEvent();
};
ScoreBoard.prototype.stopTimer = function () {
clearInterval(this._timerInterval);
clearInterval(this._dexterTapInterval);
};
FourWalledWorld.numCreated = 0;
FourWalledWorld.prototype.createNewPost = function (x, y, bActive) {
x = snapToGrid(x);
y = snapToGrid(y);
var newPost = new Fencepost(x, y, this, bActive);
this.addToGroup("_staticCircles", newPost);
if (x == this._x1) {
newPost.connectFence(null, 270);
} else if (x == this._x2) {
newPost.connectFence(null, 90);
}
if (y == this._y1) {
newPost.connectFence(null, 0);
} else if (y == this._y2) {
newPost.connectFence(null, 180);
}
var box;
var i = 0;
while (i < this._boxes.length) {
box = this._boxes[i];
if ((((box.disabled && (x >= box.minX)) && (x <= box.maxX)) && (y >= box.minY)) && (y <= box.maxY)) {
if (x == box.minX) {
newPost.connectFence(null, 90);
} else if (x == box.maxX) {
newPost.connectFence(null, 270);
}
if (y == box.minY) {
newPost.connectFence(null, 180);
} else if (y == box.maxY) {
newPost.connectFence(null, 0);
}
}
i++;
}
if (bActive) {
this._gameBoard._scoreBoard.dexterPress();
}
return(newPost);
};
FourWalledWorld.prototype.createNewFence = function (iStartX, iStartY, iDirection, originatingPost, state, x1, y1) {
var newFence = new Fence(iStartX, iStartY, iDirection, this, state, x1, y1);
if (state == "expanding") {
this.addToGroup("_staticLines", newFence);
newFence._armNeedingPosts.push(originatingPost);
} else {
this.addToGroup("_staticLines", newFence);
if (iDirection == 180) {
originatingPost.showArm();
}
}
this.addFenceToPost(newFence, originatingPost, newFence._direction);
return(newFence);
};
FourWalledWorld.prototype.createNewFenceHead = function (iStartX, iStartY, iDirection, oFence) {
var newFenceHead = new FenceHead(iStartX, iStartY, iDirection, this, oFence);
this.addToGroup("_movingCircles", newFenceHead);
return(newFenceHead);
};
FourWalledWorld.prototype.addFenceToPost = function (oFence, oPost, iDirection) {
oPost.connectFence(oFence, iDirection);
oFence.addPost(oPost);
if ((oFence._state != "expanding") && (iDirection == 180)) {
oPost.showArm();
}
};
FourWalledWorld.prototype.createNewChicken = function (x, y, vx, vy, normalVel) {
this.addToGroup("_movingCircles", new Chicken(x, y, vx, vy, normalVel, this));
};
FourWalledWorld.prototype.createNewTestCircle = function (x, y, vx, vy) {
this.addToGroup("_movingCircles", new TestCircle(x, y, vx, vy, this));
};
FourWalledWorld.prototype.createNewRooster = function (x, y, vx, vy) {
this.addToGroup("_movingCircles", new Rooster(x, y, vx, vy, this));
};
FourWalledWorld.prototype.createNewDeeDee = function (x, y) {
return(new DeeDee(x, y, this));
};
FourWalledWorld.prototype.removeFromGroup = function (sGroup, oItem) {
var i = 0;
while (i < this[sGroup].length) {
if (this[sGroup][i] == oItem) {
this[sGroup].splice(i, 1);
break;
}
i++;
}
if (sGroup == "_movingCircles") {
if (this._movingCircles.length < 1) {
this._gameBoard.removeFromGroup("_activeBoxes", this);
}
}
};
FourWalledWorld.prototype.addToGroup = function (sGroup, oItem) {
var found = false;
var i = 0;
while (i < this[sGroup].length) {
if (this[sGroup][i] == oItem) {
found = true;
break;
}
i++;
}
if (!found) {
this[sGroup].push(oItem);
switch (sGroup) {
case "_movingCircles" :
case "_movingLines" :
return;
case "_staticCircles" :
insertByValue(this._xBoundsList, {obj:oItem, x:oItem._x}, "x");
insertByValue(this._yBoundsList, {obj:oItem, y:oItem._y}, "y");
return;
case "_staticLines" :
if (oItem._horizontal) {
this._horizontalLines.InsertByValue(oItem, "_y");
} else {
this._verticalLines.InsertByValue(oItem, "_x");
}
}
}
};
FourWalledWorld.prototype.update = function () {
var obj;
var i = 0;
while (i < this._movingCircles.length) {
obj = this._movingCircles[i];
obj._possibleCollisions = [];
obj.updateBoundingBox();
i++;
}
var colliders = [];
var subject;
var hasCollisions;
var colObject;
var target;
var i = 0;
while (i < this._movingCircles.length) {
subject = this._movingCircles[i];
hasCollisions = ((subject._possibleCollisions.length > 0) ? true : false);
var j = (i + 1);
while (j < this._movingCircles.length) {
target = this._movingCircles[j];
if (Geometry.boundsIntersect(subject.getBoundingBox(), target.getBoundingBox()) && ((colObject = target.checkForCollision(subject)))) {
hasCollisions = true;
subject._possibleCollisions.push({target:target, cVel:colObject.subjectVel, stepPortion:colObject.subjectVel.length() / subject._vel.length()});
target._possibleCollisions.push({target:subject, cVel:colObject.targetVel, stepPortion:colObject.targetVel.length() / target._vel.length()});
debug("*************************", "collision");
debug("******* Collision *******", "collision");
debug("*************************", "collision");
debug("* subject: " + subject, "collision");
debug("* x: " + subject._x, "collision");
debug("* y: " + subject._y, "collision");
debug((("* _vel: " + subject._vel) + ", l: ") + subject._vel.length(), "collision");
debug((("* cVel: " + colObject.subjectVel) + ", l: ") + colObject.subjectVel.length(), "collision");
debug("*", "collision");
debug("* target: " + target, "collision");
debug("* x: " + target._x, "collision");
debug("* y: " + target._y, "collision");
debug((("* _vel: " + target._vel) + ", l: ") + target._vel.length(), "collision");
debug((("* cVel: " + colObject.targetVel) + ", l: ") + colObject.targetVel.length(), "collision");
debug("*************************", "collision");
}
j++;
}
var ybetween = getNodesBetweenValues(this._yBoundsList, "y", subject._bounds.y1 - 4, subject._bounds.y2 + 4);
if (ybetween != false) {
var xbetween = getNodesBetweenValues(this._xBoundsList, "x", subject._bounds.x1 - 4, subject._bounds.x2 + 4);
if (xbetween != false) {
var allPossible = [];
var m = 0;
while (m < ybetween.length) {
var found = false;
var n = 0;
while (n < xbetween.length) {
if (ybetween[m].obj == xbetween[n].obj) {
found = true;
break;
}
n++;
}
if (found) {
allPossible.push(ybetween[m].obj);
}
m++;
}
if (allPossible.length > 0) {
var m = 0;
while (m < allPossible.length) {
target = allPossible[m];
if ((colObject = target.checkForCollision(subject))) {
hasCollisions = true;
subject._possibleCollisions.push({target:target, cVel:colObject.subjectVel, stepPortion:colObject.subjectVel.length() / subject._vel.length()});
target._possibleCollisions.push({target:subject, cVel:colObject.targetVel, stepPortion:colObject.targetVel.length() / target._vel.length()});
debug("*************************", "collision");
debug("******* Collision *******", "collision");
debug("*************************", "collision");
debug("* subject: " + subject, "collision");
debug("* x: " + subject._x, "collision");
debug("* y: " + subject._y, "collision");
debug((("* _vel: " + subject._vel) + ", l: ") + subject._vel.length(), "collision");
debug((("* cVel: " + colObject.subjectVel) + ", l: ") + colObject.subjectVel.length(), "collision");
debug("*", "collision");
debug("* target: " + target, "collision");
debug("* x: " + target._x, "collision");
debug("* y: " + target._y, "collision");
debug((("* _vel: " + target._vel) + ", l: ") + target._vel.length(), "collision");
debug((("* cVel: " + colObject.targetVel) + ", l: ") + colObject.targetVel.length(), "collision");
debug("*************************", "collision");
}
m++;
}
}
}
}
var lineAr = this._horizontalLines.getNodesBetweenValues("_y", subject._bounds.y1, subject._bounds.y2).concat(this._verticalLines.getNodesBetweenValues("_x", subject._bounds.x1, subject._bounds.x2));
var j = 0;
while (j < lineAr.length) {
var target = lineAr[j];
if ((colObject = target.checkForCollision(subject))) {
hasCollisions = true;
subject._possibleCollisions.push({target:target, cVel:colObject.subjectVel, stepPortion:colObject.subjectVel.length() / subject._vel.length()});
target._possibleCollisions.push({target:subject, cVel:colObject.targetVel, stepPortion:colObject.targetVel.length() / target._vel.length()});
debug("*************************", "collision");
debug("******* Collision *******", "collision");
debug("*************************", "collision");
debug("* subject: " + subject, "collision");
debug("* x: " + subject._x, "collision");
debug("* y: " + subject._y, "collision");
debug((("* _vel: " + subject._vel) + ", l: ") + subject._vel.length(), "collision");
debug((("* cVel: " + colObject.subjectVel) + ", l: ") + colObject.subjectVel.length(), "collision");
debug("*", "collision");
debug("* target: " + target, "collision");
debug("* x: " + target._x, "collision");
debug("* y: " + target._y, "collision");
debug((("* _vel: " + target._vel) + ", l: ") + target._vel.length(), "collision");
debug((("* cVel: " + colObject.targetVel) + ", l: ") + colObject.targetVel.length(), "collision");
debug("*************************", "collision");
}
j++;
}
if (hasCollisions) {
colliders.push(subject);
}
i++;
}
var i = 0;
while (i < colliders.length) {
colliders[i]._possibleCollisions.sort(collisionSort);
i++;
}
var subject;
var target;
var reflectObject;
var colAr = [];
var i = 0;
while (i < colliders.length) {
subject = colliders[i];
target = colliders[i]._possibleCollisions[0].target;
reflectObject = target.reflectCircle(subject);
if ((subject instanceof Chicken) || (subject instanceof Rooster)) {
colAr.unshift({subject:subject, cVel:colliders[i]._possibleCollisions[0].cVel, rVel:reflectObject.subjectVel, target:target, type:target._type});
} else {
colAr.push({subject:subject, cVel:colliders[i]._possibleCollisions[0].cVel, rVel:reflectObject.subjectVel, target:target, type:target._type});
}
i++;
}
var gameObj;
var i = 0;
while (i < colAr.length) {
gameObj = colAr[i].subject;
if ((!((gameObj instanceof FenceHead) && (colAr[i].target instanceof Animal))) && (!((gameObj instanceof Rooster) && (gameObj._isRunning == false)))) {
gameObj.updateVel(colAr[i].cVel);
}
i++;
}
var updatable = this._movingCircles.concat(this._staticLines);
var i = 0;
while (i < updatable.length) {
updatable[i].update();
i++;
}
var gameObj;
var i = 0;
while (i < colAr.length) {
gameObj = colAr[i].subject;
switch (gameObj._type) {
case "electricFence" :
if (!(colAr[i].target instanceof Animal)) {
gameObj.updateVel(colAr[i].rVel);
}
break;
case "rooster" :
if (gameObj._isRunning) {
gameObj.updateVel(colAr[i].rVel);
}
break;
default :
gameObj.updateVel(colAr[i].rVel);
}
gameObj.collision(colAr[i].type, colAr[i].target);
i++;
}
};
FourWalledWorld.prototype.chkForCircuit = function (firstPost, startingDirection) {
var targetFence = firstPost._connectedFences[(startingDirection + 180) % 360];
if ((startingDirection == 90) || (startingDirection == 180)) {
var originPost = targetFence._nodes.GetNodeByValue(firstPost).prev.val;
} else {
var originPost = targetFence._nodes.GetNodeByValue(firstPost).next.val;
}
var rotation = 90;
this.turnCounter = 0;
var test = this.findNextNode(firstPost, startingDirection, rotation, originPost);
if (test != false) {
this.createNewBox([targetFence, firstPost].concat(test));
}
rotation = -90;
this.turnCounter = 0;
test = this.findNextNode(firstPost, startingDirection, rotation, originPost);
if (test != false) {
this.createNewBox([targetFence, firstPost].concat(test));
}
};
FourWalledWorld.prototype.findNextNode = function (curPost, iDirection, iRotation, origin) {
if (curPost == origin) {
return(curPost);
}
var targetDirection = ((360 + (iDirection + iRotation)) % 360);
var targetFence = curPost._connectedFences[targetDirection];
if ((this.turnCounter < 4) && (targetFence != null)) {
this.turnCounter++;
var curNode = targetFence._nodes.GetNodeByValue(curPost);
var nextPost = (((targetDirection == 90) || (targetDirection == 180)) ? (curNode.next.val) : (curNode.prev.val));
if (nextPost == curPost) {
return(false);
}
var remainingPosts = this.findNextNode(nextPost, targetDirection, iRotation, origin);
if (remainingPosts == origin) {
return([targetFence, nextPost]);
}
if (remainingPosts != false) {
return([targetFence, nextPost].concat(remainingPosts));
}
this.turnCounter--;
}
targetDirection = iDirection;
var targetFence = curPost._connectedFences[targetDirection];
if (targetFence != null) {
var curNode = targetFence._nodes.GetNodeByValue(curPost);
var nextPost = (((targetDirection == 90) || (targetDirection == 180)) ? (curNode.next.val) : (curNode.prev.val));
if (nextPost == curPost) {
return(false);
}
var remainingPosts = this.findNextNode(nextPost, targetDirection, iRotation, origin);
if (remainingPosts != false) {
return([targetFence, nextPost].concat(remainingPosts));
}
}
return(false);
};
FourWalledWorld.prototype.addNewPostToFence = function (x, y, fence) {
var newPost = this.createNewPost(x, y, true);
newPost.connectFence(fence, fence._direction);
newPost.connectFence(fence, fence._counterDirection);
if (!fence._horizontal) {
if (fence._state == "expanding") {
fence._armNeedingPosts.push(newPost);
} else {
newPost.showArm();
}
}
fence.addPost(newPost);
};
FourWalledWorld.prototype.appendNewPost = function (x, y, fence, targetFence) {
var newPost = this.createNewPost(x, y, false);
this.addFenceToPost(fence, newPost, fence._counterDirection);
newPost.connectFence(targetFence, targetFence._counterDirection);
newPost.connectFence(targetFence, targetFence._direction);
targetFence.addPost(newPost);
return(newPost);
};
FourWalledWorld.prototype.createNewBox = function (nodeArray) {
var minX = 1000;
var minY = 1000;
var maxX = 0;
var maxY = 0;
var x;
var y;
var i = 0;
while (i < nodeArray.length) {
if (nodeArray[i] instanceof Fencepost) {
x = nodeArray[i]._x;
y = nodeArray[i]._y;
if (x < minX) {
minX = x;
}
if (y < minY) {
minY = y;
}
if (x > maxX) {
maxX = x;
}
if (y > maxY) {
maxY = y;
}
}
i++;
}
var newBox = {minX:minX, minY:minY, maxX:maxX, maxY:maxY, disabled:false};
var hasNestedBox = false;
if (!hasNestedBox) {
var boxArea = (((maxX - minX) * (maxY - minY)) / _root._gridSize);
if (boxArea <= _root.minBonusBoxArea) {
var chickensCaught = [];
var roostersCaught = [];
var i = 0;
while (i < this._movingCircles.length) {
var obj = this._movingCircles[i];
if ((((obj._x > minX) && (obj._x < maxX)) && (obj._y > minY)) && (obj._y < maxY)) {
if (obj instanceof Chicken) {
chickensCaught.push(obj);
} else if (obj instanceof Rooster) {
roostersCaught.push(obj);
}
}
i++;
}
if ((chickensCaught.length > 0) && (roostersCaught.length > 0)) {
} else if (chickensCaught.length > 0) {
newBox.disabled = true;
this._gameBoard.caughtChickens(chickensCaught, nodeArray, minX, minY, maxX, maxY, boxArea);
} else if (roostersCaught.length > 0) {
newBox.disabled = true;
this._gameBoard.caughtRoosters(roostersCaught, minX, minY, maxX, maxY);
}
}
}
this.addToGroup("_boxes", newBox);
};
FourWalledWorld.prototype.checkIfPointCollidesWithBounds = function (x, y) {
return((((x >= this._x1) && (x <= this._x2)) && (y >= this._y1)) && (y <= this._y2));
};
FourWalledWorld.prototype.checkIfPointIsWithinBounds = function (x, y) {
return((((x > this._x1) && (x < this._x2)) && (y > this._y1)) && (y < this._y2));
};
FourWalledWorld.prototype.toString = function () {
return(((((((((("FourWalledWorld(" + this._objectNum) + ") [") + this._x1) + ",") + this._y1) + ",") + this._x2) + ",") + this._y2) + "]");
};
_root.timerTotal = 0;
_root.timerIterations = 0;
GameBoard.prototype.initializeLevels = function () {
this._levelCounter = 0;
this._levelAr = [];
this._levelAr.push({chickenCount:1, roosterCount:0, chickensToCatch:1, chickenSpeed:5, DeeDee:false, subtext:"Catch the Chickens!"});
this._levelAr.push({chickenCount:2, roosterCount:0, chickensToCatch:1, chickenSpeed:5, DeeDee:false, subtext:"Don't Fry the Chickens!"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:5, DeeDee:false, subtext:"How Many Can You Catch?"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:5, DeeDee:false, subtext:"Watch the Timer!"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:3, chickenSpeed:5, DeeDee:false, subtext:"Good Cluck!"});
this._levelAr.push({chickenCount:2, roosterCount:1, chickensToCatch:1, chickenSpeed:5, DeeDee:false, subtext:"Enter the Rooster"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:2, chickenSpeed:5, DeeDee:false, subtext:"Fowl Play"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:3, chickenSpeed:5, DeeDee:false, subtext:"Shorter Fences Are Safer"});
this._levelAr.push({chickenCount:4, roosterCount:0, chickensToCatch:3, chickenSpeed:5, DeeDee:false, subtext:"Keep Going!"});
this._levelAr.push({chickenCount:1, roosterCount:0, chickensToCatch:1, chickenSpeed:7, DeeDee:false, subtext:"They're Speeding Up!"});
this._levelAr.push({chickenCount:2, roosterCount:0, chickensToCatch:1, chickenSpeed:7, DeeDee:false, subtext:"Count Your Chickens"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:7, DeeDee:false, subtext:"Double Up for Extra Points"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:7, DeeDee:false, subtext:"Wing It!"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:3, chickenSpeed:7, DeeDee:false, subtext:"Count Your Chickens"});
this._levelAr.push({chickenCount:2, roosterCount:1, chickensToCatch:1, chickenSpeed:7, DeeDee:false, subtext:"Egg-cellent Work!"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:2, chickenSpeed:7, DeeDee:false, subtext:"Catch 'Em All!"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:3, chickenSpeed:7, DeeDee:false, subtext:"Work Fast for Bonus Points"});
this._levelAr.push({chickenCount:4, roosterCount:0, chickensToCatch:3, chickenSpeed:7, DeeDee:false, subtext:"Mo' Chickens, Mo' Problems"});
this._levelAr.push({chickenCount:1, roosterCount:0, chickensToCatch:1, chickenSpeed:9, DeeDee:false, subtext:"They're Speeding Up!"});
this._levelAr.push({chickenCount:2, roosterCount:0, chickensToCatch:1, chickenSpeed:9, DeeDee:false, subtext:"Zapped!"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:9, DeeDee:false, subtext:"Break an Egg"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:9, DeeDee:false, subtext:"Feathered Friends"});
this._levelAr.push({chickenCount:4, roosterCount:0, chickensToCatch:4, chickenSpeed:9, DeeDee:false, subtext:"Funny Farm"});
this._levelAr.push({chickenCount:2, roosterCount:1, chickensToCatch:1, chickenSpeed:9, DeeDee:false, subtext:"Bye-Bye, Birdie"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:2, chickenSpeed:9, DeeDee:false, subtext:"Poultry Problems"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:3, chickenSpeed:9, DeeDee:false, subtext:"Kickin' Chicken!"});
this._levelAr.push({chickenCount:4, roosterCount:0, chickensToCatch:4, chickenSpeed:9, DeeDee:false, subtext:"Rock Around the Cluck"});
this._levelAr.push({chickenCount:1, roosterCount:0, chickensToCatch:1, chickenSpeed:10, DeeDee:false, subtext:"They're Speeding Up!"});
this._levelAr.push({chickenCount:2, roosterCount:0, chickensToCatch:1, chickenSpeed:10, DeeDee:false, subtext:"You're Doing Great!"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:10, DeeDee:false, subtext:"Don't Let the Day Get Away"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:10, DeeDee:false, subtext:"Hatch a Plan"});
this._levelAr.push({chickenCount:4, roosterCount:0, chickensToCatch:4, chickenSpeed:10, DeeDee:false, subtext:"Finger Lickin' Good"});
this._levelAr.push({chickenCount:2, roosterCount:1, chickensToCatch:1, chickenSpeed:10, DeeDee:false, subtext:"Deep Trouble, Deep Fried"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:2, chickenSpeed:10, DeeDee:false, subtext:"Clone Omelet"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:3, chickenSpeed:10, DeeDee:false, subtext:"Drumstick It to 'Em!"});
this._levelAr.push({chickenCount:4, roosterCount:0, chickensToCatch:4, chickenSpeed:10, DeeDee:false, subtext:"A Fine Day for Science"});
this._levelAr.push({chickenCount:1, roosterCount:0, chickensToCatch:1, chickenSpeed:11, DeeDee:false, subtext:"They're Speeding Up!"});
this._levelAr.push({chickenCount:2, roosterCount:0, chickensToCatch:1, chickenSpeed:11, DeeDee:false, subtext:"It's Getting Egg-Citing!"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:11, DeeDee:false, subtext:"Attack of the Clones"});
this._levelAr.push({chickenCount:3, roosterCount:0, chickensToCatch:2, chickenSpeed:11, DeeDee:false, subtext:"A Clone of Your Own"});
this._levelAr.push({chickenCount:4, roosterCount:0, chickensToCatch:4, chickenSpeed:11, DeeDee:false, subtext:"Don't Be Chicken!"});
this._levelAr.push({chickenCount:2, roosterCount:1, chickensToCatch:1, chickenSpeed:11, DeeDee:false, subtext:"Chicken-riffic!"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:2, chickenSpeed:11, DeeDee:false, subtext:"Seeing Triple"});
this._levelAr.push({chickenCount:3, roosterCount:1, chickensToCatch:3, chickenSpeed:11, DeeDee:false, subtext:"Keep Going!"});
this._levelAr.push({chickenCount:4, roosterCount:1, chickensToCatch:4, chickenSpeed:11, DeeDee:false, subtext:"You're a Genius!"});
};
GameBoard.prototype.startLevel = function () {
var i = 0;
while (i < this._mainBox._movingCircles.length) {
this._mainBox._movingCircles[i].startup();
i++;
}
if (this._hasDeeDee) {
this._deedee.startup();
}
this._scoreBoard.resetTimer();
myMouseController.start();
mySoundModule.playSound("bgLoop");
myEngine.start();
};
GameBoard.prototype.loadNextLevel = function () {
this.loadLevel(this._levelAr.shift(), ++this._levelCounter);
};
GameBoard.prototype.loadLevel = function (levelObject, iLevelNum) {
if (iLevelNum == 1) {
loadMovieNum ((_root.trackerPath + "?id=") + new Date().valueOf(), 5);
}
this._startupChain = new InstructionChain();
this._zSortList = new LinkedList();
var x1 = snapToGrid(10);
var y1 = snapToGrid(30);
var x2 = snapToGrid(290);
var y2 = snapToGrid(323);
this._mainBox = new FourWalledWorld(this, this, x1, y1, x2, y2);
var p1 = this._mainBox.createNewPost(x1, y1, false);
var p2 = this._mainBox.createNewPost(x2, y1, false);
var p3 = this._mainBox.createNewPost(x2, y2, false);
var p4 = this._mainBox.createNewPost(x1, y2, false);
var f1 = this._mainBox.createNewFence(x1, y1, 90, p1, "static", x2, y1);
var f2 = this._mainBox.createNewFence(x2, y1, 180, p2, "static", x2, y2);
var f3 = this._mainBox.createNewFence(x2, y2, 270, p3, "static", x1, y2);
var f4 = this._mainBox.createNewFence(x1, y2, 0, p4, "static", x1, y1);
this._mainBox.addFenceToPost(f1, p2, f1._counterDirection);
this._mainBox.addFenceToPost(f2, p3, f2._counterDirection);
this._mainBox.addFenceToPost(f3, p4, f3._counterDirection);
this._mainBox.addFenceToPost(f4, p1, f4._counterDirection);
p1.skipAnimation();
p2.skipAnimation();
p3.skipAnimation();
p4.skipAnimation();
this._activeBoxes = [this._mainBox];
var ix1 = (x1 + 15);
var iy1 = (y1 + 15);
var ix2 = (x2 - 15);
var iy2 = (y2 - 15);
var w = (ix2 - ix1);
var h = (iy2 - iy1);
var startingX = [];
var startingY = [];
var i = 0;
while (i <= 15) {
startingX.push(ix1 + (15 * i));
i++;
}
var i = 0;
while (i <= 16) {
startingY.push(iy1 + (15 * i));
i++;
}
var startX;
var startY;
var i = 0;
while (i < levelObject.chickenCount) {
var randomDir = random(360);
var dRad = ((randomDir + 270) * (Math.PI/180));
var vel = new Vect(new Angle(dRad), levelObject.chickenSpeed);
var randomI = random(startingX.length);
startX = startingX[randomI];
startingX.splice(randomI, 1);
randomI = random(startingY.length);
startY = startingY[randomI];
startingY.splice(randomI, 1);
this._mainBox.createNewChicken(startX, startY, vel.getX(), vel.getY(), levelObject.chickenSpeed);
i++;
}
var i = 0;
while (i < levelObject.roosterCount) {
var randomDir = random(360);
var dRad = ((randomDir + 270) * (Math.PI/180));
var vel = new Vect(new Angle(dRad), 10);
var randomI = random(startingX.length);
startX = startingX[randomI];
startingX.splice(randomI, 1);
randomI = random(startingY.length);
startY = startingY[randomI];
startingY.splice(randomI, 1);
this._mainBox.createNewRooster(startX, startY, vel.getX(), vel.getY());
i++;
}
this._scoreBoard.updateLevel(iLevelNum);
this._scoreBoard.updateScore(0);
this._scoreBoard.resetChickensToCatch(levelObject.chickensToCatch);
this._scoreBoard.resetTotalChickens(levelObject.chickenCount);
this._startupChain.addCommand(new CommandObject(this, "showLevelSign", [iLevelNum, levelObject.subtext], true));
var i = 0;
while (i < levelObject.chickenCount) {
this._startupChain.addCommand(new CommandObject(this, "dropChickens", [i], true));
i++;
}
this._startupChain.addCommand(new CommandObject(this, "startLevel", null, false));
};
GameBoard.prototype.showLevelSign = function (iLevelNum, sSubtext) {
_root.overlayMC.gotoAndPlay("show");
_root.overlayMC.levelCardMC.levelField.text = "LEVEL " + iLevelNum;
_root.overlayMC.levelCardMC.subtextField.text = sSubtext;
};
GameBoard.prototype.dropChickens = function (index) {
this.dropChickens_Complete = false;
mySoundModule.playSound("chickenLand");
this._mainBox._movingCircles[index]._mc.gotoAndStop("dropIn");
};
GameBoard.prototype.caughtChickens = function (animalsCaughtAr, nodeArray, minX, minY, maxX, maxY, boxArea) {
mySoundModule.playSound("bonusSound");
new BonusFloor(minX, minY, maxX, maxY, this);
var i = 0;
while (i < nodeArray.length) {
if (nodeArray[i] instanceof Fencepost) {
nodeArray[i].showBonus(minX, minY, maxX);
} else {
if (i == 0) {
var startPost = nodeArray[nodeArray.length - 1];
var endPost = nodeArray[1];
} else if (i == (nodeArray.length - 1)) {
var startPost = nodeArray[i - 1];
var endPost = nodeArray[0];
} else {
var startPost = nodeArray[i - 1];
var endPost = nodeArray[i + 1];
}
if ((startPost._x < endPost._x) || (startPost._y < endPost._y)) {
var x1 = startPost._x;
var y1 = startPost._y;
var x2 = endPost._x;
var y2 = endPost._y;
} else {
var x1 = endPost._x;
var y1 = endPost._y;
var x2 = startPost._x;
var y2 = startPost._y;
}
nodeArray[i].showBonus(x1, y1, x2, y2);
}
i++;
}
var boxCenterX = (minX + ((maxX - minX) / 2));
var boxCenterY = (minY + ((maxY - minY) / 2));
var points = (100 + (_root.minBonusBoxArea - boxArea));
this.showBonusPoints(boxCenterX, boxCenterY, points);
var extraPoints;
switch (animalsCaughtAr.length) {
case 1 :
extraPoints = 150;
break;
case 2 :
extraPoints = 500;
break;
case 3 :
extraPoints = 1000;
break;
case 4 :
extraPoints = 2500;
break;
default :
extraPoints = 2500;
}
var i = 0;
while (i < animalsCaughtAr.length) {
animalsCaughtAr[i].relax(boxCenterX, extraPoints);
i++;
}
this._scoreBoard.updateScore(points + (extraPoints * animalsCaughtAr.length));
this._scoreBoard.catchChicken(animalsCaughtAr.length);
};
GameBoard.prototype.caughtRoosters = function (animalsCaughtAr, minX, minY, maxX, maxY) {
new BonusFloor(minX, minY, maxX, maxY, this);
var i = 0;
while (i < animalsCaughtAr.length) {
animalsCaughtAr[i].relax(boxCenterX);
i++;
}
};
GameBoard.prototype.showBonusPoints = function (x, y, points) {
var bonusPointsX = new BonusPoints(x, y, points, this);
};
GameBoard.prototype.endLevel = function (sOutcome) {
if ((this._levelAr.length == 0) && (sOutcome == "inBetween")) {
sOutcome = "win";
}
this._outcome = sOutcome;
myMouseController.removeAllListeners("onMouseDown");
myMouseController.removeAllListeners("onMouseUp");
myMouseController.removeAllListeners("onMouseMove");
myMouseController.stop();
myEngine.stop();
this._scoreBoard.stopTimer();
_root.overlayMC.gotoAndPlay("hide");
mySoundModule.stopSound("bgLoop");
if (sOutcome == "lose") {
mySoundModule.playSound("levelLose");
} else {
mySoundModule.playSound("levelClear");
}
var gameObj;
var i = 0;
while (i < this._mainBox._movingCircles.length) {
gameObj = this._mainBox._movingCircles[i];
if (gameObj instanceof Rooster) {
gameObj._mc.gotoAndStop("peckRight");
clearInterval(gameObj._toggleInterval);
} else if (gameObj instanceof Chicken) {
clearInterval(gameObj._runInterval);
}
i++;
}
};
GameBoard.prototype.cleanUp = function () {
myMouseController.removeAllListeners("onMouseDown");
myMouseController.removeAllListeners("onMouseUp");
myMouseController.removeAllListeners("onMouseMove");
var anything;
for (anything in _root) {
if (_root[anything] instanceof movieclip) {
if ((anything != "overlayMC") && (anything != "soundMC")) {
_root[anything].removeMovieClip();
}
}
}
delete this._mainBox;
delete this._activeBoxes;
this._zSortList = null;
GameObject.count = 0;
Animal.numCreated = 0;
ArrowPointer.numCreated = 0;
BonusBox.numCreated = 0;
BonusPoints.numCreated = 0;
BonusFloor.numCreated = 0;
Chicken.numCreated = 0;
DeeDee.numCreated = 0;
Fence.numCreated = 0;
FenceHead.numCreated = 0;
Fencepost.numCreated = 0;
FencepostTop.numCreated = 0;
FourWalledWorld.numCreated = 0;
QuadTree.numCreated = 0;
Rooster.numCreated = 0;
TestCircle.numCreated = 0;
xGraphic.numCreated = 0;
_root.gotoAndStop(this._outcome, 1);
if (this._outcome == "lose") {
this._scoreBoard._curTime = this._scoreBoard._timerFrames;
}
this._scoreBoard.updateScorePanel();
if (this._outcome != "inBetween") {
this.initializeLevels();
this._scoreBoard.resetScore();
}
};
_root.frame = 0;
GameBoard.prototype.update = function () {
_root.frame++;
this._mainBox.update();
};
GameBoard.prototype.unclaimedPressEvent = function (x, y) {
if (this._mainBox.checkIfPointCollidesWithBounds(x, y)) {
this._mainBox.createNewPost(x, y, true);
}
};
GameBoard.prototype.createNewXGraphic = function (x, y) {
var newX = new xGraphic(x, y, this);
newX.display();
};
GameBoard.prototype.removeFromGroup = function (sGroup, oItem) {
var i = 0;
while (i < this[sGroup].length) {
if (this[sGroup][i] == oItem) {
this[sGroup].splice(i, 1);
return;
}
i++;
}
};
GameBoard.prototype.addToGroup = function (sGroup, oItem) {
var found = false;
var i = 0;
while (i < this[sGroup].length) {
if (this[sGroup][i] == oItem) {
found = true;
break;
}
i++;
}
if (!found) {
this[sGroup].push(oItem);
}
};
GameBoard.prototype.scoreEvent = function (sType, pts) {
switch (sType) {
case "killChicken" :
this._scoreBoard.updateScore(_root.killChickenPoints);
this._scoreBoard.killChicken();
return;
case "killRooster" :
this._scoreBoard.updateScore(_root.killChickenPoints);
}
};
GameBoard.prototype.addToZSortList = function (gameObj) {
var insertPoint;
var newNode;
var firstNodeAfter;
var cur = this._zSortList.listHead;
if (!gameObj.isAbove(cur.val)) {
insertPoint = cur;
newNode = this._zSortList.InsertBefore(gameObj, insertPoint);
firstNodeAfter = insertPoint;
} else {
do {
insertPoint = cur;
cur = cur.next;
} while ((cur != this._zSortList.listHead) && (gameObj.isAbove(cur.val)));
firstNodeAfter = insertPoint.next;
newNode = this._zSortList.InsertAfter(gameObj, insertPoint);
}
if (firstNodeAfter == null) {
var depth = 8000;
} else if (firstNodeAfter != this._zSortList.listHead) {
var depth = firstNodeAfter.val._depth;
cur = this._zSortList.listHead.prev;
do {
cur.val.changeDepth(cur.val._depth + 1);
cur = cur.prev;
} while (cur.val != gameObj);
} else {
var depth = (this._zSortList.listHead.prev.prev.val._depth + 1);
}
gameObj._zNode = newNode;
return(depth);
};
GameBoard.prototype.checkForZMoveUp = function (gameObj) {
var cur = gameObj._zNode.next;
var insertPoint;
var temp;
while (gameObj.isAbove(cur.val) && (cur != this._zSortList.listHead)) {
gameObj._mc.swapDepths(cur.val._mc);
temp = gameObj._depth;
gameObj._depth = cur.val._depth;
cur.val._depth = temp;
insertPoint = cur;
cur = cur.next;
}
if (insertPoint != null) {
this._zSortList.Remove(gameObj._zNode);
gameObj._zNode = this._zSortList.InsertAfter(gameObj, insertPoint);
}
};
GameBoard.prototype.checkForZMoveDown = function (gameObj) {
var cur = gameObj._zNode.prev;
var insertPoint;
var temp;
while ((!gameObj.isAbove(cur.val)) && (cur != this._zSortList.listHead.prev)) {
gameObj._mc.swapDepths(cur.val._mc);
temp = gameObj._depth;
gameObj._depth = cur.val._depth;
cur.val._depth = temp;
insertPoint = cur;
cur = cur.prev;
}
if (insertPoint != null) {
this._zSortList.Remove(gameObj._zNode);
gameObj._zNode = this._zSortList.InsertBefore(gameObj, insertPoint);
}
};
xGraphic.prototype = new GameObject();
xGraphic.numCreated = 0;
xGraphic.prototype.display = function () {
this._mc.gotoAndPlay("blink");
};
SoundModule.prototype.playSound = function (sSnd, iVol, iPan) {
if (v != null) {
this[sSnd].setVolume(iVol);
}
if (p != null) {
this[sSnd].setPan(iPan);
}
this._mc[sSnd + "MC"].gotoAndPlay("sound");
};
SoundModule.prototype.stopSound = function (sSnd) {
this._mc[sSnd + "MC"].gotoAndPlay("soundOff");
};
SoundModule.prototype.playTimedSound = function (sSnd, iVol, iPan) {
if (this[sSnd].isReady) {
if (v != null) {
this[sSnd].setVolume(iVol);
}
if (p != null) {
this[sSnd].setPan(iPan);
}
this._mc[sSnd + "MC"].gotoAndPlay("sound");
}
};
_root._gridSize = 10;
_root.fenceHeight = 10;
_root.minBonusBoxArea = 1000;
_root.killChickenPoints = -500;
_root._zeroVel = new Vect(0, 0);
_root.bonusFloorDepth = 1000;
_root.fenceShadowDepth = 1500;
_root.fencepostDepth = 5000;
_root.verticalFenceDepth = 6000;
_root.fencepostTopDepth = 7000;
_root.animalDepth = 8000;
_root.electricFenceDepth = 10000;
_root.arrowDepth = 12000;
_root.xGraphicDepth = 13000;
_root.bonusPointsDepth = 14000;
_root.Negative500Depth = 14500;
displayBoxHierarchy = function (box, tabs) {
debug(tabs + box, "displayBox");
var obj;
var i = 0;
while (i < box._staticCircles.length) {
obj = box._staticCircles[i];
debug((tabs + "-") + obj, "displayBox");
i++;
}
var i = 0;
while (i < box._staticLines.length) {
obj = box._staticLines[i];
debug((tabs + "-") + obj, "displayBox");
i++;
}
var i = 0;
while (i < box._movingCircles.length) {
obj = box._movingCircles[i];
debug((tabs + "-") + obj, "displayBox");
i++;
}
tabs = tabs + " ";
var i = 0;
while (i < box._boxes.length) {
displayBoxHierarchy(box._boxes[i], tabs);
i++;
}
};
_global.snapToGrid = function (val) {
return(Math.round(val / _root._gridSize) * _root._gridSize);
};
_global.debug = function (msg, type) {
if (type == "collision") {
if (_root.frame != this.lastFrame) {
}
this.lastFrame = _root.frame;
}
};
_global.mySoundModule = new SoundModule(_root.soundMC);
_global.myMouseController = new MouseController();
_global.myEngine = new FrameBasedEngine("update");
myGameBoard = new GameBoard();
Instance of Symbol 356 MovieClip "frame rate checker" in Frame 219 (276 B)
onClipEvent (load) {
offset = getTimer();
elapsed = 0;
}
onClipEvent (enterFrame) {
fr = Math.ceil((++elapsed) / ((getTimer() - offset) / 1000));
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
elapsed = 0;
offset = getTimer();
}
}
Frame 220 (44 B)
stop();
_root.myGameBoard.loadNextLevel();
Frame 224 (8 B)
stop();
Instance of Symbol 145 MovieClip in Frame 224 (403 B)
onClipEvent (load) {
this.doAction = function () {
_root.overlayMC.gotoAndPlay("wipe");
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Frame 225 (8 B)
stop();
Instance of Symbol 532 MovieClip in Frame 225 (403 B)
onClipEvent (load) {
this.doAction = function () {
_root.overlayMC.gotoAndPlay("wipe");
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Instance of Symbol 532 MovieClip in Frame 226 (403 B)
onClipEvent (load) {
this.doAction = function () {
_root.overlayMC.gotoAndPlay("wipe");
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Instance of Symbol 550 MovieClip in Frame 226 (42 B)
onClipEvent (load) {
_visible = false;
}
Symbol 8 Button (55 B)
on (release) {
_root.gotoAndPlay("instructions", 1);
}
Symbol 4 MovieClip [TestCircle mc] Frame 1 (8 B)
stop();
Symbol 4 MovieClip [TestCircle mc] Frame 28 (8 B)
stop();
Instance of Symbol 13 MovieClip in Symbol 14 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this.gotoAndPlay(255);
}
Symbol 119 MovieClip Frame 1 (8 B)
stop();
Symbol 121 Button (30 B)
on (release) {
nextFrame();
}
Symbol 145 MovieClip Frame 1 (8 B)
stop();
Symbol 181 MovieClip Frame 1 (8 B)
play();
Symbol 181 MovieClip Frame 11 (17 B)
gotoAndPlay (1);
Symbol 220 MovieClip Frame 1 (8 B)
stop();
Symbol 221 MovieClip Frame 1 (8 B)
stop();
Symbol 221 MovieClip Frame 2 (8 B)
play();
Symbol 244 MovieClip Frame 1 (8 B)
play();
Symbol 244 MovieClip Frame 25 (8 B)
stop();
Symbol 248 MovieClip [scoreBoardChicken] Frame 1 (8 B)
stop();
Symbol 248 MovieClip [scoreBoardChicken] Frame 26 (8 B)
stop();
Symbol 261 MovieClip Frame 1 (8 B)
stop();
Symbol 261 MovieClip Frame 90 (8 B)
stop();
Symbol 272 MovieClip Frame 241 (17 B)
gotoAndPlay (2);
Symbol 272 MovieClip Frame 467 (19 B)
gotoAndPlay (242);
Symbol 272 MovieClip Frame 545 (180 B)
bonusScoreC.thousands.gotoAndStop(1);
bonusScoreC.hundreds.gotoAndStop(4);
bonusScoreC.tens.gotoAndStop(10);
bonusScoreC.ones.gotoAndStop(10);
bonusScoreC.gotoAndPlay("show");
Symbol 272 MovieClip Frame 570 (361 B)
bonusScoreA.thousands.gotoAndStop(11);
bonusScoreA.hundreds.gotoAndStop(2);
bonusScoreA.tens.gotoAndStop(5);
bonusScoreA.ones.gotoAndStop(10);
bonusScoreA.gotoAndPlay("show");
bonusScoreB.thousands.gotoAndStop(11);
bonusScoreB.hundreds.gotoAndStop(2);
bonusScoreB.tens.gotoAndStop(5);
bonusScoreB.ones.gotoAndStop(10);
bonusScoreB.gotoAndPlay("show");
Symbol 272 MovieClip Frame 636 (19 B)
gotoAndPlay (468);
Symbol 272 MovieClip Frame 650 (8 B)
stop();
Symbol 278 MovieClip Frame 1 (8 B)
stop();
Symbol 286 MovieClip Frame 1 (8 B)
stop();
Symbol 287 MovieClip Frame 1 (8 B)
play();
Symbol 287 MovieClip Frame 20 (36 B)
demo.gotoAndPlay("demo1");
stop();
Instance of Symbol 145 MovieClip "egg2" in Symbol 287 MovieClip Frame 20 (387 B)
onClipEvent (load) {
this.doAction = function () {
_parent.nextFrame();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Instance of Symbol 278 MovieClip "egg3" in Symbol 287 MovieClip Frame 20 (387 B)
onClipEvent (load) {
this.doAction = function () {
_parent.prevFrame();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Symbol 287 MovieClip Frame 21 (36 B)
demo.gotoAndPlay("demo2");
stop();
Instance of Symbol 145 MovieClip "egg4" in Symbol 287 MovieClip Frame 21 (387 B)
onClipEvent (load) {
this.doAction = function () {
_parent.nextFrame();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Instance of Symbol 278 MovieClip "egg5" in Symbol 287 MovieClip Frame 21 (387 B)
onClipEvent (load) {
this.doAction = function () {
_parent.prevFrame();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Symbol 287 MovieClip Frame 22 (36 B)
demo.gotoAndPlay("demo3");
stop();
Instance of Symbol 145 MovieClip "egg6" in Symbol 287 MovieClip Frame 22 (382 B)
onClipEvent (load) {
this.doAction = function () {
_parent.play();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Instance of Symbol 278 MovieClip "egg7" in Symbol 287 MovieClip Frame 22 (387 B)
onClipEvent (load) {
this.doAction = function () {
_parent.prevFrame();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Symbol 287 MovieClip Frame 23 (36 B)
demo.gotoAndPlay("demo4");
stop();
Instance of Symbol 286 MovieClip "egg8" in Symbol 287 MovieClip Frame 23 (382 B)
onClipEvent (load) {
this.doAction = function () {
_parent.play();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Instance of Symbol 278 MovieClip "egg9" in Symbol 287 MovieClip Frame 23 (387 B)
onClipEvent (load) {
this.doAction = function () {
_parent.prevFrame();
};
this.useHandCursor = true;
this.onRollOver = function () {
if (this.down != true) {
this.gotoAndStop(2);
}
};
this.onRollOut = function () {
if (this.down != true) {
this.gotoAndStop(1);
}
};
this.onPress = function () {
this.gotoAndStop(3);
this.down = true;
this.doAction();
};
}
Symbol 287 MovieClip Frame 24 (14 B)
_root.play();
Symbol 287 MovieClip Frame 39 (50 B)
stop();
_root.myGameBoard._startupChain.start();
Symbol 292 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 292 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 292 MovieClip Frame 17 (25 B)
isReady = true;
stop();
Symbol 294 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 294 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 294 MovieClip Frame 17 (25 B)
isReady = true;
stop();
Symbol 296 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 296 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 296 MovieClip Frame 17 (25 B)
isReady = true;
stop();
Symbol 299 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 299 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 299 MovieClip Frame 17 (25 B)
isReady = true;
stop();
Symbol 302 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 302 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 302 MovieClip Frame 17 (25 B)
isReady = true;
stop();
Symbol 304 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 304 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 304 MovieClip Frame 17 (25 B)
isReady = true;
stop();
Symbol 307 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 307 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 307 MovieClip Frame 17 (25 B)
isReady = true;
stop();
Symbol 310 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 310 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 310 MovieClip Frame 392 (25 B)
isReady = true;
stop();
Symbol 313 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 313 MovieClip Frame 10 (26 B)
isReady = false;
play();
Symbol 313 MovieClip Frame 221 (25 B)
isReady = true;
stop();
Symbol 315 MovieClip Frame 2 (25 B)
stop();
isReady = true;
Symbol 315 MovieClip Frame 10 (17 B)
isReady = false;
Symbol 315 MovieClip Frame 53 (25 B)
isReady = true;
stop();
Symbol 316 MovieClip Frame 1 (8 B)
stop();
Symbol 321 MovieClip Frame 26 (8 B)
stop();
Symbol 323 MovieClip Frame 1 (8 B)
stop();
Symbol 323 MovieClip Frame 2 (59 B)
play();
_root.myGameBoard.showLevelSign_Complete = false;
Symbol 323 MovieClip Frame 49 (58 B)
stop();
_root.myGameBoard.showLevelSign_Complete = true;
Symbol 323 MovieClip Frame 55 (8 B)
play();
Symbol 323 MovieClip Frame 101 (29 B)
_root.myGameBoard.cleanUp();
Symbol 323 MovieClip Frame 106 (8 B)
stop();
Symbol 323 MovieClip Frame 110 (8 B)
play();
Symbol 323 MovieClip Frame 118 (28 B)
_root.gotoAndStop("game2");
Symbol 323 MovieClip Frame 123 (50 B)
stop();
_root.myGameBoard._startupChain.start();
Symbol 351 MovieClip Frame 19 (17 B)
gotoAndPlay (1);
Symbol 351 MovieClip Frame 23 (17 B)
gotoAndPlay (1);
Symbol 351 MovieClip Frame 45 (17 B)
gotoAndPlay (1);
Symbol 351 MovieClip Frame 66 (17 B)
gotoAndPlay (1);
Symbol 351 MovieClip Frame 104 (18 B)
gotoAndPlay (67);
Symbol 351 MovieClip Frame 125 (17 B)
gotoAndPlay (1);
Symbol 404 MovieClip Frame 17 (8 B)
stop();
Symbol 405 MovieClip [rooster mc] Frame 1 (8 B)
stop();
Symbol 405 MovieClip [rooster mc] Frame 68 (8 B)
stop();
Symbol 405 MovieClip [rooster mc] Frame 248 (8 B)
stop();
Symbol 405 MovieClip [rooster mc] Frame 338 (8 B)
stop();
Symbol 407 MovieClip [xGraphic] Frame 1 (8 B)
stop();
Symbol 407 MovieClip [xGraphic] Frame 2 (8 B)
play();
Symbol 417 MovieClip Frame 3 (8 B)
stop();
Symbol 417 MovieClip Frame 4 (8 B)
play();
Symbol 417 MovieClip Frame 11 (8 B)
stop();
Symbol 418 MovieClip [solidSegmentMC] Frame 1 (8 B)
stop();
Symbol 420 MovieClip Frame 7 (8 B)
stop();
Symbol 420 MovieClip Frame 8 (8 B)
stop();
Symbol 420 MovieClip Frame 9 (8 B)
play();
Symbol 420 MovieClip Frame 16 (8 B)
stop();
Symbol 426 MovieClip Frame 7 (8 B)
stop();
Symbol 427 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 425 MovieClip in Symbol 428 MovieClip [fencepost mc] Frame 1 (42 B)
onClipEvent (load) {
_visible = false;
}
Symbol 429 MovieClip [fence mc] Frame 1 (8 B)
stop();
Symbol 430 MovieClip [electricSegmentMC] Frame 1 (24 B)
stop();
loopMC.play();
Symbol 463 MovieClip [dee dee] Frame 10 (17 B)
gotoAndPlay (1);
Symbol 463 MovieClip [dee dee] Frame 28 (17 B)
gotoAndPlay (1);
Symbol 463 MovieClip [dee dee] Frame 34 (17 B)
gotoAndPlay (1);
Symbol 463 MovieClip [dee dee] Frame 41 (17 B)
gotoAndPlay (1);
Symbol 463 MovieClip [dee dee] Frame 47 (17 B)
gotoAndPlay (1);
Symbol 472 MovieClip Frame 1 (8 B)
play();
Symbol 472 MovieClip Frame 22 (518 B)
var pointArray = _parent.bonusPoints.toString().split("");
while (pointArray.length < 4) {
pointArray.push(11);
pointsMC._x = pointsMC._x + 44;
}
var i = 0;
while (i < pointArray.length) {
pointArray[i] = int(pointArray[i]);
if (pointArray[i] == 0) {
pointArray[i] = 10;
}
i++;
}
pointsMC.ones.gotoAndStop(pointArray[3]);
pointsMC.tens.gotoAndStop(pointArray[2]);
pointsMC.hundreds.gotoAndStop(pointArray[1]);
pointsMC.thousands.gotoAndStop(pointArray[0]);
pointsMC.gotoAndPlay("show");
Symbol 472 MovieClip Frame 56 (18 B)
gotoAndPlay (50);
Symbol 475 MovieClip Frame 1 (8 B)
play();
Symbol 475 MovieClip Frame 22 (518 B)
var pointArray = _parent.bonusPoints.toString().split("");
while (pointArray.length < 4) {
pointArray.push(11);
pointsMC._x = pointsMC._x - 44;
}
var i = 0;
while (i < pointArray.length) {
pointArray[i] = int(pointArray[i]);
if (pointArray[i] == 0) {
pointArray[i] = 10;
}
i++;
}
pointsMC.ones.gotoAndStop(pointArray[3]);
pointsMC.tens.gotoAndStop(pointArray[2]);
pointsMC.hundreds.gotoAndStop(pointArray[1]);
pointsMC.thousands.gotoAndStop(pointArray[0]);
pointsMC.gotoAndPlay("show");
Symbol 475 MovieClip Frame 56 (18 B)
gotoAndPlay (50);
Symbol 476 MovieClip Frame 17 (8 B)
stop();
Symbol 478 MovieClip Frame 20 (57 B)
stop();
_root.myGameBoard.dropChickens_Complete = true;
Symbol 479 MovieClip [chicken mc] Frame 1 (8 B)
stop();
Symbol 479 MovieClip [chicken mc] Frame 68 (8 B)
stop();
Symbol 479 MovieClip [chicken mc] Frame 248 (8 B)
stop();
Symbol 479 MovieClip [chicken mc] Frame 338 (8 B)
stop();
Symbol 482 MovieClip [bonusPoints] Frame 1 (8 B)
stop();
Symbol 482 MovieClip [bonusPoints] Frame 2 (8 B)
play();
Symbol 482 MovieClip [bonusPoints] Frame 28 (8 B)
stop();
Symbol 483 MovieClip Frame 1 (39 B)
mySoundModule.playSound("arrowPoint");
Symbol 483 MovieClip Frame 7 (8 B)
stop();
Symbol 484 MovieClip Frame 1 (39 B)
mySoundModule.playSound("arrowPoint");
Symbol 484 MovieClip Frame 7 (8 B)
stop();
Symbol 488 MovieClip Frame 1 (39 B)
mySoundModule.playSound("arrowPoint");
Symbol 488 MovieClip Frame 7 (8 B)
stop();
Symbol 489 MovieClip [arrowPointer mc] Frame 1 (8 B)
stop();
Symbol 490 MovieClip [solidSegmentMC2] Frame 1 (8 B)
stop();
Symbol 494 MovieClip [negative500] Frame 1 (8 B)
stop();
Symbol 494 MovieClip [negative500] Frame 2 (8 B)
play();
Symbol 525 MovieClip Frame 1 (8 B)
play();
Symbol 525 MovieClip Frame 30 (17 B)
gotoAndPlay (1);
Symbol 532 MovieClip Frame 1 (8 B)
stop();
Symbol 550 MovieClip Frame 1 (8 B)
stop();