Frame 1
stop();
_root.WPI_ArcadeStartSingleGame = function () {
trace("WPI_ArcadeStartSingleGame called - the current game has started");
};
_root.WPI_ArcadeStopSingleGame = function (score) {
trace("WPI_ArcadeStopSingleGame called - the current game has finished with score: " + score);
};
Frame 2
gameFrame.menuPlayedOnce = false;
stop();
Symbol 39 MovieClip Frame 1
stop();
Symbol 39 MovieClip Frame 2
stop();
Symbol 40 MovieClip [Wigbeast] Frame 1
stop();
Symbol 40 MovieClip [Wigbeast] Frame 2
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 2
stop();
Symbol 51 MovieClip [Wigfoot] Frame 1
stop();
Symbol 51 MovieClip [Wigfoot] Frame 2
stop();
Symbol 70 MovieClip Frame 8
stop();
Symbol 82 MovieClip Frame 20
_parent._parent._parent._parent.kill(_parent._parent._parent._parent.Bushy, true);
stop();
Symbol 87 MovieClip Frame 4
stop();
Symbol 100 MovieClip Frame 15
_parent._parent._parent._parent.kill(_parent._parent._parent._parent.Bushy, true);
stop();
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 2
stop();
Symbol 101 MovieClip Frame 3
stop();
Symbol 101 MovieClip Frame 4
stop();
Symbol 101 MovieClip Frame 5
char.dex = 0;
stop();
Instance of Symbol 71 MovieClip "char" in Symbol 101 MovieClip Frame 5
onClipEvent (enterFrame) {
if ((this.dex % 3) == 0) {
this.attachMovie("gotMagic", "gotMagic" + this.dex, this.dex);
var randX = (14 - _parent._parent._parent._parent.randomBounded(1, 54));
var randY = (-_parent._parent._parent._parent.randomBounded(1, 40));
var randScale = _parent._parent._parent._parent.randomBounded(25, 60);
this["gotMagic" + this.dex]._xscale = randScale;
this["gotMagic" + this.dex]._yscale = randScale;
this["gotMagic" + this.dex]._x = randX;
this["gotMagic" + this.dex]._y = randY;
}
this.dex++;
}
Symbol 101 MovieClip Frame 6
stop();
Symbol 101 MovieClip Frame 7
stop();
Symbol 102 MovieClip [Bushy] Frame 1
var theBushy = _parent._parent.Bushy;
if (theBushy.invincible) {
gotoAndPlay ("flashRight");
} else if (theBushy.face == 0) {
stop();
} else {
gotoAndStop ("left");
}
Symbol 102 MovieClip [Bushy] Frame 7
if (_parent._parent.Bushy.invincible) {
gotoAndPlay ("flashRight");
}
Symbol 102 MovieClip [Bushy] Frame 8
var theBushy = _parent._parent.Bushy;
if (theBushy.invincible) {
gotoAndPlay ("flashLeft");
} else if (theBushy.face == 1) {
stop();
} else {
gotoAndStop ("right");
}
Symbol 102 MovieClip [Bushy] Frame 14
if (_parent._parent.Bushy.invincible) {
gotoAndPlay ("flashLeft");
}
Symbol 172 MovieClip [tree_marsh_branch2] Frame 1
stop();
Symbol 172 MovieClip [tree_marsh_branch2] Frame 2
stop();
Symbol 176 MovieClip [tree_branch2] Frame 1
stop();
Symbol 176 MovieClip [tree_branch2] Frame 2
stop();
Symbol 180 MovieClip [tree_marsh_branch1] Frame 1
stop();
Symbol 180 MovieClip [tree_marsh_branch1] Frame 2
stop();
Symbol 184 MovieClip [tree_branch1] Frame 1
stop();
Symbol 184 MovieClip [tree_branch1] Frame 2
stop();
Symbol 187 MovieClip Frame 1
stop();
Symbol 188 MovieClip [treeFungus2] Frame 1
stop();
Symbol 189 MovieClip [treeFungus1] Frame 1
stop();
Symbol 193 MovieClip Frame 21
_parent._parent._parent._parent.evalPoints(_parent._parent);
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 2
stop();
Symbol 195 MovieClip [trash_banana] Frame 1
stop();
Symbol 195 MovieClip [trash_banana] Frame 2
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 2
stop();
Symbol 198 MovieClip [trash_popcan] Frame 1
stop();
Symbol 198 MovieClip [trash_popcan] Frame 2
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 2
stop();
Symbol 201 MovieClip [trash_popcorn] Frame 1
stop();
Symbol 201 MovieClip [trash_popcorn] Frame 2
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 2
stop();
Symbol 204 MovieClip [trash_napkin] Frame 1
stop();
Symbol 204 MovieClip [trash_napkin] Frame 2
stop();
Symbol 206 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 2
stop();
Symbol 207 MovieClip [trash_appleCore] Frame 1
stop();
Symbol 207 MovieClip [trash_appleCore] Frame 2
stop();
Symbol 209 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 2
stop();
Symbol 210 MovieClip [trash_bottle] Frame 1
stop();
Symbol 210 MovieClip [trash_bottle] Frame 2
stop();
Symbol 211 MovieClip [gotMagic] Frame 21
this.removeMovieClip();
stop();
Symbol 212 MovieClip [attachClip] Frame 1
stop();
Symbol 213 MovieClip [fadeScorer] Frame 35
this.removeMovieClip();
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 2
stop();
Symbol 220 MovieClip [trash_cup] Frame 1
stop();
Symbol 220 MovieClip [trash_cup] Frame 2
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 9
stop();
Symbol 238 MovieClip [flowerGrow] Frame 16
bloom.play();
Symbol 238 MovieClip [flowerGrow] Frame 20
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 2
stop();
Symbol 242 MovieClip [seed2] Frame 1
stop();
Symbol 242 MovieClip [seed2] Frame 2
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 2
stop();
Symbol 246 MovieClip [seed5] Frame 1
stop();
Symbol 246 MovieClip [seed5] Frame 2
stop();
Symbol 249 MovieClip Frame 1
stop();
Symbol 249 MovieClip Frame 2
stop();
Symbol 250 MovieClip [seed3] Frame 1
stop();
Symbol 250 MovieClip [seed3] Frame 2
stop();
Symbol 253 MovieClip Frame 9
var theOBJ = _parent._parent._parent._parent.findObjByID(_parent._parent._name, _parent._parent._x, _parent._parent._y);
_parent._parent._parent._parent.kill(theOBJ, true);
Symbol 254 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 2
stop();
Symbol 254 MovieClip Frame 3
stop();
Symbol 255 MovieClip [seed4] Frame 1
stop();
Symbol 255 MovieClip [seed4] Frame 2
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 2
stop();
Symbol 259 MovieClip [seed1] Frame 1
stop();
Symbol 259 MovieClip [seed1] Frame 2
stop();
Symbol 261 MovieClip [stem] Frame 15
stop();
Symbol 281 MovieClip Frame 15
stop();
Symbol 283 MovieClip [bridgeBloomGrow_left] Frame 30
stop();
Symbol 304 MovieClip Frame 1
var capturedMonster = false;
Symbol 365 MovieClip [snareVines] Frame 15
stop();
Instance of Symbol 304 MovieClip in Symbol 365 MovieClip [snareVines] Frame 15
onClipEvent (enterFrame) {
if (!this.capturedMonster) {
_parent._parent._parent.testEnemyGrabability(_parent._x, _parent._y, _parent._name);
}
}
Symbol 365 MovieClip [snareVines] Frame 23
stop();
Symbol 365 MovieClip [snareVines] Frame 31
stop();
Symbol 380 MovieClip [catapultLeafGrow] Frame 45
_parent._parent.replaceWithCatapult(this, "");
stop();
Symbol 383 MovieClip [catapultLeaf] Frame 1
stop();
Symbol 383 MovieClip [catapultLeaf] Frame 19
if (this.obToLaunch.surface == this.floor1) {
if (this.obToLaunch.face == 0) {
this.obToLaunch.speed = 30;
}
this.obToLaunch.surface = null;
this.obToLaunch.surfaceType = "";
this.obToLaunch.y = this.obToLaunch.y - 1;
this.obToLaunch.jumpspeed = -50;
this.obToLaunch.activateAction("jump");
}
Symbol 395 MovieClip Frame 1
stop();
Symbol 395 MovieClip Frame 2
stop();
Symbol 395 MovieClip Frame 3
stop();
Symbol 397 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 2
stop();
Symbol 397 MovieClip Frame 3
stop();
Symbol 399 MovieClip Frame 1
stop();
Symbol 399 MovieClip Frame 2
stop();
Symbol 399 MovieClip Frame 3
stop();
Symbol 401 MovieClip Frame 1
stop();
Symbol 401 MovieClip Frame 2
stop();
Symbol 401 MovieClip Frame 3
stop();
Symbol 403 MovieClip Frame 1
stop();
Symbol 403 MovieClip Frame 2
stop();
Symbol 403 MovieClip Frame 3
stop();
Instance of Symbol 395 MovieClip "seed1" in Symbol 404 MovieClip Frame 1
on (release) {
_parent._parent._parent.setSeed(1);
_parent._parent.fixSeeds();
}
Instance of Symbol 397 MovieClip "seed2" in Symbol 404 MovieClip Frame 1
on (release) {
_parent._parent._parent.setSeed(2);
_parent._parent.fixSeeds();
}
Instance of Symbol 399 MovieClip "seed3" in Symbol 404 MovieClip Frame 1
on (release) {
_parent._parent._parent.setSeed(3);
_parent._parent.fixSeeds();
}
Instance of Symbol 401 MovieClip "seed4" in Symbol 404 MovieClip Frame 1
on (release) {
_parent._parent._parent.setSeed(4);
_parent._parent.fixSeeds();
}
Instance of Symbol 403 MovieClip "seed5" in Symbol 404 MovieClip Frame 1
on (release) {
_parent._parent._parent.setSeed(5);
_parent._parent.fixSeeds();
}
Symbol 407 MovieClip [pauseScreen] Frame 1
function fixSeeds() {
var _local2 = _parent.seedStatus;
var _local1 = 0;
while (_local1 < _local2.length) {
menu["seed" + (_local1 + 1)].gotoAndStop(_local2[_local1]);
if (_local2[_local1] == "active") {
currentSeed = _local1 + 1;
if (seedDescript) {
seedDescript.text = seedDescriptions[_local1];
}
}
_local1++;
}
}
var seedDescriptions = new Array(5);
seedDescriptions[0] = "Throw this seed to grow a flower that can be used as a platform. Click the flower once it grows to take possession of it, then press the up and down arrows to make it grow or shrink. You can even ride it while doing so! Click back on Bushy himself, or use the left/right arrow keys to regain control of the character.";
seedDescriptions[1] = "Throw this seed to grow a bridge of vines in the direction you are facing. This is good for bridging gaps between cliffs or tree-branches.";
seedDescriptions[2] = "Throw this seed in an enemy's path and watch the vines do their job. Once the enemy walks into them, in the blink of an eye the vines will have him in their clutches, unable to move.";
seedDescriptions[3] = "Throw this seed into water to grow a lily-pad that can be used to stand or walk on. Great for crossing large spans of water... especially since Bushy can't swim!";
seedDescriptions[4] = "Throw this seed to grow a leaf capable of launching Bushy high and fast into the air. Press and hold the directional arrow that the leaf will launch you in just before the moment of launch to attain the longest distance travelled. Can also be used to simply launch Bushy higher into the air that a normal jump.";
var currentSeed = null;
fixSeeds();
Symbol 407 MovieClip [pauseScreen] Frame 10
seedDescript.text = seedDescriptions[currentSeed - 1];
stop();
Symbol 407 MovieClip [pauseScreen] Frame 15
_parent.unPauseGame("");
Symbol 427 MovieClip Frame 1
stop();
Symbol 431 MovieClip [bus_flyover] Frame 140
_parent._parent.attachTrash("trash_napkin", 500, 200);
Symbol 431 MovieClip [bus_flyover] Frame 200
_parent._parent.activateBushy();
_parent._parent.startTime();
this.removeMovieClip();
Symbol 448 MovieClip [Ripples] Frame 19
stop();
Symbol 460 MovieClip [splash] Frame 30
this.removeMovieClip();
stop();
Symbol 464 MovieClip [lily_pad2] Frame 20
stop();
Symbol 468 MovieClip [lily_pad1] Frame 20
stop();
Symbol 478 MovieClip [gameOver] Frame 14
score.text = _parent._parent.persistentPlayerScore;
_root.WPI_ArcadeStopSingleGame(_parent._parent.persistentPlayerScore);
Symbol 478 MovieClip [gameOver] Frame 71
_parent._parent.gotoAndPlay("menu");
Symbol 487 MovieClip [seed_sign] Frame 1
stop();
Symbol 487 MovieClip [seed_sign] Frame 2
stop();
Symbol 487 MovieClip [seed_sign] Frame 3
stop();
Symbol 487 MovieClip [seed_sign] Frame 4
stop();
Symbol 487 MovieClip [seed_sign] Frame 5
stop();
Symbol 494 MovieClip [mushroom_spring] Frame 1
stop();
Symbol 494 MovieClip [mushroom_spring] Frame 8
if (this.obToLaunch.surface == this.floor1) {
this.obToLaunch.surface = null;
this.obToLaunch.surfaceType = "";
this.obToLaunch.y = this.obToLaunch.y - 1;
this.obToLaunch.jumpspeed = -Math.abs(this.pushAmount);
this.obToLaunch.activateAction("jump");
}
Symbol 520 MovieClip Frame 1
stop();
Symbol 520 MovieClip Frame 20
gotoAndStop (1);
Symbol 526 MovieClip [wiggi_goat] Frame 1
stop();
Symbol 526 MovieClip [wiggi_goat] Frame 2
head.play();
Symbol 526 MovieClip [wiggi_goat] Frame 5
if (this.obToLaunch.surface == this.floor1) {
this.obToLaunch.surface = null;
this.obToLaunch.surfaceType = "";
this.obToLaunch.y = this.obToLaunch.y - 1;
this.obToLaunch.jumpspeed = -Math.abs(this.pushAmount);
this.obToLaunch.activateAction("jump");
}
Symbol 530 Button
on (release) {
_parent._parent.returnToMenu();
}
Symbol 532 Button
on (release) {
_parent._parent.nextLesson();
startButton._visible = false;
}
Symbol 534 MovieClip [tutorialTextBox] Frame 1
FinishButton._visible = false;
Symbol 536 MovieClip [catapultLeaf_left] Frame 1
stop();
Symbol 536 MovieClip [catapultLeaf_left] Frame 19
if (this._name != "forMovie") {
if (this.obToLaunch.surface == this.floor1) {
if (this.obToLaunch.face == 1) {
this.obToLaunch.speed = 30;
}
this.obToLaunch.surface = null;
this.obToLaunch.surfaceType = "";
this.obToLaunch.y = this.obToLaunch.y - 1;
this.obToLaunch.jumpspeed = -50;
this.obToLaunch.activateAction("jump");
}
}
Symbol 547 MovieClip [catapultLeafGrow_left] Frame 45
_parent._parent.replaceWithCatapult(this, "_left");
stop();
Symbol 552 MovieClip [bridgeBloomGrow_right] Frame 30
stop();
Symbol 562 MovieClip [leafGrow0] Frame 15
stop();
Symbol 562 MovieClip [leafGrow0] Frame 16
this.removeMovieClip();
stop();
Symbol 563 MovieClip [leafGrow1] Frame 15
stop();
Symbol 563 MovieClip [leafGrow1] Frame 16
this.removeMovieClip();
stop();
Symbol 568 MovieClip Frame 17
gotoAndPlay (15);
Symbol 569 Button
on (release) {
getURL ("http://www.wiggiworld.com", "_blank");
}
Symbol 578 MovieClip Frame 15
stop();
Symbol 580 Button
on (release) {
_root.gotoAndPlay("start");
}
Symbol 594 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
bl = _root.getBytesLoaded();
bt = _root.getBytesTotal();
perc = (bl / bt) * 100;
bar.bar._xscale = perc;
if (perc >= 100) {
this.gotoAndPlay("goplay");
delete this.onEnterFrame;
}
};
Symbol 594 MovieClip Frame 25
stop();
Symbol 620 MovieClip Frame 1
stop();
Symbol 620 MovieClip Frame 2
play();
Symbol 624 MovieClip Frame 27
gotoAndPlay (1);
Symbol 624 MovieClip Frame 28
stop();
Symbol 629 MovieClip Frame 30
stop();
Symbol 630 MovieClip Frame 26
function randomBounded(lowerBound, upperBound) {
var _local2 = (upperBound - lowerBound) + 1;
var _local1 = Math.random() * _local2;
return(lowerBound + parseInt(_local1));
}
Bushy.dex = 0;
Instance of Symbol 604 MovieClip "Bushy" in Symbol 630 MovieClip Frame 26
onClipEvent (enterFrame) {
if ((this.dex % 3) == 0) {
this.attachMovie("gotMagic", "gotMagic" + this.dex, this.dex);
var randX = (14 - _parent.randomBounded(1, 54));
var randY = (-_parent.randomBounded(1, 40));
var randScale = _parent.randomBounded(25, 60);
this["gotMagic" + this.dex]._xscale = randScale;
this["gotMagic" + this.dex]._yscale = randScale;
this["gotMagic" + this.dex]._x = randX;
this["gotMagic" + this.dex]._y = randY;
}
this.dex++;
}
Symbol 630 MovieClip Frame 76
bushy_b.gotoAndPlay("shake");
dirts.gotoAndPlay("stopall");
Symbol 630 MovieClip Frame 101
function randomBounded(lowerBound, upperBound) {
var _local2 = (upperBound - lowerBound) + 1;
var _local1 = Math.random() * _local2;
return(lowerBound + parseInt(_local1));
}
_parent.cleanup.play();
_parent.instruction.play();
_parent.tutorial.play();
_parent.playbutton.play();
_parent.exitbutton.play();
dirts.gotoAndStop("stopall");
Bushy.dex = 0;
stop();
Symbol 634 MovieClip Frame 1
stop();
Symbol 634 MovieClip Frame 20
this.onRelease = function () {
_parent._parent.gotoAndPlay("instructions");
};
stop();
Symbol 638 MovieClip Frame 1
stop();
Symbol 638 MovieClip Frame 20
this.onRelease = function () {
_root.WPI_ArcadeStartSingleGame();
_parent._parent.gotoAndPlay("intro");
};
stop();
Symbol 642 MovieClip Frame 1
stop();
Symbol 642 MovieClip Frame 20
this.onRelease = function () {
_parent._parent.level = 0;
_parent._parent.gotoAndPlay("game");
};
stop();
Symbol 646 MovieClip Frame 1
stop();
Symbol 646 MovieClip Frame 20
this.onRelease = function () {
};
stop();
Symbol 648 MovieClip Frame 1
stop();
Symbol 648 MovieClip Frame 15
stop();
Symbol 649 MovieClip Frame 1
if (_parent.menuPlayedOnce) {
bRiser.gotoAndStop("end");
} else {
_parent.menuPlayedOnce = true;
}
Symbol 657 MovieClip Frame 1
stop();
Symbol 657 MovieClip Frame 2
stop();
Symbol 657 MovieClip Frame 3
stop();
Symbol 657 MovieClip Frame 4
stop();
Symbol 664 MovieClip Frame 1
stop();
Symbol 664 MovieClip Frame 7
gotoAndPlay (1);
Symbol 664 MovieClip Frame 14
gotoAndPlay (1);
Symbol 664 MovieClip Frame 22
gotoAndPlay (1);
Symbol 664 MovieClip Frame 30
gotoAndPlay (1);
Symbol 664 MovieClip Frame 41
gotoAndPlay (1);
Symbol 664 MovieClip Frame 55
gotoAndPlay (1);
Symbol 670 MovieClip Frame 101
stop();
Symbol 672 MovieClip Frame 1
stop();
Symbol 672 MovieClip Frame 2
stop();
Symbol 672 MovieClip Frame 3
stop();
Symbol 672 MovieClip Frame 4
stop();
Symbol 672 MovieClip Frame 5
stop();
Symbol 679 MovieClip Frame 1
stop();
Symbol 679 MovieClip Frame 2
stop();
Symbol 679 MovieClip Frame 3
stop();
Symbol 679 MovieClip Frame 4
stop();
Symbol 686 Button
on (press) {
_parent.affectUpButton(true);
}
on (release) {
_parent.affectUpButton(false);
}
on (releaseOutside) {
_parent.affectUpButton(false);
}
Symbol 690 Button
on (press) {
_parent.affectDownButton(true);
}
on (release) {
_parent.affectDownButton(false);
}
on (releaseOutside) {
_parent.affectDownButton(false);
}
Symbol 693 MovieClip Frame 1
function findWall(objID) {
var _local3 = objID;
var _local2;
var _local1;
_local2 = 0;
while (_local2 < wallSet.length) {
_local1 = 0;
while (_local1 < wallSet[_local2].wallDex) {
if (wallSet[_local2].wallArr[_local1].id == _local3) {
return(wallSet[_local2].wallArr[_local1]);
}
_local1++;
}
_local2++;
}
return(null);
}
function findMovingFloor(movieClipName) {
var _local2 = movieClipName;
var _local1;
var j;
_local1 = 0;
while (_local1 < moveFloorDex) {
if (moveFloorSet[_local1].clip._name == _local2) {
return(moveFloorSet[_local1]);
}
_local1++;
}
return(null);
}
function findObjByID(objID, coordHintX, coordHintY) {
var cHintX = coordHintX;
var cHintY = coordHintY;
var _local3 = [characters, objectSet, pObjectSet, floorSet[Math.floor(cHintY / sectionSize)].floorArr, wallSet[Math.floor(cHintX / sectionSize)].wallArr, elevatorSet, moveFloorSet, enemySet, spawnSet];
var dexArray = [-1, objectDex, pObjectDex, floorSet[Math.floor(cHintY / sectionSize)].floorDex, wallSet[Math.floor(cHintX / sectionSize)].wallDex, elevatorDex, moveFloorDex, enemyDex, spawnDex];
var _local2;
var _local1;
var k;
var toVal;
_local2 = 0;
while (_local2 < _local3.length) {
if (dexArray[_local2] == -1) {
toVal = _local3[_local2].length;
} else {
toVal = dexArray[_local2];
}
_local1 = 0;
while (_local1 < toVal) {
if (_local3[_local2][_local1].id == objID) {
return(_local3[_local2][_local1]);
}
_local1++;
}
_local2++;
}
return(null);
}
function findProjectileByID(objID) {
var _local2;
var _local1;
var _local3;
_local2 = 0;
while (_local2 < enemyDex) {
_local3 = enemySet[_local2].pSet;
_local1 = 0;
while (_local1 < enemySet[_local2].pDex) {
if (_local3[_local1].id == objID) {
return(_local3[_local1]);
}
_local1++;
}
_local2++;
}
return(null);
}
function movieAttacher(attachTo, movieRef, baseName, x, y, scale, sort) {
var _local1 = baseName;
var _local2 = attachTo;
var _local3 = scale;
_local2.attachMovie(movieRef, _local1, attachDex[sort]);
_local2[_local1]._x = x;
_local2[_local1]._y = y;
if (_local3 != 100) {
_local2[_local1]._xscale = _local3;
_local2[_local1]._yscale = _local3;
}
attachDex[sort] = attachDex[sort] + 1;
return(_local2[_local1]);
}
function between(testCoord, c1, c2) {
if (((testCoord - 0) >= (c1 - 0)) && ((testCoord - 0) <= (c2 - 0))) {
return(true);
}
return(false);
}
function randomBounded(lowerBound, upperBound) {
var _local2 = (upperBound - lowerBound) + 1;
var _local1 = Math.random() * _local2;
return(lowerBound + parseInt(_local1));
}
function toRadians(angleInDegrees) {
return((Math.PI * angleInDegrees) / 180);
}
function toDegrees(angleInRadians) {
return((180 * angleInRadians) / Math.PI);
}
function lineBetween(drawStage, p1x, p1y, p2x, p2y, colorInfo, alphInfo) {
with (drawStage) {
lineStyle(1, colorInfo, alphInfo);
moveTo(p1x, p1y);
lineTo(p2x, p2y);
}
}
function minMax(valArray) {
var _local2 = valArray;
var _local1;
lowIDX = 0;
highIDX = 0;
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] < _local2[lowIDX]) {
lowIDX = _local1;
}
if (_local2[_local1] > _local2[highIDX]) {
highIDX = _local1;
}
_local1++;
}
return([_local2[lowIDX], _local2[highIDX]]);
}
function percentOverlap(sub1, sub2, sup1, sup2, debug) {
var _local1 = sub2;
var _local2 = sub1;
var _local3 = sup2;
if (debug) {
attachClip.clear();
}
var sublength = (_local1 - _local2);
var suplength = (_local3 - sup1);
if (debug) {
lineBetween(attachClip, 300, _local2, 300, _local1, "0xFF0000", 100);
lineBetween(attachClip, 310, sup1, 310, _local3, "0x0000FF", 100);
}
if (sublength < suplength) {
if ((_local2 <= sup1) && (_local1 >= sup1)) {
return((_local1 - sup1) / sublength);
}
if ((_local2 <= _local3) && (_local1 >= _local3)) {
return((_local3 - _local2) / sublength);
}
if ((_local2 >= sup1) && (_local1 <= _local3)) {
return(1);
}
} else {
if ((sup1 <= _local2) && (_local3 >= _local2)) {
return((_local3 - _local2) / suplength);
}
if ((sup1 <= _local1) && (_local3 >= _local1)) {
return((_local1 - sup1) / suplength);
}
if ((sup1 >= _local2) && (_local3 <= _local1)) {
return(1);
}
}
return(0);
}
function rotateString(s) {
var vals;
var _local1;
var _local3;
var pos1;
var pos2;
var t;
vals = s.split(",");
var _local2 = new Array(vals.length);
var sorted = new Array(vals.length);
_local1 = 0;
while (_local1 < vals.length) {
_local2[_local1] = Math.random();
_local1++;
}
_local3 = 0;
while (_local3 < vals.length) {
minIndex = 0;
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] < _local2[minIndex]) {
minIndex = _local1;
}
_local1++;
}
sorted[_local3] = vals[minIndex];
_local2[minIndex] = 999999 /* 0x0F423F */;
_local3++;
}
return(sorted);
}
function stripWhitespaceDoublePass(XMLnode) {
var _local3 = XMLnode;
var _local2 = 0;
while (_local2 < _local3.childNodes.length) {
if (_local3.childNodes[_local2].nodeType == 3) {
var _local1 = 0;
var emptyNode = true;
_local1 = 0;
while (_local1 < _local3.childNodes[_local2].nodeValue.length) {
if (_local3.childNodes[_local2].nodeValue.charCodeAt(_local1) > 32) {
emptyNode = false;
break;
}
_local1++;
}
if (emptyNode) {
_local3.childNodes[_local2].removeNode();
}
}
_local2++;
}
var k = 0;
while (k < _local3.childNodes.length) {
stripWhitespaceDoublePass(_local3.childNodes[k]);
k++;
}
}
function dist(xCoord1, yCoord1, xCoord2, yCoord2) {
var _local1 = Math.sqrt(Math.pow(xCoord1 - xCoord2, 2) + Math.pow(yCoord1 - yCoord2, 2));
return(_local1);
}
function max(n1, n2) {
if (n1 < n2) {
return(n1);
}
return(n2);
}
function myreplace(someText, from, to) {
var _local3 = from;
var _local1 = "";
var _local2;
_local2 = 0;
while (_local2 < someText.length) {
_local1 = _local1 + someText.substring(_local2, _local2 + 1);
if (_local1.length >= _local3.length) {
if (_local1.substring(_local1.length - _local3.length, _local1.length) == _local3) {
_local1 = _local1.substring(0, _local1.length - _local3.length) + to;
}
}
_local2++;
}
return(_local1);
}
function addObject(objectToAdd) {
objectSet[objectDex] = objectToAdd;
objectDex = objectDex + 1;
}
function addPObject(objectToAdd) {
pObjectSet[pObjectDex] = objectToAdd;
pObjectDex = pObjectDex + 1;
}
function kill(ob, removeClip) {
var _local1 = ob;
if (_local1.surface._parent._name.indexOf("elevator") != -1) {
freeWeights(_local1);
}
_local1.process = false;
if (_local1.id.indexOf("seed") == 0) {
seedAlive = false;
}
if (removeClip) {
if (!_local1.isChar) {
_local1.clip.removeMovieClip();
_local1.killed = true;
} else {
takeLife();
}
}
if (removeClip) {
_local1.clip.onrelease = null;
}
}
function processEffects(obID, obx, oby, actionTaken) {
var _local3;
var _local1;
var _local2;
var ob = findObjByID(obID, obx, oby);
if (ob) {
if (ob.process) {
_local3 = ob.returnActionOBJ(actionTaken);
if ((_local3 != null) && (_local3.effectDex > 0)) {
_local2 = 0;
while (_local2 < _local3.effectDex) {
if (_local3.effects[_local2].clipID != "me") {
_local1 = findObjByID(_local3.effects[_local2].clipID, 0, 0);
} else {
_local1 = ob;
}
if (_local1 == null) {
if ((_local3.effects[_local2].clipFrame == "unprocess") || (_local3.effects[_local2].clipFrame == "process")) {
_local1 = findWall(_local3.effects[_local2].clipID);
if (_local3.effects[_local2].clipFrame == "process") {
_local1.process = true;
} else {
_local1.process = false;
}
_local1.processChange = true;
}
} else if (_local3.effects[_local2].clipFrame == "fall") {
_local1.y = _local1.y + 5;
_local1.surface = null;
_local1.surfaceType = "";
_local1.activateAction("jump");
} else if (_local3.effects[_local2].clipFrame == "process") {
_local1.process = true;
if (_local1.spawnType) {
_local1.spawnObject();
}
} else {
_local1.pauseMovement();
_local1.activateAction(_local3.effects[_local2].clipFrame);
}
_local2++;
}
}
}
}
}
function effect(params) {
var _local1 = params.split(";");
this.clipID = _local1[0];
this.clipFrame = _local1[1];
}
function addEffect(params) {
var _local1 = this;
_local1.effects[_local1.effectDex] = new effect(params);
_local1.effectDex = _local1.effectDex + 1;
}
function action(name, active, effects) {
var _local3 = this;
var _local2;
var _local1;
_local3.name = name;
_local3.active = active;
_local3.effects = new Array();
_local3.effectDex = 0;
_local3.addEffect = addEffect;
if (effects.indexOf(";") != -1) {
_local2 = effects.split(".");
_local1 = 0;
while (_local1 < _local2.length) {
_local3.addEffect(_local2[_local1]);
_local1++;
}
}
}
function activateAction(cname) {
var _local1 = this;
var _local2 = cname;
var index = 0;
if (_local1.process) {
var _local3 = 0;
while (_local3 < _local1.actions.length) {
if (_local1.actions[_local3].name == _local2) {
if (((_local1.id == "Bushy") && (_local1.currentAction == "cast")) && (_local2 != "cast")) {
Bushy.clip.onRelease = null;
}
_local1.actions[_local3].active = true;
_local1.clip.movements.gotoAndStop(_local2);
_local1.currentAction = _local2;
if (_local2 == "jump") {
_local1.surface = null;
}
if (((_local2 == "felltoofar") || (_local2 == "burn")) || (_local2 == "explode")) {
if ((ob.surface != null) && (ob.clip._y != ob.surface.y)) {
ob.y = ob.surface.y;
ob.clip._y = ob.y;
}
kill(_local1, false);
}
} else {
_local1.actions[_local3].active = false;
}
_local3++;
}
}
}
function assumeAction(cname) {
this.clip.movements.gotoAndStop(cname);
}
function inAction(cname) {
var _local2 = this;
var _local3 = cname;
var _local1 = 0;
while (_local1 < _local2.actions.length) {
if ((_local2.actions[_local1].name == _local3) && (_local2.actions[_local1].active)) {
return(true);
}
_local1++;
}
return(undefined);
}
function returnActionOBJ(cname) {
var _local2 = this;
var _local3 = cname;
var index = 0;
if (_local2.process) {
var _local1 = 0;
while (_local1 < _local2.actions.length) {
if (_local2.actions[_local1].name == _local3) {
return(_local2.actions[_local1]);
}
_local1++;
}
}
return(null);
}
function setFace(facing) {
var _local1 = this;
_local1.clip.gotoAndStop(facing);
if (facing == "right") {
_local1.face = 0;
} else {
_local1.face = 1;
}
}
function rC(cornerName, coord) {
var _local1 = this;
var xper;
var yper;
var cSpan;
var _local2;
var _local3 = _local1.clip._rotation;
xper = Math.cos(toRadians(_local3));
yperx = Math.tan(toRadians(_local3));
switch (cornerName) {
case "br" :
_local2 = 0;
break;
case "bl" :
_local2 = 1;
break;
case "tl" :
_local2 = 2;
break;
case "tr" :
_local2 = 3;
break;
case "bm" :
_local2 = 4;
break;
case "tm" :
_local2 = 5;
}
if (_local3 == 0) {
if (coord == "x") {
return(_local1.x + _local1.corners[_local1.face][_local2][0]);
}
if (coord == "y") {
return(_local1.y + _local1.corners[_local1.face][_local2][1]);
}
} else {
if (coord == "x") {
return(_local1.x + (_local1.corners[_local1.face][_local2][0] * xper));
}
if (coord == "y") {
if (cornerName.substring(0, 1) == "t") {
return((_local1.y + _local1.corners[_local1.face][_local2][1]) + (_local1.corners[_local1.face][_local2][0] * yperx));
}
return(_local1.y + (_local1.corners[_local1.face][_local2][0] * yperx));
}
}
return(undefined);
}
function evalDefaultCorners() {
var _local1 = this;
var _local2 = _local1.clip._width;
var _local3 = _local1.clip._height;
_local1.corners[0][0] = [0, 0];
_local1.corners[0][1] = [-_local2, 0];
_local1.corners[0][2] = [-_local2, -_local3];
_local1.corners[0][3] = [0, -_local3];
_local1.corners[0][4] = [(-_local2) / 2, 0];
_local1.corners[0][5] = [(-_local2) / 2, -_local3];
_local1.corners[1][0] = [0, 0];
_local1.corners[1][1] = [-_local2, 0];
_local1.corners[1][2] = [-_local2, -_local3];
_local1.corners[1][3] = [0, -_local3];
_local1.corners[1][4] = [(-_local2) / 2, 0];
_local1.corners[1][5] = [(-_local2) / 2, -_local3];
}
function pauseMovement() {
this.pause = !this.pause;
}
function objectDef(clipToAttach, libraryName, id, x, y, cornerset, sort, scale, process, weight, actionables, moreActions, tooFar) {
var _local1 = this;
var ma;
var _local3;
var i;
var _local2;
_local1.id = id;
_local1.originalMovie = libraryName;
_local1.clip = movieAttacher(clipToAttach, libraryName, id, x, y, scale, sort);
_local1.width = _local1.clip._width;
_local1.height = _local1.clip._height;
_local1.weight = weight;
_local1.targetX = null;
_local1.keyEvents = "";
_local1.x = x;
_local1.y = y;
_local1.xDelta = 0;
_local1.yDelta = 0;
_local1.corners = new Array(2);
_local1.corners[0] = new Array(6);
_local1.corners[1] = new Array(6);
_local1.evalDefaultCorners = evalDefaultCorners;
_local1.evalDefaultCorners();
if (cornerset.indexOf(",") != -1) {
_local3 = cornerset.split(",");
i = 0;
while (i < _local3.length) {
_local3[i] = _local3[i] - 0;
i++;
}
if (_local3.length == 12) {
i = 0;
while (i < 2) {
_local2 = 0;
while (_local2 < 6) {
_local1.corners[i][_local2] = [_local3[2 * _local2], _local3[(2 * _local2) + 1]];
_local2++;
}
i++;
}
}
if (_local3.length == 24) {
_local1.corners[0][0] = [_local3[0], _local3[1]];
_local1.corners[0][1] = [_local3[2], _local3[3]];
_local1.corners[0][2] = [_local3[4], _local3[5]];
_local1.corners[0][3] = [_local3[6], _local3[7]];
_local1.corners[0][4] = [_local3[8], _local3[9]];
_local1.corners[0][5] = [_local3[10], _local3[11]];
_local1.corners[1][0] = [_local3[12], _local3[13]];
_local1.corners[1][1] = [_local3[14], _local3[15]];
_local1.corners[1][2] = [_local3[16], _local3[17]];
_local1.corners[1][3] = [_local3[18], _local3[19]];
_local1.corners[1][4] = [_local3[20], _local3[21]];
_local1.corners[1][5] = [_local3[22], _local3[23]];
}
}
_local1.turnOffset = [0, 0];
_local1.rC = rC;
_local1.face = 0;
_local1.setFace = setFace;
_local1.clip.gotoAndStop(_local1.face);
_local1.speed = 0;
_local1.jumpstart = -25 / weight;
_local1.jumpspeed = gravity;
_local1.assumeAction = assumeAction;
_local1.activateAction = activateAction;
_local1.inAction = inAction;
_local1.returnActionOBJ = returnActionOBJ;
_local1.currentAction = "jump";
_local1.charFrame = 0;
ma = moreActions.split(",");
_local1.actions = new Array(4 + ma.length);
_local1.actions[0] = new action("standstill", false, "");
_local1.actions[1] = new action("walk", false, "");
_local1.actions[2] = new action("jump", false, "");
_local1.actions[3] = new action("felltoofar", false, "");
i = 0;
while (i < ma.length) {
if (ma[i] != "") {
if (ma[i].indexOf(":") != -1) {
temp = ma[i].split(":");
_local1.actions[4 + i] = new action(temp[0], false, temp[1]);
} else {
_local1.actions[4 + i] = new action(ma[i], false, "");
}
}
i++;
}
_local1.actionables = new Array(6);
if (actionables != "") {
var tempActs = actionables.split("|");
var i = 0;
while (i < _local1.actionables.length) {
if (i < tempActs.length) {
_local1.actionables[i] = tempActs[i];
if (tempActs[i] == "burn") {
_local1.burned = false;
}
} else {
_local1.actionables[i] = "false";
}
i++;
}
if (_local1.actionables[0] != "true") {
_local1.currentAction = "standstill";
_local1.actions[0].active = true;
_local1.actions[2].active = false;
}
}
_local1.surface = null;
_local1.surfaceType = "";
_local1.surfaceDelta = 0;
_local1.deadfall = false;
_local1.movingSurfaceClipName = "|";
_local1.contactWall = null;
_local1.mapToIncline = false;
_local1.startFall = y;
_local1.tooFar = tooFar;
_local1.process = process;
_local1.pause = false;
_local1.pauseMovement = pauseMovement;
_local1.extraInfo = null;
_local1.charActingOn = null;
_local1.room = 0;
_local1.killed = false;
_local1.hasFloors = false;
_local1.isChar = false;
_local1.isProjectile = false;
_local1.clipTrick = 0;
_local1.flooredCount = 1;
_local1.hitSolidGround = false;
}
function getCorners(eType) {
if (eType == "Wigfoot") {
return("-3.5,0,-22.5,0,-22.5,-56.5,-3.5,-56.5,-19,0,-19,-56.5,-3.5,0,-22.5,0,-22.5,-56.5,-3.5,-56.5,-19,0,-19,-56.5");
}
if (eType == "Wigbeast") {
return("-3.5,0,-22.5,0,-22.5,-56.5,-3.5,-56.5,-19,0,-19,-56.5,-3.5,0,-22.5,0,-22.5,-56.5,-3.5,-56.5,-19,0,-19,-56.5");
}
}
function getActions(eType) {
if (eType == "Wigfoot") {
return("");
}
if (eType == "Wigbeast") {
return("");
}
}
function getSpeed(eType) {
if (eType == "Wigfoot") {
return(5);
}
if (eType == "Wigbeast") {
return(5);
}
}
function getSightRange(eType) {
if (eType == "Wigfoot") {
return(250);
}
if (eType == "Wigbeast") {
return(250);
}
}
function getAttackRange(eType) {
if (eType == "Wigfoot") {
return(0);
}
if (eType == "Wigbeast") {
return(0);
}
}
function patrolDef(strays) {
var _local2 = this;
var _local1 = strays.split(",");
_local2.originalPosition = 0;
_local2.strayRight = _local1[0] - 0;
_local2.strayLeft = _local1[1] - 0;
}
function addEnemy(id, enemyType, x, y, actionables, moreActions, process, patrol, pDefs) {
var _local1 = enemyType;
var _local3 = this;
var _local2 = "";
_local2 = moreActions;
if (_local2 != "") {
_local2 = _local2 + ("," + getActions(_local1));
}
if (_local1 != "tower") {
enemySet[enemyDex] = new objectDef(attachClip, _local1, id, x, y, getCorners(_local1), 1, 100, process, 8, actionables, _local2, 50);
} else {
enemySet[enemyDex] = new objectDef(attachClip, _local1, id, x, y, getCorners(_local1), 0, 100, process, 8, actionables, _local2, 50);
}
enemySet[enemyDex].speed = getSpeed(_local1);
enemySet[enemyDex].origSpeed = enemySet[enemyDex].speed;
enemySet[enemyDex].x = x;
enemySet[enemyDex].y = y;
enemySet[enemyDex].clip._x = x;
enemySet[enemyDex].clip._y = y;
if (patrol) {
enemySet[enemyDex].patrol = true;
enemySet[enemyDex].patrolDef = new patrolDef(pDefs);
enemySet[enemyDex].patrolDef.originalPosition = x;
}
enemySet[enemyDex].sightRange = getSightRange(_local1);
enemySet[enemyDex].attackRange = getAttackRange(_local1);
enemySet[enemyDex].charSighted = null;
enemySet[enemyDex].targeted = null;
enemySet[enemyDex].lastTargeted = null;
enemySet[enemyDex].wipe = false;
enemySet[enemyDex].panic = false;
enemySet[enemyDex].extraInfo = "enemy";
enemySet[enemyDex].onescape = "";
enemySet[enemyDex].projectiles = 0;
enemySet[enemyDex].pSet = new Array();
enemySet[enemyDex].pDex = 0;
enemySet[enemyDex].pFrom = 0;
enemySet[enemyDex].attacking = false;
enemySet[enemyDex].overrideTarget = false;
enemySet[enemyDex].manhandled = false;
enemySet[enemyDex].pauseCycles = 0;
enemySet[enemyDex].updateLastTarget = function () {
var _local1 = this;
if (_local1.targeted) {
_local1.lastTargeted = _local1.targeted;
}
};
enemySet[enemyDex].flush = function () {
var _local1 = this;
_local1.pause = false;
_local1.attacking = false;
_local1.pauseCycles = 0;
};
if (_local1 == "slingman") {
enemySet[enemyDex].throwStone = throwStone;
}
if (_local1 == "spearman") {
enemySet[enemyDex].readyAttack = readyAttack;
enemySet[enemyDex].throwSpear = throwSpear;
}
enemySet[enemyDex].targetDist = 0;
enemySet[enemyDex].registerHit = registerHit;
if (dropEnemies) {
giveLiftAndDropEvents(enemySet[enemyDex]);
}
enemyDex = enemyDex + 1;
}
function registerHit(xDiff, yDiff, pow) {
var _local2 = this;
var _local1;
var _local3;
var testY;
_local1 = 0;
while (_local1 < characters.length) {
if (_local2.face == 0) {
_local3 = _local2.rC("br", "x") + xDiff;
} else {
_local3 = _local2.rC("bl", "x") - xDiff;
}
testY = _local2.rC("bm", "y");
if (myHitTest(characters[_local1], _local3, testY)) {
affectCharHP(characters[_local1], -pow);
}
_local1++;
}
}
function evalEnemies() {
var i;
var j;
var _local3;
var _local2;
var diry;
var _local1;
var eType;
var chMidX;
var enMidX;
var tgMidX;
var spawner;
var enemyMove;
var charDir;
var chDist;
var targDir;
var tempFloor;
var turnAround = false;
_local2 = 0;
diry = 0;
i = 0;
while (i < enemyDex) {
enemyMove = false;
_local1 = enemySet[i];
if (Math.abs(_local1.x - Bushy.x) < (vWidth * 1.5)) {
if (_local1.process) {
if (objHitTest2(Bushy, _local1) && (!Bushy.invincible)) {
Bushy.y = _local1.y;
Bushy.clip._y = Bushy.y;
Bushy.activateAction("die");
Bushy.process = false;
}
if (_local1.pause) {
_local1.pauseCycles = _local1.pauseCycles + 1;
if (_local1.pauseCycles >= 50) {
_local1.flush();
}
} else {
_local1.pauseCycles = 0;
}
if (_local1.patrol) {
_local3 = _local1.patrolDef;
eType = _local1.originalMovie;
if (_local1.face == 0) {
if (_local1.rC("br", "x") < (_local3.originalPosition + _local3.strayRight)) {
_local2 = 1;
} else {
_local2 = -1;
}
if (_local1.contactWall != null) {
_local1.setFace("left");
_local2 = -_local2;
_local1.contactWall = null;
}
} else {
if (_local1.rC("bl", "x") > (_local3.originalPosition - _local3.strayLeft)) {
_local2 = -1;
} else {
_local2 = 1;
}
if (_local1.contactWall != null) {
_local1.setFace("right");
_local2 = -_local2;
_local1.contactWall = null;
}
}
}
_local1.charSighted = null;
if (((_local2 != 0) || (diry != 0)) || (_local1.surfaceType == "moving")) {
origEnX = _local1.x;
_local1.x = _local1.x + ((_local2 * _local1.speed) * 4);
tempFloor = _local1.surface;
if (_local1.surface != null) {
if (_local1.surfaceType != "moving") {
if (testFloors(_local1) == -1) {
turnAround = true;
_local2 = -_local2;
}
} else if (!testFloorHorizontals(_local1, _local1.surface)) {
turnAround = true;
_local2 = -_local2;
}
if (_local1.surface == null) {
_local1.surface = tempFloor;
}
}
_local1.x = origEnX;
if (!_local1.pause) {
enemyMove = true;
moveObject(_local1, _local2, diry);
} else if (_local1.surfaceType == "moving") {
_local1.y = _local1.surface._y + _local1.surface._parent._y;
_local1.clip._y = _local1.y;
}
}
if ((!enemyMove) && (!_local1.attacking)) {
_local1.activateAction("standstill");
}
if (_local1.wipe) {
_local1.pause = true;
_local1.clip._alpha = _local1.clip._alpha - 25;
if (_local1.clip._alpha <= 0) {
kill(_local1, true);
}
}
}
}
i++;
}
}
function addFloor(y, x1, x2, jumpoff, id, clip, libraryName) {
var _local1 = this;
_local1.floorArr[_local1.floorDex] = new floor(y, x1, x2, jumpoff, id, clip, libraryName);
_local1.floorDex++;
}
function addWaterFloor(y, x1, x2, jumpoff, id, clip, libraryName) {
var _local1 = this;
_local1.floorArr[_local1.floorDex] = new floor(y, x1, x2, jumpoff, id, clip, libraryName);
_local1.floorArr[_local1.floorDex].isWater = true;
_local1.floorDex++;
}
function floorSection(sectionIndex) {
var _local1 = this;
_local1.floorArr = new Array();
_local1.floorDex = 0;
_local1.sectionIndex = sectionIndex;
_local1.addFloor = addFloor;
_local1.addWaterFloor = addWaterFloor;
}
function floor(y, x1, x2, jumpoff, id, clip, libraryName) {
var _local1 = this;
_local1.originalMovie = libraryName;
_local1.clip = clip;
_local1.id = id;
_local1.y = y;
_local1.x1 = x1;
_local1.x2 = x2;
_local1.jumpoff = jumpoff;
_local1.process = true;
_local1.isWater = false;
}
function testFloors(ob) {
var _local1 = ob;
var corner1;
var corner2;
var compY;
var _local2;
var fDex;
compY = _local1.y - 2;
var ty1 = Math.floor((compY + 600) / sectionSize);
var ty2 = Math.floor((((compY + 600) + _local1.jumpspeed) - 0) / sectionSize);
var floorSect = new Array((ty2 - ty1) + 1);
var _local3 = 0;
while (_local3 < floorSect.length) {
floorSect[_local3] = floorSet[ty1 + _local3];
if (floorSect[_local3].floorDex > 0) {
var i = 0;
while (i < floorSect[_local3].floorDex) {
_local2 = floorSect[_local3].floorArr[i];
if (between(_local2.y, compY - 2, (compY + _local1.jumpspeed) + 2) && (_local2.process)) {
corner1 = _local1.rC("bl", "x");
corner2 = _local1.rC("br", "x");
if ((between(corner1, _local2.x1, _local2.x2) || (between(corner2, _local2.x1, _local2.x2))) || (between(_local2.x1, corner1, corner2) && (between(_local2.x2, corner1, corner2)))) {
_local1.surface = _local2;
if (_local1.surface.isWater) {
simpleAttachNonObject(attachClip, "splash", 2, _local1.rC("bm", "x"), _local1.rC("bm", "y") + 5, 125);
if (_local1.originalMovie == "Wigbeast") {
_local1.y = _local1.y + 10;
_local1.clip._y = _local1.y;
}
}
if (_local1.speed != _local1.origSpeed) {
_local1.speed = _local1.origSpeed;
}
_local1.surfaceType = "static";
_local1.hitSolidGround = true;
if (_local1.originalMovie.indexOf("seed") == 0) {
if ((!_local1.surface.isWater) || (_local1.originalMovie == "seed4")) {
processSeed(_local1);
} else {
_local1.y = _local1.y + 10;
_local1.clip._y = _local1.y;
_local1.surface = null;
_local1.surfaceType = "";
return(-1);
}
}
if (_local1.isChar && (!_local1.surface.isWater)) {
_local1.lastKnownGood = new Array(_local1.x, _local2.y);
}
return(_local2.y);
}
}
i++;
}
}
_local3++;
}
_local1.surface = null;
return(-1);
}
function affectMovingFloor(dClip, floorNum, onoff) {
var _local2;
var _local3 = false;
var _local1 = 0;
while (_local1 <= moveFloorDex) {
_local2 = moveFloorSet[_local1];
if (_local2.clip == dClip) {
_local3 = true;
_local2.subprocess[floorNum - 1] = onoff;
if (!onoff) {
alertWhoShouldFall(dClip["floor" + floorNum]);
}
}
if (_local3) {
break;
}
_local1++;
}
if (!_local3) {
_local2 = findObjByID(dClip._name, activeChar.x, activeChar.y);
if (_local2 != null) {
if (!onoff) {
alertWhoShouldFall(_local2);
}
}
}
}
function addMovingFloor(clip, process, numInClip, libraryName) {
moveFloorSet[moveFloorDex] = new movingFloor(clip, process, numInClip, libraryName);
moveFloorDex = moveFloorDex + 1;
}
function allFall() {
var _local2 = this;
var _local1 = 1;
while (_local1 <= _local2.numInClip) {
alertWhoShouldFall(_local2.clip["floor" + _local1]);
_local1++;
}
}
function movingFloor(clip, process, numInClip, libraryName) {
var _local2 = this;
var _local3 = numInClip;
_local2.id = "F_" + clip._name;
_local2.originalMovie = libraryName;
_local2.clip = clip;
_local2.process = process;
_local2.numInClip = _local3;
_local2.subprocess = new Array(_local3);
var _local1 = 0;
while (_local1 < _local3) {
_local2.subprocess[_local1] = true;
_local1++;
}
_local2.allFall = allFall;
_local2.whoOn = "|";
}
function updateWhoOn(theFloor, theClip) {
var _local1;
var _local2;
var _local3;
if (theFloor.whoOn != "|") {
_local3 = theFloor.whoOn.split("|");
_local1 = 1;
while (_local1 < (_local3.length - 1)) {
_local2 = findObjByID(_local3[_local1], 0, 0);
if (_local2) {
if (_local2.surface != theClip) {
theFloor.whoOn = myreplace(theFloor.whoOn, ("|" + _local2.id) + "|", "|");
}
}
_local1++;
}
}
}
function testMovingFloors(ob) {
var _local2 = ob;
if (_local2.originalMovie.indexOf("seed") == -1) {
var corner1;
var corner2;
var compY;
var _local1;
var fixX;
var fixY;
var i;
var j;
var _local3;
if (moveFloorDex > 0) {
compY = _local2.y - 1;
var j = 0;
while (j <= moveFloorDex) {
_local3 = moveFloorSet[j];
if (_local3.process) {
var i = 1;
while (i <= _local3.numInClip) {
if (_local3.subprocess[i - 1]) {
_local1 = _local3.clip["floor" + i];
fixX = _local3.clip._x;
fixY = _local3.clip._y;
if (between(fixY + _local1._y, compY, compY + _local2.jumpspeed) || (dist(0, compY, 0, fixY + _local1._y) <= 10)) {
corner1 = _local2.rC("bl", "x");
corner2 = _local2.rC("br", "x");
if ((between(corner1, fixX + _local1._x, (fixX + _local1._x) + _local1._width) || (between(corner2, fixX + _local1._x, (fixX + _local1._x) + _local1._width))) || (between(fixX + _local1._x, corner1, corner2) && between((fixX + _local1._x) + _local1._width, corner1, corner2))) {
_local2.surface = _local1;
if ((_local2.speed != _local2.origSpeed) && (_local1._parent._name.indexOf("wiggi_goat") == -1)) {
_local2.speed = _local2.origSpeed;
}
_local2.surface.jumpoff = true;
_local2.surfaceType = "moving";
_local2.surfaceDelta = _local1._x;
if (_local1._parent._name.indexOf("catapultLeaf") == 0) {
hitLength = _local2.y - _local2.startFall;
_local1._parent.obToLaunch = _local2;
_local1._parent.play();
}
if (_local1._parent._name.indexOf("mushroom_spring") == 0) {
hitLength = _local2.y - _local2.startFall;
_local1._parent.obToLaunch = _local2;
_local1._parent.pushAmount = 4 * _local2.jumpspeed;
_local1._parent.play();
}
if (_local1._parent._name.indexOf("wiggi_goat") == 0) {
hitLength = _local2.y - _local2.startFall;
_local1._parent.obToLaunch = _local2;
_local1._parent.pushAmount = 4 * _local2.jumpspeed;
_local1._parent.play();
}
if (_local3.whoOn.indexOf(("|" + _local2.id) + "|") == -1) {
updateWhoOn(_local3, _local1);
_local3.whoOn = _local3.whoOn + (_local2.id + "|");
}
if (_local3.originalMovie == "pre") {
preOBJ = findObjByID(_local1._parent._name, 0, 0);
if (preOBJ.originalMovie.indexOf("shaky") != -1) {
if (_local2.weight > preOBJ.weight) {
preOBJ.pause = true;
preOBJ.activateAction("collapse");
}
}
if (preOBJ.originalMovie.indexOf("zipline") != -1) {
preOBJ.pause = true;
preOBJ.activateAction("run");
}
}
if (_local3.originalMovie.indexOf("tilt") != -1) {
_local3.clip.play();
}
if (_local2.isChar) {
_local2.lastKnownGood = new Array(_local2.x, (fixY + _local1._y) - 20);
}
return(fixY + _local1._y);
}
}
}
i++;
}
}
j++;
}
}
}
_local2.surface = null;
return(-1);
}
function testFloorHorizontals(ob, thisClip) {
var _local2 = thisClip;
var _local1;
var thisFloor;
var _local3 = _local2._parent._x;
var fixY = _local2._parent._y;
corner1 = ob.rC("bl", "x");
corner2 = ob.rC("br", "x");
if ((between(corner1, _local3 + _local2._x, (_local3 + _local2._x) + _local2._width) || (between(corner2, _local3 + _local2._x, (_local3 + _local2._x) + _local2._width))) || (between(_local3 + _local2._x, corner1, corner2) && (between((_local3 + _local2._x) + _local2._width, corner1, corner2)))) {
_local1 = findObjByID(_local2._parent._name, 0, 0);
if (_local1) {
if (_local1.originalMovie == "upDown_elevator") {
if (_local1.originalMovie == "upDown_elevator") {
thisFloor = findMovingFloor(_local1.id);
updateWhoOn(thisFloor, thisFloor.clip.floor1);
if (((thisFloor.whoOn.indexOf("|Bruno|") != -1) && (thisFloor.whoOn.indexOf("|Max|") != -1)) && (thisFloor.whoOn.indexOf("|Grundzot|") != -1)) {
_local1.clip._y = _local1.clip._y - 0.3;
_local1.y = _local1.clip._y;
} else if (_local1.y < _local1.maxY) {
_local1.clip._y = _local1.clip._y + 0.3;
_local1.y = _local1.clip._y;
}
}
}
}
return(true);
}
return(false);
}
function alertWhoShouldFall(deadFloor) {
var _local2 = deadFloor;
var _local1;
_local1 = 0;
while (_local1 < characters.length) {
if (characters[_local1].surface == _local2) {
characters[_local1].surfaceType = "";
characters[_local1].surface = null;
characters[_local1].y = characters[_local1].y - 1;
characters[_local1].activateAction("jump");
}
_local1++;
}
_local1 = 0;
while (_local1 < objectDex) {
if (objectSet[_local1].surface == _local2) {
objectSet[_local1].surfaceType = "";
objectSet[_local1].surface = null;
objectSet[_local1].y = objectSet[_local1].y + 1;
objectSet[_local1].attacking = false;
objectSet[_local1].activateAction("jump");
}
_local1++;
}
}
function alertWhoShouldBounce(affectFloor) {
var _local2 = affectFloor;
var _local1;
_local1 = 0;
while (_local1 < characters.length) {
if (characters[_local1].surface == _local2) {
characters[_local1].surfaceType = "";
characters[_local1].surface = null;
characters[_local1].y = characters[_local1].y - 1;
if (_local2._parent.bounceType == "soft") {
characters[_local1].jumpspeed = -maxGravity;
}
if (_local2._parent.bounceType == "medium") {
characters[_local1].jumpspeed = -2 * maxGravity;
}
if (_local2._parent.bounceType == "hard") {
characters[_local1].jumpspeed = -3 * maxGravity;
}
characters[_local1].activateAction("jump");
}
_local1++;
}
_local1 = 0;
while (_local1 < objectDex) {
if (objectSet[_local1].surface == _local2) {
objectSet[_local1].surfaceType = "";
objectSet[_local1].surface = null;
objectSet[_local1].y = objectSet[_local1].y - 1;
if (_local2._parent.bounceType == "soft") {
objectSet[_local1].jumpspeed = -maxGravity;
}
if (_local2._parent.bounceType == "medium") {
objectSet[_local1].jumpspeed = -1.5 * maxGravity;
}
if (_local2._parent.bounceType == "hard") {
objectSet[_local1].jumpspeed = -2 * maxGravity;
}
objectSet[_local1].activateAction("jump");
moveObject(objectSet[_local1], 0, 1);
}
_local1++;
}
}
function attachDot(x, y) {
attachClip.attachMovie("dot", "dot", 999998);
attachClip.dot._x = x;
attachClip.dot._y = y;
attachClip.dot.onPress = function () {
trace((this._x + ",") + this._y);
};
}
function applyDragTracings(mc) {
}
function startTime() {
timeCount = 0;
}
function takeLife() {
var _local1 = _parent;
playerLives = playerLives - 1;
_local1.persistentPlayerLives = playerLives;
lifeIndicator.gotoAndStop(playerLives + "lives");
if (playerLives < 0) {
if (room == 1) {
_local1.persistentPlayerScore = _local1.persistentPlayerScore + playerScore;
} else {
_local1.persistentPlayerScore = playerScore;
}
this.attachMovie("gameOver", "gameIsOver", 0);
} else {
reinstateChar();
}
}
function backFromTheDead() {
var _local2 = Bushy.x;
var _local1 = Bushy.y;
Bushy.x = Bushy.lastKnownGood[0];
Bushy.y = Bushy.lastKnownGood[1];
Bushy.clip._x = Bushy.x;
Bushy.clip._y = Bushy.y;
Bushy.process = true;
Bushy.invincible = true;
Bushy.invincibleCount = 0;
clearInterval(reinstateInterval);
reinstateInterval = null;
centerScreen(Bushy, _local2, Bushy.x, _local1, Bushy.y);
if (Bushy.face == 0) {
Bushy.clip.gotoAndPlay("flashRight");
} else {
Bushy.clip.gotoAndPlay("flashLeft");
}
}
function reinstateChar() {
reinstateInterval = setInterval(backFromTheDead, 250);
}
function centerScreen(ob, xOld, xNew, yOld, yNew) {
var _local1 = ob;
var _local2 = xOld;
var _local3 = yOld;
if (room > 0) {
var dirx = ((xNew - _local2) / Math.abs(xNew - _local2));
var diry = ((yNew - _local3) / Math.abs(yNew - _local3));
var tempX = attachClip._x;
var tempY = attachClip._y;
if (_local2 != xNew) {
if (dirx == 1) {
if (((attachClip._x > minXScroll) && (_local1.x >= ((vWidth / 2) + (_local1.clip._width / 2)))) && (_local1.x <= (levelWidth - ((vWidth / 2) + (_local1.clip._width / 2))))) {
attachClip._x = attachClip._x - (xNew - _local2);
drawStage._x = drawStage._x - (xNew - _local2);
frontScrollers._x = frontScrollers._x - ((xNew - _local2) * 1.5);
}
if (_local1.x >= levelWidth) {
_local1.x = levelWidth;
}
}
if (dirx == -1) {
if (((attachClip._x < maxXScroll) && (_local1.x >= ((vWidth / 2) + (_local1.clip._width / 2)))) && (_local1.x <= (levelWidth - ((vWidth / 2) + (_local1.clip._width / 2))))) {
attachClip._x = attachClip._x - (xNew - _local2);
drawStage._x = drawStage._x - (xNew - _local2);
frontScrollers._x = frontScrollers._x - ((xNew - _local2) * 1.5);
}
if ((_local1.x - _local1.clip._width) <= 0) {
_local1.x = _local1.clip._width;
}
}
}
if (_local3 != yNew) {
if (diry == 1) {
if (attachClip._y > minYScroll) {
attachClip._y = attachClip._y - ((yNew - _local3) / 1.5);
drawStage._y = drawStage._y - ((yNew - _local3) / 1.5);
frontScrollers._y = frontScrollers._y - (((yNew - _local3) * 1.5) / 1.5);
}
if (attachClip._y < minYScroll) {
drawStage._y = drawStage._y + (minYScroll - attachClip._y);
frontScrollers._y = frontScrollers._y + ((minYScroll - attachClip._y) * 1.5);
attachClip._y = minYScroll;
}
}
if (diry == -1) {
if ((attachClip._y < maxYScroll) && (_local1.y < ((vHeight / 2) - attachClip._y))) {
attachClip._y = attachClip._y - ((yNew - _local3) / 1.5);
drawStage._y = drawStage._y - ((yNew - _local3) / 1.5);
frontScrollers._y = frontScrollers._y - (((yNew - _local3) * 1.5) / 1.5);
}
}
}
}
}
function setTurn(ob) {
var _local1 = ob;
var i;
var j;
var thisWall;
var _local2;
var _local3;
var origBL = _local1.rC("bl", "x");
var origBR = _local1.rC("br", "x");
if (_local1.speed != _local1.origSpeed) {
_local1.speed = _local1.origSpeed;
}
_local1.x = _local1.x + _local1.turnOffset[_local1.face];
_local1.y = _local1.y + _local1.turnOffset[_local1.face];
if (_local1.face == 0) {
_local2 = testWalls(_local1, origBL, _local1.rC("br", "x"));
_local3 = 1;
} else {
_local2 = testWalls(_local1, _local1.rC("bl", "x"), origBR);
_local3 = -1;
}
if (_local2 != -1) {
_local1.x = _local2 + _local3;
}
}
function evalObjects() {
var ctext;
var ftext;
var extremes;
var loopAssurance;
var _local3;
var becausePushed;
var fval;
var floorOb;
var _local1;
var whoMoves;
var moveEm;
var loopAssurance = 0;
if (activeChar.face == 0) {
ftext = "r";
} else {
ftext = "l";
}
if (pObjectDex > 0) {
var i;
var _local2;
var aCorner;
var orgX;
var orgY;
i = 0;
while (i < pObjectDex) {
ob = pObjectSet[i];
_local3 = false;
moveEm = false;
fval = 0;
orgX = ob.x;
orgY = ob.y;
if (processObjs) {
loopAssurance = loopAssurance + 1;
}
if ((!ob.pause) && (ob.process)) {
if ((ob.surface != null) && (ob.surfaceType != "moving")) {
if (ob.surface.y) {
if (ob.y != ob.surface.y) {
ob.y = ob.surface.y;
ob.clip._y = ob.y;
if (ob.targetX != null) {
ob.targetX = null;
}
}
}
}
if ((ob.currentAction != "standstill") || (processObjs)) {
_local3 = true;
}
if ((ob.currentAction == "jump") && (ob.surface == null)) {
if (ob.jumpspeed < 0) {
}
}
if (loopAssurance == pObjectDex) {
processObjs = false;
}
if ((ob.process && (ob.actionables[0] == "true")) && (ob.originalMovie.indexOf("seed") != 0)) {
aCorner = activeChar.rC("b" + ftext, "x");
if (activeChar.face == 0) {
testOffset1 = (-activeChar.width) * 0.25;
testOffset2 = 0;
} else {
testOffset1 = 0;
testOffset2 = activeChar.width * 0.25;
}
if ((percentOverlap(aCorner + testOffset1, aCorner + testOffset2, ob.rC("bl", "x"), ob.rC("br", "x"), false) > 0) && (ob.targetX == null)) {
if (activeChar.face == 0) {
extremes = activeChar.rC("br", "y");
} else {
extremes = activeChar.rC("bl", "y");
}
if (percentOverlap(ob.rC("bm", "y") - 15, ob.rC("bm", "y") + 15, extremes - 15, extremes + 15, false) > 0) {
ob.pause = true;
ob.activateAction("pop");
activateSound("pickup");
Bushy.affectPowerBar(5);
_parent.addToCollected(ob.originalMovie, room);
} else {
ob.charActingOn = null;
}
} else {
ob.charActingOn = null;
}
}
if (ob.targetX != null) {
if (ob.targetX > ob.x) {
fval = 1;
}
if (ob.targetX < (ob.x - ob.width)) {
fval = -1;
}
if (ob.targetX == ob.x) {
ob.targetX = null;
}
}
if ((ob.actionables[0] != "true") && (ob.currentAction != "jump")) {
_local3 = false;
}
if ((ob.targetX != null) || (ob.surfaceType == "moving")) {
_local3 = true;
}
if (_local3) {
moveObject(ob, fval, 1);
} else {
ob.charActingOn = null;
if ((ob.currentAction != "standstill") && (!ob.pause)) {
ob.activateAction("standstill");
}
}
if (moveEm && (!ob.hitSolidGround)) {
whoMoves = floorOb.whoOn.split("|");
_local2 = 1;
while (_local2 < (whoMoves.length - 1)) {
_local1 = findObjByID(whoMoves[_local2]);
if (("F_" + _local1.surface._parent._name) == floorOb.id) {
_local1.x = _local1.x + (ob.x - orgX);
_local1.y = _local1.y + (ob.y - orgY);
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
}
_local2++;
}
}
}
i++;
}
}
}
function setTarget(ob, targetX) {
var _local1 = ob;
var _local2 = targetX;
var _local3 = _local1.rC("bm", "x");
if (_local3 != _local2) {
_local1.targetX = _local2;
if (_local1.rC("bm", "x") < _local2) {
if (_local1.face != 0) {
_local1.setFace("right");
}
} else if (_local1.face != 1) {
_local1.setFace("left");
}
}
}
function activateSound(playFrame) {
if (((originalLevelTime - levelTime) > 1) || (playFrame != "land")) {
sounds.gotoAndPlay(playFrame);
}
}
function endLevel() {
var _local1 = _parent;
_local1.levelEndTime = levelTime;
_local1.persistentPlayerScore = playerScore;
_local1.gotoAndStop("summary");
}
function moveObject(ob, dirx, diry) {
var _local1 = ob;
var _local2 = dirx;
var scrollOrigX = _local1.x;
var scrollOrigY = _local1.y;
if (((!_local1.pause) && (_local1.process)) && ((((_local2 != 0) || (!_local1.inAction("standstill"))) || (_local1.surfaceType == "moving")) || (_local1.keyEvents != ""))) {
if (_local1.hardlineRight) {
if (!endMusicStarted) {
endMusicStarted = true;
activateSound("endlevel");
}
if (_local1.x >= levelWidth) {
endLevel();
}
} else if ((_local1.x >= (levelWidth - 250)) && (room > 0)) {
_local1.hardlineRight = true;
activateSound("musicStop");
}
var floorTest;
var ceilingTest;
var _local3;
var jumping;
var tempX;
var tempY;
var tempDir;
var obx;
var theFloorMovie;
tempX = _local1.x;
if (_local2 != 0) {
if (_local2 == 1) {
_local3 = testWalls(_local1, _local1.rC("bl", "x"), _local1.rC("br", "x") + (_local2 * _local1.speed));
} else {
_local3 = testWalls(_local1, _local1.rC("bl", "x") + (_local2 * _local1.speed), _local1.rC("br", "x"));
}
if (_local3 == -1) {
_local1.x = _local1.x + (_local2 * _local1.speed);
} else {
_local1.x = _local3;
}
}
if ((_local2 > 0) && (_local1.face != 0)) {
_local1.setFace("right");
setTurn(_local1);
}
if ((_local2 < 0) && (_local1.face != 1)) {
_local1.setFace("left");
setTurn(_local1);
}
if (_local1.jumpspeed >= 0) {
_local1.clip._rotation = testInclines(_local1);
}
if (_local1.surfaceType != "moving") {
floorTest = testFloors(_local1);
jumping = _local1.inAction("jump");
if ((floorTest == -1) || (_local1.jumpspeed < 0)) {
if (!jumping) {
_local1.activateAction("jump");
jumping = true;
}
if (jumping) {
ceilingTest = -1;
if (_local1.jumpspeed < 0) {
ceilingTest = testCeilings(_local1);
}
if (ceilingTest != -1) {
_local1.jumpspeed = 0;
_local1.y = ceilingTest;
}
_local1.y = _local1.y + _local1.jumpspeed;
tempY = _local1.jumpspeed;
_local1.jumpspeed = _local1.jumpspeed + gravity;
if (((tempY < 0) && (_local1.jumpspeed >= 0)) || (_local1.jumpspeed == 0)) {
_local1.startFall = _local1.y;
}
if (_local1.jumpspeed > 0) {
_local1.assumeAction("fall");
}
if (_local1.jumpspeed >= maxGravity) {
_local1.jumpspeed = maxGravity;
}
}
}
} else {
jumping = false;
}
if ((floorTest == -1) && (_local1.jumpspeed >= 0)) {
floorTest = testMovingFloors(_local1);
if ((_local1.y > (Stage.height + _local1.height)) && (!endMusicStarted)) {
kill(_local1, true);
}
}
if (floorTest != -1) {
if (_local1.isChar && (_local1.surface.isWater)) {
Bushy.activateAction("drown");
Bushy.process = false;
}
if (jumping && (_local1.jumpspeed >= 0)) {
_local1.y = floorTest;
_local1.jumpspeed = 0;
_local1.startFall = _local1.y;
activateSound("land");
_local1.activateAction("standstill");
} else if (_local1.currentAction != "walk") {
_local1.startFall = _local1.y;
_local1.activateAction("standstill");
}
}
if (_local1.currentAction != "jump") {
if ((_local1.currentAction != "walk") && (_local2 != 0)) {
_local1.activateAction("walk");
}
if ((_local2 == 0) && (!_local1.pause)) {
_local1.activateAction("standstill");
}
}
if (_local1.targetX != null) {
obx = _local1.rC("bm", "x");
if (between(_local1.targetX, obx, obx + (_local1.speed * _local2)) || (Math.abs(_local1.x - _local1.targetX) <= 3)) {
_local1.x = _local1.targetX;
_local1.targetX = null;
} else if ((_local1.surface != null) && (_local1.charActingOn != activeChar)) {
if ((_local1.y - _local1.startFall) >= _local1.tooFar) {
_local1.targetX = _local1.x;
_local1.activateAction("felltoofar");
} else if (_local1.originalMovie != "catapult") {
if (dist(_local1.rC("bm", "x"), _local1.y, activeChar.rC("bm", "x"), activeChar.y) > 100) {
_local1.flooredCount = _local1.flooredCount + friction;
_local1.x = _local1.x - ((_local1.speed / _local1.flooredCount) * _local2);
if ((_local1.speed / _local1.flooredCount) < friction) {
_local1.targetX = _local1.x;
_local1.flooredCount = 1;
}
}
}
}
if ((_local1.currentAction != "walk") && (_local1.targetX != null)) {
_local1.activateAction("walk");
}
}
if (_local1.surfaceType == "moving") {
if (_local1.surface != null) {
var dirx2 = 0;
if (!testFloorHorizontals(_local1, _local1.surface)) {
if (_local1.surfaceType == "moving") {
if (_local1.surface._parent._name.indexOf("elevator") != -1) {
freeWeights(_local1);
}
}
_local1.surfaceType = "";
}
_local1.y = _local1.surface._y + _local1.surface._parent._y;
if ((_local1.y > (Stage.height + _local1.height)) && (!endMusicStarted)) {
kill(_local1, true);
}
if ((_local1.surface._x != _local1.surfaceDelta) && (_local1.surfaceDelta != 0)) {
theFloorMovie = _local1.surface._parent._name;
if ((theFloorMovie.indexOf("bridge") != 0) && (theFloorMovie.indexOf("lily_pad") != 0)) {
testCoord = (_local1.x + (_local2 * _local1.speed)) + (_local1.surface._x - _local1.surfaceDelta);
if (_local2 != 0) {
dirx2 = _local2;
}
if (testCoord < _local1.x) {
_local3 = testWalls(_local1, _local1.rC("bl", "x") + (testCoord - _local1.x), _local1.rC("br", "x"));
}
if (testCoord > _local1.x) {
_local3 = testWalls(_local1, _local1.rC("bl", "x"), _local1.rC("br", "x") + (testCoord - _local1.x));
}
if (_local3 == -1) {
_local1.x = _local1.x + (_local1.surface._x - _local1.surfaceDelta);
} else {
_local1.x = _local3;
}
_local1.surfaceDelta = _local1.surface._x;
}
}
} else {
_local1.surfaceType = "";
_local1.activateAction("jump");
_local1.jumpspeed = 1;
}
_local1.startFall = _local1.y;
}
if (_local1.extraInfo == "enemy") {
if (Math.abs(_local1.x - scrollOrigX) > _local1.speed) {
if ((_local1.x - scrollOrigX) > 0) {
_local1.x = scrollOrigX + _local1.speed;
} else {
_local1.x = scrollOrigX - _local1.speed;
}
}
}
_local1.xDelta = _local1.x - _local1.clip._x;
_local1.yDelta = _local1.y - _local1.clip._y;
_local1.clip._x = _local1.x;
if (_local1.clipTrick == 0) {
_local1.clip._y = _local1.y;
} else {
_local1.clip._y = _local1.y + _local1.clipTrick;
_local1.clipTrick = 0;
}
if (_local1.id == activeChar.id) {
testDoors(activeChar);
}
}
if (_local1.isChar) {
if (_local1.hitCounter > 0) {
_local1.hitCounter = _local1.hitCounter - 1;
}
if ((_local1.x != scrollOrigX) || (_local1.y != scrollOrigY)) {
centerScreen(_local1, scrollOrigX, _local1.x, scrollOrigY, _local1.y);
}
}
}
function addDoor(x1, x2, y1, y2, room, oriented, side, id, leavingX, leavingY) {
doorSet[doorDex] = new door(x1, x2, y1, y2, room, oriented, side, id, leavingX, leavingY);
doorDex = doorDex + 1;
}
function door(x1, x2, y1, y2, room, oriented, side, id, leavingX, leavingY) {
var _local1 = this;
_local1.id = id;
_local1.x1 = x1 - 0;
_local1.x2 = x2 - 0;
_local1.y1 = y1 - 0;
_local1.y2 = y2 - 0;
_local1.room = room - 0;
_local1.oriented = oriented - 0;
_local1.side = side;
_local1.leavingX = leavingX;
_local1.leavingY = leavingY;
_local1.subtype = "single";
}
function addCeiling(y, x1, x2, jumpoff, id, clip, libraryName) {
var _local1 = this;
_local1.ceilingArr[_local1.ceilingDex] = new ceiling(y, x1, x2, jumpoff, id, clip, libraryName);
_local1.ceilingDex++;
}
function ceilingSection(sectionIndex) {
var _local1 = this;
_local1.ceilingArr = new Array();
_local1.ceilingDex = 0;
_local1.sectionIndex = sectionIndex;
_local1.addCeiling = addCeiling;
}
function ceiling(y, x1, x2, jumpoff, id, clip, libraryName) {
var _local1 = this;
_local1.originalMovie = libraryName;
_local1.clip = clip;
_local1.id = id;
_local1.y = y;
_local1.x1 = x1;
_local1.x2 = x2;
_local1.jumpoff = jumpoff;
_local1.process = true;
}
function testCeilings(ob) {
var corner1;
var corner2;
var compY;
var _local1;
var cDex;
compY = ob.rC("tm", "y");
var ty1 = Math.floor((((compY + 600) + ob.jumpspeed) - 0) / sectionSize);
var ty2 = Math.floor((compY + 600) / sectionSize);
var ceilingSect = new Array((ty2 - ty1) + 1);
var _local2 = 0;
while (_local2 < ceilingSect.length) {
ceilingSect[_local2] = ceilingSet[ty1 + _local2];
if (ceilingSect[_local2] != null) {
if (ceilingSect[_local2].ceilingDex > 0) {
var _local3 = 0;
while (_local3 < ceilingSect[_local2].ceilingDex) {
_local1 = ceilingSect[_local2].ceilingArr[_local3];
if (between(_local1.y, compY + ob.jumpspeed, compY) && (_local1.process)) {
corner1 = ob.rC("tl", "x");
corner2 = ob.rC("tr", "x");
if ((between(corner1, _local1.x1, _local1.x2) || (between(corner2, _local1.x1, _local1.x2))) || (between(_local1.x1, corner1, corner2) && (between(_local1.x2, corner1, corner2)))) {
return(_local1.y + (ob.y - compY));
}
}
_local3++;
}
}
}
_local2++;
}
return(-1);
}
function addWall(x, y1, y2, id, clip, libraryName) {
var _local1 = this;
_local1.wallArr[_local1.wallDex] = new wall(x, y1, y2, id, clip, libraryName);
_local1.wallDex++;
}
function wallSection(sectionIndex) {
var _local1 = this;
_local1.wallArr = new Array();
_local1.wallDex = 0;
_local1.sectionIndex = sectionIndex;
_local1.addWall = addWall;
}
function wall(x, y1, y2, id, clip, libraryName) {
var _local1 = this;
_local1.originalMovie = libraryName;
_local1.clip = clip;
_local1.id = id;
_local1.x = x;
_local1.y1 = y1;
_local1.y2 = y2;
_local1.processChange = false;
_local1.process = true;
}
function testWalls(ob, x1, x2) {
var _local2 = ob;
var yc1 = _local2.rC("br", "y");
var yc2 = _local2.rC("tr", "y");
var xc1 = _local2.rC("bl", "x");
var xc2 = _local2.rC("br", "x");
var _local3;
var j;
var _local1;
var dirx2;
var retArray = new Array();
var retDex = 0;
var walls = new Array();
var wDex = 0;
var offSet = 0;
_local3 = x1;
while (_local3 <= x2) {
walls[wDex] = wallSet[Math.floor(_local3 / sectionSize)];
wDex = wDex + 1;
_local3 = _local3 + sectionSize;
}
var j = 0;
while (j < wDex) {
if (walls[j].wallDex > 0) {
_local3 = 0;
while (_local3 < walls[j].wallDex) {
_local1 = walls[j].wallArr[_local3];
if (_local1.process) {
if (between(_local1.x, x1, x2)) {
if (percentOverlap(yc1, yc2, _local1.y1, _local1.y2, false) > 0) {
if ((_local1.x >= xc2) || (((_local1.x < xc2) && (_local1.x > xc1)) && (_local2.face == 0))) {
_local2.contactWall = _local1;
retArray[retDex] = ((_local1.x + _local2.x) - xc2) - 1;
retDex = retDex + 1;
}
if ((_local1.x <= xc1) || (((_local1.x > xc1) && (_local1.x < xc2)) && (_local2.face == 1))) {
_local2.contactWall = _local1;
retArray[retDex] = ((_local1.x + _local2.x) - xc1) + 1;
retDex = retDex + 1;
}
}
}
}
_local3++;
}
}
j++;
}
if (retDex > 0) {
if (_local2.surface != null) {
if (_local2.surfaceType == "moving") {
_local2.surfaceType = "";
_local2.activateAction("jump");
}
}
return(retArray[0]);
}
_local2.contactWall = null;
return(-1);
}
function addIncline(x, y, width, height, lowend, clip, libraryName, process) {
inclineSet[inclineDex] = new incline(x, y, width, height, lowend, clip, libraryName, process);
inclineDex = inclineDex + 1;
}
function incline(x, y, width, height, lowend, clip, libraryName, process) {
var _local1 = this;
_local1.originalMovie = libraryName;
_local1.clip = clip;
_local1.x = x;
_local1.y = y;
_local1.width = width;
_local1.height = height;
_local1.degree = toDegrees(Math.atan(height / width));
_local1.lowend = lowend;
_local1.process = process;
}
function testInclines(ob) {
var _local2 = ob;
var gotIncline = 0;
var percentOn = 1;
var mapping = _local2.mapToIncline;
if (inclineDex > 0) {
var texts;
var _local1;
var iX1;
var iX2;
var iY1;
var iY2;
var cX1;
var cY1;
var cX2;
var cY2;
var ly;
var ry;
var _local3;
var alpha;
var c;
var testY;
var testX;
var xSpan;
var ySpan;
var yperx;
var degs;
var c1 = [_local2.rC("bm", "x"), _local2.rC("bm", "y")];
_local1 = 0;
while (_local1 < inclineDex) {
if (inclineSet[_local1].process) {
degs = toRadians(inclineSet[_local1].degree);
iX1 = inclineSet[_local1].x;
iX2 = inclineSet[_local1].x + inclineSet[_local1].width;
iY1 = inclineSet[_local1].y;
iY2 = inclineSet[_local1].y + inclineSet[_local1].height;
percentOn = (c1[0] - iX1) / (iX2 - iX1);
if ((percentOn > 0) && (percentOn < 1)) {
if (inclineSet[_local1].lowend == "left") {
xSpan = c1[0] - iX1;
yperx = inclineSet[_local1].height / inclineSet[_local1].width;
ySpan = xSpan * yperx;
_local3 = (iY1 + inclineSet[_local1].height) - ySpan;
if (Math.abs(c1[1] - _local3) < (sectionSize / 2)) {
_local2.y = _local3;
gotIncline = -1;
}
if (mapping) {
}
} else {
xSpan = iX2 - c1[0];
yperx = inclineSet[_local1].height / inclineSet[_local1].width;
ySpan = xSpan * yperx;
_local3 = (iY1 + inclineSet[_local1].height) - ySpan;
if (Math.abs(_local2.rC("bm", "y") - _local3) < (sectionSize / 2)) {
_local2.y = _local3;
gotIncline = -1;
}
if (mapping) {
}
}
if (gotIncline != 0) {
if ((_local2.y - _local2.startFall) < _local2.tooFar) {
_local2.startFall = _local2.y;
} else {
_local2.activateAction("felltoofar");
}
}
}
}
_local1++;
}
}
return(gotIncline);
}
function actionRouting(pkey, ob) {
var _local2 = ob;
var _local3 = pkey;
var dirx;
var diry;
var _local1;
var cSet;
var flyable;
dirx = 0;
if (_local2.process && (!_local2.hardlineRight)) {
if (activeChar.id == "Bushy") {
if (_local3.indexOf("|1|") != -1) {
dirx = 1;
}
if (_local3.indexOf("|2|") != -1) {
dirx = -1;
}
if (_local3.indexOf("|3|") != -1) {
if (((!_local2.inAction("jump")) && (!_local2.pause)) && (_local2.jumpstart < 0)) {
_local2.jumpspeed = _local2.jumpstart;
_local2.clip._rotation = 0;
_local2.y = _local2.y - 1;
if (_local2.surfaceType == "moving") {
if (_local2.surface._parent._name.indexOf("elevator") != -1) {
freeWeights(_local2);
}
}
_local2.surfaceType = "";
_local2.activateAction("jump");
}
}
if (_local3.indexOf("|4|") != -1) {
if (_local2.surface != null) {
if (_local2.surface.jumpoff) {
_local2.y = _local2.y + 6;
dropCompleted = true;
if (_local2.surfaceType == "moving") {
_local2.y = _local2.y + 10;
_local2.clip._y = _local2.y;
_local2.surface = null;
_local2.surfaceType = "";
}
}
}
}
if (_local3.indexOf("|5|") != -1) {
if (!seedAlive) {
throwSeed(currentSeed);
}
}
if (_local3.indexOf("|a1|") != -1) {
setSeed(1);
}
if (_local3.indexOf("|a2|") != -1) {
setSeed(2);
}
if (_local3.indexOf("|a3|") != -1) {
setSeed(3);
}
if (_local3.indexOf("|a4|") != -1) {
setSeed(4);
}
if (_local3.indexOf("|a5|") != -1) {
setSeed(5);
}
diry = 1;
if (((_local3 != "") || (!_local2.inAction("standstill"))) || (_local2.id == activeChar.id)) {
moveObject(_local2, dirx, diry);
}
} else {
if (Bushy.currentAction != "cast") {
Bushy.pause = true;
Bushy.activateAction("cast");
Bushy.clip.onRelease = releaseBushy;
}
if (activeChar.originalMovie == "flowerGrow") {
var BushyOn = false;
if (Bushy.surfaceType == "moving") {
if (Bushy.surface._parent._name == activeChar.clip._name) {
BushyOn = true;
}
}
var origY = activeChar.clip._y;
var goLeaf = false;
if (_local3.indexOf("|1|") != -1) {
if (activeChar.id != "Bushy") {
releaseBushy();
}
}
if (_local3.indexOf("|2|") != -1) {
if (activeChar.id != "Bushy") {
releaseBushy();
}
}
if (_local3.indexOf("|3|") != -1) {
if ((activeChar.clip._y > ((((-maxYScroll) + Bushy.clip._height) + sectionSize) + 4)) && (Bushy.powerLevel > 0)) {
flowerGrown = true;
activeChar.clip._y = activeChar.clip._y - 4;
attachClip[activeChar.id + "_stem"]._height = attachClip[activeChar.id + "_stem"]._height + 4;
var leafClip = attachClip[activeChar.id + "_leaves"];
if ((activeChar.leafDex == 0) || ((activeChar.leafDex > 0) && (Math.abs(activeChar.lastLeafAttachY - activeChar.clip._y) >= 24))) {
activeChar.lastLeafAttachY = activeChar.clip._y;
goLeaf = true;
}
if (goLeaf) {
goLeaf = false;
leafClip.attachMovie("leafGrow" + activeChar.leafSide, "leaf" + activeChar.leafDex, activeChar.leafDex);
var theLeafClip = leafClip["leaf" + activeChar.leafDex];
theLeafClip._x = 0;
theLeafClip._y = (-attachClip[activeChar.id + "_stem"]._height) + 4;
activeChar.leaves[activeChar.leafDex] = theLeafClip;
activeChar.leafDex++;
activeChar.leafSide = 1 - activeChar.leafSide;
}
Bushy.affectPowerBar(-1);
}
}
if (_local3.indexOf("|4|") != -1) {
if ((activeChar.clip._y < activeChar.minBaseY) && (Bushy.powerLevel > 0)) {
flowerShrunk = true;
activeChar.clip._y = activeChar.clip._y + 4;
attachClip[activeChar.id + "_stem"]._height = attachClip[activeChar.id + "_stem"]._height - 4;
dumpLeaves(activeChar);
Bushy.affectPowerBar(-1);
}
}
var yDiff = (activeChar.clip._y - origY);
if (BushyOn) {
Bushy.clip._y = Bushy.clip._y + yDiff;
Bushy.y = Bushy.clip._y;
}
centerScreen(Bushy, Bushy.clip._x, Bushy.clip._x, origY, activeChar.clip._y);
}
}
_local1 = 0;
while (_local1 < characters.length) {
if ((characters[_local1].id != activeChar.id) && (characters[_local1].process)) {
moveObject(characters[_local1], 0, 1);
}
_local1++;
}
} else if (_local2.hardlineRight) {
moveObject(_local2, 1, 1);
}
}
function toggleMovingFloors(stopThem) {
var _local3 = stopThem;
var i;
var _local2;
var _local1;
var thisClip;
_local2 = 0;
while (_local2 <= moveFloorDex) {
_local1 = moveFloorSet[_local2];
if (_local1.process && (_local1.originalMovie != "pre")) {
if (_local3) {
_local1.clip.stop();
} else {
_local1.clip.play();
}
}
_local2++;
}
}
function affectAllActions(stopAll) {
var _local3 = [characters, enemySet];
var dexArray = [-1, enemyDex];
var _local2;
var _local1;
var k;
var toVal;
var curOb;
if (stopAll) {
Bushy.charFrame = Bushy.clip.movements.char._currentFrame;
Bushy.char.movements.char.stop();
} else if (Bushy.charFrame != 1) {
Bushy.clip.movements.char.gotoAndPlay(Bushy.charFrame - 1);
} else {
Bushy.clip.movements.char.gotoAndPlay(Bushy.charFrame);
}
_local2 = 0;
while (_local2 < _local3.length) {
if (dexArray[_local2] == -1) {
toVal = _local3[_local2].length;
} else {
toVal = dexArray[_local2];
}
_local1 = 0;
while (_local1 < toVal) {
curOb = _local3[_local2][_local1].clip.movements.char;
if (stopAll) {
_local3[_local2][_local1].charFrame = curOb._currentFrame;
curOb.stop();
} else if (_local3[_local2][_local1].charFrame != 1) {
curOb.gotoAndPlay(_local3[_local2][_local1].charFrame - 1);
} else {
curOb.gotoAndPlay(_local3[_local2][_local1].charFrame);
}
_local1++;
}
_local2++;
}
}
function unPauseGame() {
globallyPaused = false;
affectAllActions(false);
this.pauseScreen.removeMovieClip();
if (attachClip.bus_flyover) {
attachClip.bus_flyover.play();
}
}
function pauseGame() {
pauseDelay = new Date().getTime();
if (globallyPaused) {
this.pauseScreen.play();
} else {
globallyPaused = true;
this.attachMovie("pauseScreen", "pauseScreen", 50000);
affectAllActions(true);
if (attachClip.bus_flyover) {
attachClip.bus_flyover.stop();
}
}
}
function affectUpButton(bool) {
upButtonDown = bool;
}
function affectDownButton(bool) {
downButtonDown = bool;
}
function detectKeys() {
var j;
if (((levelTime > 0) && (timeCount >= 0)) && (!globallyPaused)) {
if ((timeCount % 25) == 0) {
levelTime = levelTime - 1;
timeBox.text = levelTime;
if (levelTime <= 0) {
timeCount = -1;
}
}
timeCount++;
}
if (!globallyPaused) {
var _local2 = activeChar;
var _local1 = "";
processCount++;
if (processCount >= 10000) {
processCount = 0;
} else {
if ((processCount % 25) == 0) {
if (Bushy.powerLevel < Bushy.maxPowerLevel) {
Bushy.affectPowerBar(3);
}
}
if (Bushy.invincible) {
if ((processCount % 15) == 0) {
Bushy.invincibleCount++;
if (Bushy.invincibleCount == 6) {
Bushy.invincibleCount = 0;
Bushy.invincible = false;
}
}
}
}
if (Key.isDown(39) || (Key.isDown(68))) {
_local1 = _local1 + "|1|";
}
if (Key.isDown(37) || (Key.isDown(65))) {
_local1 = _local1 + "|2|";
}
if ((Key.isDown(38) || (Key.isDown(87))) || (upButtonDown)) {
_local1 = _local1 + "|3|";
}
if ((Key.isDown(40) || (Key.isDown(83))) || (downButtonDown)) {
_local1 = _local1 + "|4|";
}
if (Key.isDown(32)) {
_local1 = _local1 + "|5|";
}
if ((!activeChar.attacking) && (!activeChar.pause)) {
if (Key.isDown(49)) {
_local1 = _local1 + "|a1|";
}
if (Key.isDown(50)) {
_local1 = _local1 + "|a2|";
}
if (Key.isDown(51)) {
_local1 = _local1 + "|a3|";
}
if (Key.isDown(52)) {
_local1 = _local1 + "|a4|";
}
if (Key.isDown(53)) {
_local1 = _local1 + "|a5|";
}
}
actionRouting(_local1, _local2);
evalObjects();
evalEnemies();
}
if (Key.isDown(80)) {
if ((new Date().getTime() - pauseDelay) > 500) {
pauseGame("");
}
}
_local2.keyEvents = _local1;
}
function releaseBushy() {
regainedControl = true;
activeChar = Bushy;
activeChar.pause = false;
moveControlArrows(Bushy, false);
}
function reactivateBushy() {
activeChar = Bushy;
activeChar.pause = false;
moveControlArrows(Bushy, false);
}
function activateBushy() {
activeChar = Bushy;
lifeIndicator.gotoAndStop(playerLives + "lives");
}
function initCharacters() {
var _local1 = this;
Bushy = new objectDef(attachClip, "Bushy", "Bushy", 300, 410, "-14,0,-72,0,-14,-87,-72,-87,-20,0,-65,0,-20,-87,-65,-87", 4, 100, true, 40, "", "cast,drown,die", 1200);
Bushy.speed = 8;
Bushy.jumpstart = -24;
Bushy.room = room;
Bushy.hitCounter = 0;
Bushy.isChar = true;
Bushy.maxPowerLevel = 200;
Bushy.powerLevel = Bushy.maxPowerLevel;
Bushy.origSpeed = Bushy.speed;
Bushy.hardlineRight = false;
Bushy.lastKnownGood = new Array(Bushy.x, Bushy.y);
Bushy.invincible = false;
Bushy.invincibleCount = 0;
Bushy.affectPowerBar = function (amt) {
var _local1 = this;
_local1.powerLevel = _local1.powerLevel + amt;
if (_local1.powerLevel <= 0) {
_local1.powerLevel = 0;
if (activeChar.id != "Bushy") {
releaseBushy();
}
}
powerMeter.gotoAndStop(Math.floor((_local1.powerLevel / _local1.maxPowerLevel) * 100) + 1);
};
characters[0] = Bushy;
}
function testDoors(ob) {
var _local2 = ob;
var _local1;
var _local3;
var concernedY;
door(x1, x2, y1, y2, room, oriented, side);
_local1 = 0;
while (_local1 < doorDex) {
if (doorSet[_local1].oriented == 0) {
if ((doorSet[_local1].side == "r") && (_local2.face == 0)) {
_local3 = _local2.rC("br", "x");
if (((percentOverlap(_local2.rC("tr", "y"), _local2.rC("br", "y"), doorSet[_local1].y1, doorSet[_local1].y2) > 0) && (_local3 >= doorSet[_local1].x1)) && (Math.abs(_local3 - doorSet[_local1].x1) <= 10)) {
if (((_local2.id == "Max") || (_local2.id == "Bruno")) || (_local2.id == "Grundzot")) {
changeRooms(doorSet[_local1]);
}
}
}
if ((doorSet[_local1].side == "l") && (_local2.face == 1)) {
_local3 = _local2.rC("bl", "x");
if (((percentOverlap(_local2.rC("tl", "y"), _local2.rC("bl", "y"), doorSet[_local1].y1, doorSet[_local1].y2) > 0) && (_local3 <= doorSet[_local1].x1)) && (Math.abs(_local3 - doorSet[_local1].x1) <= 10)) {
if (((_local2.id == "Max") || (_local2.id == "Bruno")) || (_local2.id == "Grundzot")) {
changeRooms(doorSet[_local1]);
}
}
}
} else {
if (doorSet[_local1].side == "t") {
concernedY = _local2.rC("tl", "y");
if (((percentOverlap(_local2.rC("bl", "x"), _local2.rC("br", "x"), doorSet[_local1].x1, doorSet[_local1].x2) > 0) && (concernedY <= doorSet[_local1].y1)) && (Math.abs(concernedY - doorSet[_local1].y1) <= 10)) {
if (((_local2.id == "Max") || (_local2.id == "Bruno")) || (_local2.id == "Grundzot")) {
changeRooms(doorSet[_local1]);
}
}
}
if (doorSet[_local1].side == "b") {
concernedY = _local2.rC("bl", "y");
if (((percentOverlap(_local2.rC("bl", "x"), _local2.rC("br", "x"), doorSet[_local1].x1, doorSet[_local1].x2) > 0) && (concernedY >= doorSet[_local1].y1)) && (Math.abs(concernedY - doorSet[_local1].y1) <= 10)) {
if (((_local2.id == "Max") || (_local2.id == "Bruno")) || (_local2.id == "Grundzot")) {
changeRooms(doorSet[_local1]);
}
}
}
}
_local1++;
}
}
function attachFrontScroller(movieRef, x, y, scale) {
var _local1 = movieRef;
frontScrollers.attachMovie(_local1, _local1 + attachDex[2], attachDex[2]);
frontScrollers[_local1 + attachDex[2]]._xscale = scale;
frontScrollers[_local1 + attachDex[2]]._yscale = scale;
frontScrollers[_local1 + attachDex[2]]._x = x;
frontScrollers[_local1 + attachDex[2]]._y = y;
attachDex[2]++;
}
function affectPlayerScore(scoreAmount) {
playerScore = playerScore + scoreAmount;
scoreBox.text = playerScore;
}
function setScore(scoreMovie, score, xS, yS) {
var _local2 = scoreMovie;
var _local3 = xS;
var scoreText = (score + "");
var _local1 = 0;
while (_local1 < scoreText.length) {
_local2.emptyClip.attachMovie("attach" + scoreText.substring(_local1, _local1 + 1), "number" + _local1, _local1);
_local2.emptyClip["number" + _local1]._x = _local3;
_local2.emptyClip["number" + _local1]._y = yS;
_local3 = _local3 + (_local2.emptyClip["number" + _local1]._width + 2);
_local1++;
}
}
function attachScoreBoard(x, y, score) {
affectPlayerScore(score);
var newMessage;
attachClip.attachMovie("fadeScorer", "fade" + attachDex[2], attachDex[2]);
attachClip["fade" + attachDex[2]]._x = x;
attachClip["fade" + attachDex[2]]._y = y;
setScore(attachClip["fade" + attachDex[2]], score, 0, 0);
attachDex[2]++;
}
function evalPoints(trashObj) {
var _local2 = trashObj;
var _local1;
var _local3 = _local2._name.split("-");
var trashItem = _local3[0];
switch (trashItem) {
case "trash_appleCore" :
_local1 = 50;
break;
case "trash_banana" :
_local1 = 70;
break;
case "trash_napkin" :
_local1 = 100;
break;
case "trash_popcorn" :
_local1 = 150;
break;
case "trash_cup" :
_local1 = 200;
break;
case "trash_popcan" :
_local1 = 400;
break;
case "trash_bottle" :
_local1 = 600;
}
attachScoreBoard(_local2._x - (_local2._width / 2), _local2._y - (_local2._height / 2), _local1);
_local2.removeMovieClip();
}
function attachTrash(movieRef, x, y) {
var _local2 = movieRef;
var _local3 = randomBounded(1, 2) - 1;
var _local1 = new objectDef(attachClip, _local2, (_local2 + "-") + attachDex[1], x, y, "", 1, 100, true, 1, "true|false|false|false|false|false", "pop", 1000);
if (_local3 == 1) {
_local1.setFace("left");
}
_parent.addToTotal(_local2, room);
addPObject(_local1);
}
function easyAddFloor(y, x1, x2, jumpoff) {
var _local1 = y;
floorSet[Math.floor((_local1 + 600) / sectionSize)].addFloor(_local1, x1, x2, jumpoff, (((_local1 + "_") + x1) + "_") + x2, null, "");
}
function easyAddWaterFloor(y, x1, x2, jumpoff) {
var _local1 = y;
floorSet[Math.floor(((_local1 + 600) + 11) / sectionSize)].addWaterFloor(_local1 + 11, x1, x2, jumpoff, ((((_local1 + 11) + "_") + x1) + "_") + x2, null, "");
}
function buildFloor(tileType, numTiles, xStart, yStart, floorID, columnized, jumpoff) {
var _local1;
var _local2;
var _local3;
var tileType;
_local3 = tileType.split("-");
_local1 = 0;
while (_local1 < numTiles) {
if (_local3.length > 1) {
if ((_local1 + 1) > (_local3[2] - 0)) {
tileType = _local3[1];
} else {
tileType = _local3[0];
}
}
if (_local1 == 0) {
_local2 = ("plat_" + tileType) + "_end1_export";
} else if (_local1 == (numTiles - 1)) {
_local2 = ("plat_" + tileType) + "_end2_export";
} else {
_local2 = ("plat_" + tileType) + "_mid_export";
}
if (_local3.length > 1) {
if ((_local1 + 1) == (_local3[2] - 0)) {
_local2 = ((("plat_" + _local3[0]) + "_to_") + _local3[1]) + "_export";
}
}
attachClip.attachMovie(_local2, floorID + _local1, attachDex[3]);
attachClip[floorID + _local1]._x = xStart + (tileSpace * _local1);
attachClip[floorID + _local1]._y = yStart;
attachDex[3]--;
if (columnized != "") {
if (_local1 == 0) {
_local2 = ("column_" + columnized) + "_end1_export";
} else if (_local1 == (numTiles - 1)) {
_local2 = ("column_" + columnized) + "_end2_export";
} else {
_local2 = ("column_" + columnized) + "_mid_export";
}
attachClip.attachMovie(_local2, ("column_" + floorID) + _local1, attachDex[3]);
attachClip[("column_" + floorID) + _local1]._x = xStart + (tileSpace * _local1);
attachClip[("column_" + floorID) + _local1]._y = yStart;
attachDex[3]--;
}
_local1++;
}
floorSet[Math.floor((yStart + 600) / sectionSize)].addFloor(yStart + (tileHeight / 2), xStart + tileOffset, (xStart + tileOffset) + (tileSpace * numTiles), jumpoff, floorID, null, "");
}
function addWater(xStart, yStart, totalWidth) {
var _local1;
var _local2;
var _local3;
_local1 = ("water_" + attachDex[3]) + "_left";
attachClip.attachMovie("water_left", _local1, attachDex[3]);
attachClip[_local1]._x = xStart;
attachClip[_local1]._y = yStart;
attachDex[3]--;
_local2 = ("water_" + attachDex[3]) + "_mid";
attachClip.attachMovie("water_mid", _local2, attachDex[3]);
attachClip[_local2]._width = totalWidth - (attachClip[_local1]._width * 2);
attachClip[_local2]._x = xStart + attachClip[_local1]._width;
attachClip[_local2]._y = yStart;
attachDex[3]--;
_local3 = ("water_" + attachDex[3]) + "_right";
attachClip.attachMovie("water_right", _local3, attachDex[3]);
attachClip[_local3]._x = (xStart + attachClip[_local1]._width) + attachClip[_local2]._width;
attachClip[_local3]._y = yStart;
attachDex[3]--;
}
function throwSeed(seedType) {
if (Bushy.powerLevel >= Math.abs(seedCost[seedType - 1])) {
seedAlive = true;
var _local2;
var _local3;
if (activeChar.face == 0) {
_local2 = "br";
_local3 = -5;
} else {
_local2 = "bl";
_local3 = 5;
}
var _local1 = new objectDef(attachClip, "seed" + seedType, (("seed" + seedType) + "-") + attachDex[1], activeChar.rC(_local2, "x") + _local3, activeChar.rC(_local2, "y") - (activeChar.clip._height / 3), "", 1, 100, true, 1, "true|false|false|false|false|false", "die", 1000);
addPObject(_local1);
_local1.jumpspeed = -10;
if (activeChar.face == 1) {
_local1.setFace("left");
}
_local1.speed = 5;
setTarget(_local1, activeChar.rC(_local2, "x") + (_local3 * -20));
_local1.charFace = Bushy.face;
} else {
activateSound("cancel");
}
}
function moveControlArrows(ob, movingIn) {
if (movingIn) {
controlArrows._x = ob.x + attachClip._x;
controlArrows._y = _ymouse;
} else {
controlArrows._x = -100;
controlArrows._y = -100;
}
}
function processSeed(seedObject) {
var _local2 = seedObject;
var _local3 = _local2.originalMovie.substring(4, 5);
var _local1;
switch (_local3) {
case "1" :
seedThrown1 = true;
attachClip.attachMovie("stem", ("flower" + (attachDex[1] + 3)) + "_stem", attachDex[1]);
attachClip[("flower" + (attachDex[1] + 3)) + "_stem"]._x = ob.x - (ob.clip._width / 2);
attachClip[("flower" + (attachDex[1] + 3)) + "_stem"]._y = ob.y;
attachDex[1]++;
attachClip.attachMovie("attachClip", ("flower" + (attachDex[1] + 2)) + "_leaves", attachDex[1]);
attachClip[("flower" + (attachDex[1] + 2)) + "_leaves"]._x = ob.x - (ob.clip._width / 2);
attachClip[("flower" + (attachDex[1] + 2)) + "_leaves"]._y = ob.y;
attachDex[1]++;
_local1 = new objectDef(attachClip, "flowerGrow", "flower" + (attachDex[1] + 1), ob.x - (ob.clip._width / 2), ob.y, "", 1, 100, true, 1, "false|false|false|false|false|false", "grow", 1000);
addObject(_local1);
addMovingFloor(attachClip[_local1.id], true, 1, "pre");
attachClip[_local1.id].onRelease = function () {
var _local2 = this;
if ((Bushy.currentAction != "jump") && (Bushy.powerLevel > 0)) {
var _local1 = findObjByID(_local2._name, _local2._x, _local2._y);
activeChar = _local1;
moveControlArrows(_local1, true);
} else if (Bushy.powerLevel == 0) {
activateSound("cancel");
}
};
_local1.minBaseY = attachClip[_local1.id + "_stem"]._y;
_local1.leaves = new Array();
_local1.leafDex = 0;
_local1.leafSide = 0;
Bushy.affectPowerBar(seedCost[_local3 - 1]);
break;
case "2" :
var theVine;
seedThrown2 = true;
if (_local2.charFace == 0) {
theVine = "bridgeBloomGrow_right";
} else {
theVine = "bridgeBloomGrow_left";
}
_local1 = new objectDef(attachClip, theVine, "bridge" + (attachDex[1] + 1), ob.x - (ob.clip._width / 2), ob.y, "", 1, 100, true, 1, "false|false|false|false|false|false", "", 1000);
addObject(_local1);
addMovingFloor(attachClip[_local1.id], true, 1, "pre");
Bushy.affectPowerBar(seedCost[_local3 - 1]);
break;
case "3" :
_local1 = new objectDef(attachClip, "snareVines", "snareVines" + (attachDex[1] + 1), ob.x - (ob.clip._width / 2), ob.y, "", 1, 100, true, 1, "false|false|false|false|false|false", "", 1000);
addObject(_local1);
Bushy.affectPowerBar(seedCost[_local3 - 1]);
break;
case "4" :
if (_local2.surface.isWater) {
_local1 = new objectDef(attachClip, "lily_pad" + randomBounded(1, 2), "lily_pad" + (attachDex[1] + 1), ob.x - (ob.clip._width / 2), ob.y, "", 1, 100, true, 1, "false|false|false|false|false|false", "", 1000);
addObject(_local1);
addMovingFloor(attachClip[_local1.id], true, 1, "pre");
Bushy.affectPowerBar(seedCost[_local3 - 1]);
} else {
_local2.activateAction("die");
_local2.process = false;
}
break;
case "5" :
if (_local2.face == 0) {
movieAttacher(attachClip, "catapultLeafGrow", "catapultLeafGrow" + (attachDex[1] + 1), ob.x - (ob.clip._width / 2), ob.y, 100, 1);
} else {
movieAttacher(attachClip, "catapultLeafGrow_left", "catapultLeafGrow" + (attachDex[1] + 1), ob.x - (ob.clip._width / 2), ob.y, 100, 1);
}
Bushy.affectPowerBar(seedCost[_local3 - 1]);
}
if ((_local2.surface.isWater && (_local2.originalMovie == "seed4")) || (_local2.originalMovie != "seed4")) {
kill(_local2, true);
}
}
function setSeed(seedNum) {
var _local2 = seedNum;
var _local1;
if (seedStatus[_local2 - 1] != "locked") {
if (_local2 == 2) {
seedSelected2 = true;
}
_local1 = 0;
while (_local1 < seedStatus.length) {
if (seedStatus[_local1] != "locked") {
seedStatus[_local1] = "inactive";
}
_local1++;
}
seedStatus[_local2 - 1] = "active";
currentSeed = _local2;
seedSet.gotoAndStop("seed" + _local2);
} else {
activateSound("cancel");
}
}
function incrementSeed() {
var _local1;
var _local3 = currentSeed;
var _local2 = new Array(seedStatus.length - 1);
_local1 = 0;
while (_local1 < _local2.length) {
if ((currentSeed + (_local1 + 1)) > seedStatus.length) {
_local2[_local1] = (currentSeed + (_local1 + 1)) - seedStatus.length;
} else {
_local2[_local1] = currentSeed + (_local1 + 1);
}
_local1++;
}
_local1 = 0;
while (_local1 < _local2.length) {
if (seedStatus[_local2[_local1] - 1] != "locked") {
setSeed(_local2[_local1]);
break;
}
_local1++;
}
if (currentSeed == _local3) {
activateSound("cancel");
}
}
function replaceWithCatapult(theClip, nameExtra) {
var _local2 = theClip;
var _local1 = new objectDef(attachClip, "catapultLeaf" + nameExtra, "catapultLeaf" + (attachDex[1] + 1), _local2._x, _local2._y, "", 1, 100, true, 1, "false|false|false|false|false|false", "", 1000);
addMovingFloor(attachClip[_local1.id], true, 1, "pre");
addObject(_local1);
_local2.removeMovieClip();
}
function dumpLeaves(flowerObject) {
var _local2 = (-attachClip[activeChar.id + "_stem"]._height) + 4;
var _local1 = 0;
while (_local1 < activeChar.leafDex) {
if (activeChar.leaves[_local1]._y <= _local2) {
activeChar.leaves[_local1].gotoAndPlay("recede");
}
_local1++;
}
}
function simpleAttachNonObject(attachTo, movieRef, dexDex, x, y, scale) {
var _local1 = dexDex;
var _local2 = movieRef;
var _local3 = attachTo;
_local3.attachMovie(_local2, _local2 + attachDex[_local1], attachDex[_local1]);
_local3[_local2 + attachDex[_local1]]._x = x;
_local3[_local2 + attachDex[_local1]]._y = y;
_local3[_local2 + attachDex[_local1]]._xscale = scale;
_local3[_local2 + attachDex[_local1]]._yscale = scale;
attachDex[_local1]++;
}
function lesson1() {
var _local1 = "Starting with the basics, first walk the character to the right using either the \"D\" key, or the right arrow key on your keyboard.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if ((processCount % 5) == 0) {
lessonOriginalX = Bushy.x;
}
if (Bushy.x > lessonOriginalX) {
lessonOriginalX = Bushy.x;
nextLesson();
}
}
function lesson2() {
var _local1 = "Great!, now move to the left using either the \"A\" key or the \"LEFT\" arrow key on your keyboard.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if ((processCount % 5) == 0) {
lessonOriginalX = Bushy.x;
}
if (Bushy.x < lessonOriginalX) {
lessonOriginalY = Bushy.y;
nextLesson();
}
}
function lesson3() {
var _local1 = "Good job! Now we're going to get Bushy to jump using either the \"W\" key, or by pressing the \"UP\" arrow key on your keyboard.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if ((Bushy.y < lessonOriginalY) && (Bushy.surfaceType == "")) {
dropCompleted = false;
buildFloor("grass", 5, 300, 325, "grass2", "rock", true);
nextLesson();
}
}
function lesson4() {
var _local1 = "Way to go! Next we'll try using the \"DOWN\" arrow key to drop from that ledge that appeared and Bushy can jump to. First, jump onto the ledge, and once you're on, press the down arrow key to drop back to the lower ground.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (dropCompleted) {
Bushy.powerLevel = Bushy.maxPowerLevel;
seedThrown1 = false;
nextLesson();
}
}
function lesson5() {
var _local1 = "Excellent! That's about it for the basics... moving on to the more advanced stuff, we're going to try and use some of Bushy's seed powers. Press the number \"1\" key to select the first seed in Bushy's arsenal. Once this has been done, press and release the space bar on the keyboard to throw the seed.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (seedThrown1) {
Bushy.powerLevel = Bushy.maxPowerLevel;
flowerGrown = false;
nextLesson();
}
}
function lesson6() {
var _local1 = "Very good! Note that this flower is a platform on which Bushy can stand. If you want, you can even ride it as you control it! Now we're going to have Bushy take control of the flower and try to raise it. Click the flower itself to take possession of it, Bushy will begin to meditate.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (Bushy.currentAction == "cast") {
Bushy.powerLevel = Bushy.maxPowerLevel;
nextLesson();
}
}
function lesson7() {
var _local1 = "Good one! Next, use either the \"W\" or up arrow key to make the flower grow!";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (flowerGrown) {
Bushy.powerLevel = Bushy.maxPowerLevel;
flowerShrunk = false;
nextLesson();
}
}
function lesson8() {
var _local1 = "You're doing great! Now we're going make the flower shrink! While possessing the flower (click on it if Bushy is no longer in meditation mode) press either the \"S\" or down arrow key on the keyboard to make the flower shrink.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (flowerShrunk) {
regainedControl = false;
nextLesson();
}
}
function lesson9() {
var _local1 = "Wonderful! Now we need to get back our control of Bushy. To control Bushy again, either click him, or use either the \"A\" (left-arrow) or \"D\" (right-arrow) keys on the keyboard to become Bushy again.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (regainedControl) {
Bushy.powerLevel = Bushy.maxPowerLevel;
seedSelected2 = false;
nextLesson();
}
}
function lesson10() {
var _local1 = "Fantastic! Last we'll try using the other seed. Either use the \"2\" key on the keyboard, or click the seed-display in the upper-left hand corner of the screen, or press the \"P\" key to enter the pause menu and click the second seed available to you to select the second seed.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (seedSelected2) {
Bushy.powerLevel = Bushy.maxPowerLevel;
seedThrown2 = false;
nextLesson();
}
}
function lesson11() {
var _local1 = "Wow! Have you done this before? Now throw this seed to create a bridge that Bushy can walk on, and use to cross pits or make his way through tree-tops.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
if (seedThrown2) {
Bushy.powerLevel = Bushy.maxPowerLevel;
attachClip.tutTextMovie.FinishButton._visible = true;
nextLesson();
}
}
function lesson12() {
var _local1 = "A few last notes. Check out the display at top-left. Here you see the seed selected, the number of points you have, time left on the level (this is only for bonus points), and the log filled with the green bar. This is your power bar. If you have no power, you can't use seeds! Watch this meter and try to conserve energy. Click \"Finish\" below to return to the menu.";
if (attachClip.tutTextMovie.tutText.text != _local1) {
attachClip.tutTextMovie.tutText.text = _local1;
}
}
function returnToMenu() {
var _local1 = _parent;
_local1.persistentPlayerScore = 0;
_local1.persistentPlayerlives = 3;
_local1.level = 1;
activateSound("musicStop");
_local1.gotoAndPlay("menu");
}
function nextLesson() {
lessonOriginalX = Bushy.x;
if (tutDex >= 0) {
activateSound("pickup");
}
tutDex++;
attachClip.tutTextMovie.onEnterFrame = tutLessons[tutDex];
}
function room0() {
levelWidth = vWidth;
levelHeight = vHeight;
levelTime = 999;
timeBox.text = levelTime;
seedStatus = new Array("active", "inactive", "locked", "locked", "locked");
setSeed(1);
activateBushy();
affectPlayerScore(0);
startTime();
buildFloor("grass", 25, -50, 400, "grass1", "rock", false);
wallSet[0].addWall(0, -500, 2000, "leftwall", null, "");
wallSet[Math.floor(levelWidth / sectionSize)].addWall(levelWidth, -500, 2000, "rightwall", null, "");
attachClip.attachMovie("tutorialTextBox", "tutTextMovie", 99765);
attachClip.tutTextMovie.tutText.text = "In order to start the tutorial, click the \"Start\" button below.";
}
function room1() {
var temp;
levelTime = 120;
timeBox.text = levelTime;
seedStatus = new Array("active", "inactive", "locked", "locked", "locked");
attachClip.attachMovie("bus_flyover", "bus_flyover", 9);
simpleAttachNonObject(attachClip, "tree", 0, 1900, 470, 100);
simpleAttachNonObject(attachClip, "tree_branch1", 0, 1690, 293, 100);
easyAddFloor(225, 1820, 1990, true);
simpleAttachNonObject(attachClip, "tree_branch2", 0, 2066, 245, 100);
easyAddFloor(175, 2065, 2255, true);
simpleAttachNonObject(attachClip, "tree_branch2", 0, 2066, 0, 100);
easyAddFloor(-70, 2065, 2255, true);
wallSet[0].addWall(-50, -500, 1000, "leftwall", null, "");
wallSet[Math.floor(levelWidth / sectionSize)].addWall(levelWidth, -500, 1000, "rightwall", null, "");
buildFloor("grass", 10, -100, 400, "grass1", "rock", false);
buildFloor("grass", 4, 438, 360, "grass2", "rock", false);
wallSet[Math.floor(450 / sectionSize)].addWall(450, 371, 1000, "miniwall1", null, "");
buildFloor("grass", 24, 650, 500, "grass3", "rock", false);
wallSet[Math.floor(650 / sectionSize)].addWall(668, 371, 1000, "miniwall2", null, "");
buildFloor("grass", 4, 1150, 430, "grass4", "rock", true);
buildFloor("grass", 4, 1500, 400, "grass5", "rock", true);
buildFloor("grass-rock-5", 8, 1800, 368, "grass6", "rock", false);
simpleAttachNonObject(attachClip, "tree", 0, 2900, 400, 125);
simpleAttachNonObject(attachClip, "tree_branch1", 0, 2710, -265, 100);
easyAddFloor(-335, 2840, 3010, true);
simpleAttachNonObject(attachClip, "tree_branch2", 0, 3109, 145, 100);
easyAddFloor(75, 3108, 3298, true);
simpleAttachNonObject(attachClip, "tree", 0, 3656, 237, 100);
simpleAttachNonObject(attachClip, "tree_branch1", 0, 3440, 145, 100);
easyAddFloor(75, 3570, 3740, true);
simpleAttachNonObject(attachClip, "tree_branch2", 0, 3822, -53, 100);
easyAddFloor(-123, 3821, 4011, true);
buildFloor("grass", 8, 3550, 420, "grass6", "rock", false);
buildFloor("grass", 5, 3650, 220, "grass7", "rock", true);
buildFloor("grass", 8, 4000, 420, "grass8", "rock", false);
buildFloor("rock", 3, 2800, 500, "rock1", "rock", false);
buildFloor("rock-grass-5", 10, 2610, 300, "rock2", "rock", true);
buildFloor("rock", 6, 2620, 0, "rock3", "rock", true);
simpleAttachNonObject(attachClip, "rock_precipice_cliff", 1, 2452, 0, 100);
easyAddFloor(10.65, 2455, 2650, true);
buildFloor("rock", 3, 3300, 570, "rock4", "rock", false);
buildFloor("rock", 3, 4430, 250, "rock5", "rock", false);
wallSet[Math.floor(4450 / sectionSize)].addWall(4450, 262, 1000, "miniwall3", null, "");
buildFloor("rock", 6, 4700, 250, "rock6", "rock", false);
simpleAttachNonObject(attachClip, "treeFungus2", 1, 2910, 190, 100);
easyAddFloor(190, 2910, 3060, true);
simpleAttachNonObject(attachClip, "treeFungus1", 1, 3090, 250, 65);
easyAddFloor(250, 3090, 3190, true);
simpleAttachNonObject(attachClip, "treeFungus1", 1, 3785, 122, 100);
easyAddFloor(122, 3785, 3935, true);
simpleAttachNonObject(attachClip, "tree", 0, 4750, 325, 100);
simpleAttachNonObject(attachClip, "treeFungus2", 1, 4737, 184, 100);
easyAddFloor(184, 4737, 4887, true);
simpleAttachNonObject(attachClip, "treeFungus1", 1, 4882, 119, 80);
easyAddFloor(119, 4882, 5000, true);
simpleAttachNonObject(attachClip, "treeFungus2", 1, 4775, 64, 65);
easyAddFloor(64, 4775, 4875, true);
simpleAttachNonObject(attachClip, "tree_branch2", 0, 4915, 80, 100);
easyAddFloor(10, 4915, 5105, true);
simpleAttachNonObject(attachClip, "tree_branch2", 0, 4915, -180, 100);
easyAddFloor(-250, 4915, 5105, true);
buildFloor("grass", 10, 5400, 250, "grass9", "rock", false);
attachTrash("trash_cup", 850, 510);
attachTrash("trash_popcorn", 1300, 440);
attachTrash("trash_bottle", 1700, 398);
attachTrash("trash_appleCore", 2200, 174);
simpleAttachNonObject(attachClip, "seed_sign", 1, 2220, 370, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed2");
simpleAttachNonObject(attachClip, "seed_sign", 1, 3425, 572, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed1");
simpleAttachNonObject(attachClip, "seed_sign", 1, 4365, 420, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed1");
applyDragTracings(attachClip["seed_sign" + (attachDex[1] - 1)]);
attachTrash("trash_banana", 2700, 310);
attachTrash("trash_popcan", 2950, 510);
attachTrash("trash_bottle", 2960, -336);
attachTrash("trash_napkin", 3680, 430);
attachTrash("trash_cup", 3425, 580);
attachTrash("trash_popcorn", 4850, 260);
attachTrash("trash_cup", 5000, 9);
attachTrash("trash_popcan", 5050, -251);
attachFrontScroller("tree", 600, 700, 100);
attachFrontScroller("tree", 2000, 700, 100);
attachFrontScroller("tree", 2200, 775, 65);
attachFrontScroller("tree", 4000, 650, 125);
attachFrontScroller("tree", 5000, 700, 100);
attachFrontScroller("tree", 6500, 740, 80);
attachFrontScroller("tree", 6600, 730, 90);
}
function attachMushroomSpring(x, y) {
var _local1 = new objectDef(attachClip, "mushroom_spring", "mushroom_spring" + (attachDex[1] + 1), x, y, "", 1, 100, true, 1, "false|false|false|false|false|false", "", 1000);
addObject(_local1);
addMovingFloor(attachClip[_local1.id], true, 1, "pre");
}
function room2() {
var temp;
levelTime = 160;
timeBox.text = levelTime;
levelWidth = 8000;
minXScroll = (-levelWidth) + vWidth;
maxYScroll = levelHeight - vHeight;
seedStatus = new Array("active", "inactive", "inactive", "inactive", "locked");
setSeed(1);
wallSet[0].addWall(-50, -500, 1000, "leftwall", null, "");
wallSet[Math.floor(levelWidth / sectionSize)].addWall(levelWidth, -500, 1000, "rightwall", null, "");
buildFloor("marsh", 10, -50, 400, "marsh1", "marsh", false);
wallSet[Math.floor(784 / sectionSize)].addWall(784, 511, 1000, "subwall", null, "");
buildFloor("marsh", 6, 450, 500, "marsh2", "marsh", false);
wallSet[Math.floor(500 / sectionSize)].addWall(500, 412, 1000, "subwall2", null, "");
simpleAttachNonObject(attachClip, "seed_sign", 1, 750, 500, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed4");
simpleAttachNonObject(attachClip, "seed_sign", 1, 1978, 450, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed4");
attachMushroomSpring(540, 380);
activateBushy();
affectPlayerScore(0);
startTime();
attachFrontScroller("catTail", 300, 400, 60);
attachFrontScroller("catTail", 1200, 370, 60);
attachFrontScroller("catTail2", 1100, 425, 50);
attachFrontScroller("catTail", 3500, 425, 50);
attachFrontScroller("catTail2", 3400, 370, 60);
attachFrontScroller("catTail", 5000, 425, 50);
attachFrontScroller("catTail2", 4900, 370, 60);
attachFrontScroller("catTail", 5750, 400, 60);
attachFrontScroller("catTail2", 6500, 425, 50);
attachFrontScroller("catTail", 8500, 370, 60);
attachFrontScroller("catTail2", 8400, 425, 50);
attachFrontScroller("catTail", 10000, 370, 60);
addWater(715, 515, 500);
easyAddWaterFloor(515, 715, 1215, false);
buildFloor("marsh", 3, 900, 200, "marsh3", "marsh", true);
simpleAttachNonObject(attachClip, "tree_marsh", 0, 300, 470, 100);
simpleAttachNonObject(attachClip, "tree_marsh_branch1", 0, 90, 293, 100);
easyAddFloor(225, 220, 390, true);
simpleAttachNonObject(attachClip, "tree_marsh_branch2", 0, 466, 245, 100);
easyAddFloor(175, 465, 655, true);
simpleAttachNonObject(attachClip, "tree_marsh_branch2", 0, 466, 0, 100);
easyAddFloor(-70, 465, 655, true);
simpleAttachNonObject(attachClip, "tree_marsh", 0, 857, 248, 100);
simpleAttachNonObject(attachClip, "tree_marsh_branch1", 0, 645, -77, 100);
easyAddFloor(-145, 775, 945, true);
simpleAttachNonObject(attachClip, "tree_marsh_branch2", 0, 1023, -72, 100);
easyAddFloor(-145, 1022, 1212, true);
buildFloor("marsh", 6, 1185, 450, "marsh2", "marsh", false);
wallSet[Math.floor(1195 / sectionSize)].addWall(1195, 461, 1000, "subwall3", null, "");
addEnemy("wigbeast1", "Wigbeast", 1300, 449, "false|false|false|false|false|true", "", true, true, "250,250");
addWater(1400, 515, 300);
easyAddWaterFloor(515, 1400, 1700, false);
buildFloor("marsh", 6, 1675, 450, "marsh6", "marsh", false);
buildFloor("marsh", 3, 1200, 170, "marsh3", "marsh", true);
buildFloor("marsh", 2, 1400, 200, "marsh4", "marsh", true);
buildFloor("marsh", 3, 1600, 150, "marsh5", "marsh", true);
attachMushroomSpring(1400, 81);
addWater(2000, 515, 800);
easyAddWaterFloor(515, 2000, 2800, false);
buildFloor("marsh", 4, 2200, 300, "marsh6", "marsh", true);
buildFloor("marsh", 3, 2230, 150, "marsh7", "marsh", true);
buildFloor("marsh", 2, 2260, 0, "marsh8", "marsh", true);
buildFloor("marsh", 5, 2775, 450, "marsh9", "marsh", false);
addEnemy("wigbeast2", "Wigbeast", 2900, 449, "false|false|false|false|false|true", "", true, true, "125,125");
addWater(3000, 515, 600);
easyAddWaterFloor(515, 3000, 3600, false);
buildFloor("marsh", 3, 3100, 450, "marsh10", "marsh", false);
buildFloor("marsh", 3, 3300, 450, "marsh11", "marsh", false);
buildFloor("marsh", 5, 3150, 300, "marsh12", "marsh", true);
simpleAttachNonObject(attachClip, "tree_marsh", 0, 3150, 470, 100);
simpleAttachNonObject(attachClip, "tree_marsh_branch1", 0, 2940, 293, 100);
easyAddFloor(225, 3070, 3240, true);
simpleAttachNonObject(attachClip, "tree_marsh_branch2", 0, 3316, 245, 100);
easyAddFloor(175, 3315, 3505, true);
simpleAttachNonObject(attachClip, "tree_marsh_branch2", 0, 3316, 0, 100);
easyAddFloor(-70, 3315, 3505, true);
buildFloor("marsh", 4, 3575, 400, "marsh13", "marsh", false);
wallSet[Math.floor(3595 / sectionSize)].addWall(3595, 411, 1000, "subwall4", null, "");
addWater(3750, 515, 600);
easyAddWaterFloor(515, 3750, 4350, false);
buildFloor("marsh", 5, 3900, 470, "marsh14", "marsh", false);
attachMushroomSpring(3375, 330);
simpleAttachNonObject(attachClip, "tree_marsh", 0, 3915, 490, 100);
simpleAttachNonObject(attachClip, "tree_marsh_branch1", 0, 3699, 380, 100);
easyAddFloor(310, 3829, 3999, true);
simpleAttachNonObject(attachClip, "tree_marsh_branch2", 0, 4083, 319, 100);
easyAddFloor(249, 4082, 4272, true);
buildFloor("marsh", 5, 4325, 450, "marsh15", "marsh", false);
addWater(4600, 515, 150);
easyAddWaterFloor(515, 4600, 4750, false);
buildFloor("marsh", 4, 4725, 425, "marsh16", "marsh", false);
addEnemy("wigbeast3", "Wigbeast", 4865, 399, "false|false|false|false|false|true", "", true, true, "125,125");
addWater(4950, 515, 150);
easyAddWaterFloor(515, 4950, 5100, false);
buildFloor("marsh", 3, 5075, 400, "marsh17", "marsh", false);
addWater(5250, 515, 150);
easyAddWaterFloor(515, 5250, 5400, false);
buildFloor("marsh", 2, 5375, 370, "marsh18", "marsh", false);
buildFloor("marsh", 10, 5470, 480, "marsh19", "marsh", false);
wallSet[Math.floor(5470 / sectionSize)].addWall(5490, 382, 1000, "subwall5", null, "");
attachMushroomSpring(5600, 360);
simpleAttachNonObject(attachClip, "tree_marsh", 0, 5750, 490, 100);
simpleAttachNonObject(attachClip, "tree_marsh_branch1", 0, 5537, 120, 100);
easyAddFloor(50, 5667, 5837, true);
simpleAttachNonObject(attachClip, "tree_marsh_branch2", 0, 5916, 120, 100);
easyAddFloor(50, 5915, 6105, true);
addWater(6000, 515, 1200);
easyAddWaterFloor(515, 6000, 7200, false);
buildFloor("marsh", 2, 6300, 450, "marsh20", "marsh", false);
attachMushroomSpring(6300, 330);
buildFloor("marsh", 2, 6550, 450, "marsh21", "marsh", false);
attachMushroomSpring(6550, 330);
buildFloor("marsh", 2, 6800, 450, "marsh22", "marsh", false);
attachMushroomSpring(6800, 330);
buildFloor("marsh", 2, 7050, 450, "marsh23", "marsh", false);
buildFloor("marsh", 15, 7175, 370, "marsh24", "marsh", false);
attachTrash("trash_popcorn", 300, 225);
attachTrash("trash_bottle", 850, -145);
attachTrash("trash_popcan", 1000, 210);
attachTrash("trash_cup", 1300, 180);
attachTrash("trash_banana", 1875, 460);
attachTrash("trash_appleCore", 2350, 10);
attachTrash("trash_napkin", 2325, 310);
attachTrash("trash_bottle", 2900, 449);
attachTrash("trash_napkin", 3170, 224);
attachTrash("trash_popcan", 3415, -71);
attachTrash("trash_popcorn", 4150, 248);
attachTrash("trash_cup", 4000, 481);
attachTrash("trash_bottle", 4865, 399);
attachTrash("trash_appleCore", 5730, 49);
attachTrash("trash_napkin", 7125, 449);
attachTrash("trash_popcorn", 6650, 449);
}
function attachBouncyGoat(x, y) {
var _local1 = new objectDef(attachClip, "wiggi_goat", "wiggi_goat" + (attachDex[1] + 1), x, y, "", 1, 100, true, 1, "false|false|false|false|false|false", "", 1000);
addObject(_local1);
addMovingFloor(attachClip[_local1.id], true, 1, "pre");
}
function room3() {
var temp;
levelTime = 180;
timeBox.text = levelTime;
levelWidth = 12000;
minXScroll = (-levelWidth) + vWidth;
maxYScroll = levelHeight - vHeight;
seedStatus = new Array("active", "inactive", "inactive", "inactive", "inactive");
setSeed(1);
attachFrontScroller("mountain_spike", 100, 625, 100);
attachFrontScroller("mountain_spike", 600, 640, 100);
attachFrontScroller("mountain_spike", 1000, 600, 100);
attachFrontScroller("mountain_spike", 1200, 600, 80);
attachFrontScroller("mountain_spike", 2000, 610, 100);
attachFrontScroller("mountain_spike", 2100, 750, 100);
attachFrontScroller("mountain_spike", 3500, 600, 100);
attachFrontScroller("mountain_spike", 4000, 625, 100);
attachFrontScroller("mountain_spike", 5000, 600, 100);
attachFrontScroller("mountain_spike", 5250, 610, 80);
attachFrontScroller("mountain_spike", 6000, 610, 100);
attachFrontScroller("mountain_spike", 7200, 640, 100);
attachFrontScroller("mountain_spike", 8000, 625, 100);
attachFrontScroller("mountain_spike", 8250, 610, 80);
attachFrontScroller("mountain_spike", 8400, 600, 60);
attachFrontScroller("mountain_spike", 9000, 600, 100);
attachFrontScroller("mountain_spike", 9800, 640, 100);
attachFrontScroller("mountain_spike", 10400, 600, 80);
attachFrontScroller("mountain_spike", 11000, 610, 100);
attachFrontScroller("mountain_spike", 12000, 750, 100);
attachFrontScroller("mountain_spike", 13000, 600, 100);
attachFrontScroller("mountain_spike", 13300, 625, 80);
attachFrontScroller("mountain_spike", 14200, 610, 100);
attachFrontScroller("mountain_spike", 15300, 625, 100);
attachFrontScroller("mountain_spike", 15500, 610, 80);
attachFrontScroller("mountain_spike", 15650, 600, 60);
attachFrontScroller("mountain_spike", 15900, 610, 100);
attachFrontScroller("mountain_spike", 16500, 750, 100);
attachFrontScroller("mountain_spike", 17300, 625, 80);
wallSet[0].addWall(-50, -500, 1000, "leftwall", null, "");
wallSet[Math.floor(levelWidth / sectionSize)].addWall(levelWidth, -500, 1000, "rightwall", null, "");
simpleAttachNonObject(attachClip, "seed_sign", 1, 450, 400, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed5");
buildFloor("mountain", 10, -50, 400, "mount1", "mountain", false);
buildFloor("mountain", 10, 1400, 400, "mount2", "mountain", false);
buildFloor("mountain", 4, 1600, 200, "mount3", "mountain", true);
addEnemy("wigfoot1", "Wigfoot", 1700, 410, "false|false|false|false|false|true", "", true, true, "200,200");
buildFloor("mountain", 4, 2150, 470, "mount4", "mountain", false);
buildFloor("mountain", 3, 2300, 400, "mount5", "mountain", true);
buildFloor("mountain", 3, 2100, 350, "mount6", "mountain", true);
buildFloor("mountain", 5, 2400, 290, "mount7", "mountain", true);
simpleAttachNonObject(attachClip, "seed_sign", 1, 2600, 290, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed5");
buildFloor("mountain", 8, 4450, 470, "mount8", "mountain", false);
attachBouncyGoat(4500, 480);
buildFloor("mountain", 4, 4600, 50, "mount9", "mountain", true);
buildFloor("mountain", 6, 5000, 450, "mount10", "mountain", false);
buildFloor("mountain", 4, 5200, 200, "mount11", "mountain", true);
buildFloor("mountain", 3, 5250, -50, "mount12", "mountain", true);
simpleAttachNonObject(attachClip, "seed_sign", 1, 5350, -50, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed5");
buildFloor("mountain", 12, 5600, 520, "mount13", "mountain", true);
buildFloor("mountain", 6, 6500, 450, "mount14", "mountain", false);
buildFloor("mountain", 4, 6700, 200, "mount15", "mountain", true);
buildFloor("mountain", 3, 6750, -50, "mount16", "mountain", true);
buildFloor("mountain", 8, 6900, 350, "mount17", "mountain", false);
addEnemy("wigfoot2", "Wigfoot", 7300, 360, "false|false|false|false|false|true", "", true, true, "250,250");
buildFloor("mountain", 3, 7600, 460, "mount18", "mountain", false);
attachBouncyGoat(7680, 470);
buildFloor("mountain", 3, 7900, 240, "mount19", "mountain", false);
buildFloor("mountain", 3, 8200, 300, "mount20", "mountain", true);
buildFloor("mountain", 3, 8200, 0, "mount21", "mountain", true);
buildFloor("mountain", 3, 8500, 300, "mount22", "mountain", false);
attachBouncyGoat(8590, 310);
buildFloor("mountain", 3, 8800, 560, "mount23", "mountain", false);
buildFloor("mountain", 3, 8700, 320, "mount24", "mountain", true);
buildFloor("mountain", 3, 8700, 20, "mount25", "mountain", true);
simpleAttachNonObject(attachClip, "seed_sign", 1, 8810, 22, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed5");
buildFloor("mountain", 7, 9785, 320, "mount26", "mountain", false);
simpleAttachNonObject(attachClip, "seed_sign", 1, 10080, 312, 80);
attachClip["seed_sign" + (attachDex[1] - 1)].gotoAndStop("seed5");
buildFloor("mountain", 5, 9850, 20, "mount27", "mountain", true);
addEnemy("wigfoot3", "Wigfoot", 10000, 30, "false|false|false|false|false|true", "", true, true, "250,250");
addEnemy("wigfoot4", "Wigfoot", 10010, 330, "false|false|false|false|false|true", "", true, true, "250,270");
buildFloor("mountain", 12, 11400, 450, "mount28", "mountain", true);
activateBushy();
affectPlayerScore(0);
startTime();
attachTrash("trash_popcan", 1700, 210);
attachTrash("trash_cup", 1850, 410);
attachTrash("trash_popcorn", 2375, 410);
attachTrash("trash_bottle", 4700, 60);
attachTrash("trash_banana", 5100, 460);
attachTrash("trash_appleCore", 5270, 210);
attachTrash("trash_napkin", 5320, -40);
attachTrash("trash_bottle", 75, 410);
attachTrash("trash_popcan", 5700, 530);
attachTrash("trash_cup", 5800, 530);
attachTrash("trash_popcorn", 5900, 530);
attachTrash("trash_banana", 6000, 530);
attachTrash("trash_bottle", 6100, 530);
attachTrash("trash_napkin", 6200, 530);
attachTrash("trash_popcorn", 6775, 210);
attachTrash("trash_popcan", 7200, 360);
attachTrash("trash_cup", 7975, 250);
attachTrash("trash_bottle", 8275, 10);
attachTrash("trash_napkin", 8800, 30);
attachTrash("trash_bottle", 8875, 570);
attachTrash("trash_bottle", 8950, 570);
attachTrash("trash_popcan", 9900, 330);
attachTrash("trash_cup", 10100, 330);
}
function testEnemyGrabability(xCoord, yCoord, clipName) {
var _local2 = xCoord;
var _local3 = yCoord;
var _local1;
_local1 = 0;
while (_local1 < enemyDex) {
if (enemySet[_local1].process) {
if (Math.abs(enemySet[_local1].y - _local3) < 25) {
if (Math.abs(enemySet[_local1].rC("bl", "x") - _local2) < 25) {
attachClip[clipName].gotoAndPlay(enemySet[_local1].originalMovie);
kill(enemySet[_local1], true);
}
}
}
_local1++;
}
}
function objHitTest2(ob, ob2) {
var _local1 = ob;
var _local3 = ob2;
var _local2 = false;
if (_local1.process) {
if (percentOverlap(_local1.rC("bl", "x"), _local1.rC("br", "x"), _local3.rC("bl", "x"), _local3.rC("br", "x"), false) > 0) {
if (percentOverlap(_local1.rC("tl", "y"), _local1.rC("bl", "y"), _local3.rC("tl", "y"), _local3.rC("bl", "y"), false) > 0) {
_local2 = true;
}
}
}
return(_local2);
}
function loadRoom() {
initCharacters();
if (room == 0) {
room0();
}
if (room == 1) {
room1();
}
if (room == 2) {
room2();
}
if (room == 3) {
room3();
}
if (room == 4) {
room4();
}
if (room == 5) {
room5();
}
originalLevelTime = levelTime;
loadedUp = true;
}
var dropEnemies = false;
var playerScore = _parent.persistentPlayerScore;
var playerLives = _parent.persistentPlayerLives;
var glv = 0;
var tileSpace = 54;
var tileHeight = 21.3;
var tileWidth = 62;
var tileOffset = 12;
var globallyPaused = false;
var pauseDelay = 0;
var gameReady = false;
var sectionSize = 20;
var maxGravity = (sectionSize / 1.5);
var gravity = 4;
var attachDex = new Array(5);
var upButtonDown = false;
var downButtonDown = false;
attachDex[0] = 10;
attachDex[3] = 9999;
attachDex[1] = 10000;
attachDex[4] = 19999;
attachDex[2] = 20000;
var vWidth = 800;
var vHeight = 600;
var levelWidth = 6000;
var levelHeight = 1200;
var minXScroll = ((-levelWidth) + vWidth);
var maxXScroll = 0;
var minYScroll = 0;
var maxYScroll = (levelHeight - vHeight);
var Bushy;
var characters = new Array(3);
var floorSet = new Array(levelHeight / sectionSize);
glv = 0;
while (glv < floorSet.length) {
floorSet[glv] = new floorSection(glv);
glv++;
}
var ceilingSet = new Array(levelHeight / sectionSize);
glv = 0;
while (glv < ceilingSet.length) {
ceilingSet[glv] = new ceilingSection(glv);
glv++;
}
var wallSet = new Array(levelWidth / sectionSize);
glv = 0;
while (glv < wallSet.length) {
wallSet[glv] = new wallSection(glv);
glv++;
}
var inclineSet = new Array();
var inclineDex = 0;
var enemySet = new Array();
var enemyDex = 0;
var objectSet = new Array();
var objectDex = 0;
var pObjectSet = new Array();
var pObjectDex = 0;
var enemySet = new Array();
var enemyDex = 0;
var elevatorSet = new Array();
var elevatorDex = 0;
var moveFloorSet = new Array();
var moveFloorDex = 0;
var doorSet = new Array();
var doorDex = 0;
var activeChar;
var charactersinitialized = false;
var room = _parent.level;
background.gotoAndPlay("level" + room);
var seedAlive = false;
var currentSeed = 1;
var levelTime = 120;
var originalLevelTime = levelTime;
var timeCount = -1;
var reinstateInterval = null;
var endMusicStarted = false;
var seedStatus = new Array("active", "inactive", "inactive", "inactive", "inactive");
var seedSelectX = new Array(3.4, 40.4, 77.1, 112.4);
var seedCost = new Array(-5, -15, -25, -15, -25);
activateSound("musicStart");
lessonOriginalX = Bushy.x;
lessonOriginalY = Bushy.y;
var tutLessons = new Array(10);
var dropCompleted = false;
var seedThrown1 = false;
var flowerGrown = false;
var flowerShrunk = false;
var regainedControl = false;
var seedSelected2 = false;
var seedThrown2 = false;
var tutDex = -1;
tutLessons[0] = lesson1;
tutLessons[1] = lesson2;
tutLessons[2] = lesson3;
tutLessons[3] = lesson4;
tutLessons[4] = lesson5;
tutLessons[5] = lesson6;
tutLessons[6] = lesson7;
tutLessons[7] = lesson8;
tutLessons[8] = lesson9;
tutLessons[9] = lesson10;
tutLessons[10] = lesson11;
tutLessons[11] = lesson12;
loadRoom();
Instance of Symbol 659 MovieClip in Symbol 693 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.loadedUp) {
_parent.detectKeys();
}
}
Instance of Symbol 672 MovieClip "seedSet" in Symbol 693 MovieClip Frame 1
on (release) {
_parent.incrementSeed();
}
Symbol 696 MovieClip Frame 30
stop();
Symbol 731 Button
on (release) {
if (_parent._parent.level < 4) {
_parent._parent.gotoAndPlay("game");
} else {
_parent._parent.gotoAndPlay("gameconquered");
}
}
Symbol 732 MovieClip Frame 1
stop();
Symbol 732 MovieClip Frame 20
stop();
Symbol 747 MovieClip Frame 1
stop();
Symbol 747 MovieClip Frame 2
stop();
Symbol 747 MovieClip Frame 3
stop();
Symbol 748 MovieClip Frame 1
background.gotoAndPlay("level" + _parent.level);
title.text = ("Level " + _parent.level) + " summary:";
news.gotoAndPlay("seeds" + _parent.level);
Symbol 757 MovieClip Frame 1
function randomBounded(lowerBound, upperBound) {
var _local2 = (upperBound - lowerBound) + 1;
var _local1 = Math.random() * _local2;
return(lowerBound + parseInt(_local1));
}
Bushy.dex = 0;
Instance of Symbol 71 MovieClip "Bushy" in Symbol 757 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((this.dex % 3) == 0) {
this.attachMovie("gotMagic", "gotMagic" + this.dex, this.dex);
var randX = (14 - _parent.randomBounded(1, 54));
var randY = (-_parent.randomBounded(1, 40));
var randScale = _parent.randomBounded(25, 60);
this["gotMagic" + this.dex]._xscale = randScale;
this["gotMagic" + this.dex]._yscale = randScale;
this["gotMagic" + this.dex]._x = randX;
this["gotMagic" + this.dex]._y = randY;
}
this.dex++;
}
Symbol 763 MovieClip Frame 21
stop();
Symbol 771 MovieClip Frame 1
function randomBounded(lowerBound, upperBound) {
var _local2 = (upperBound - lowerBound) + 1;
var _local1 = Math.random() * _local2;
return(lowerBound + parseInt(_local1));
}
Bushy.dex = 0;
i = 1;
while (i < 9) {
this["l" + i].gotoAndStop("end");
i++;
}
Instance of Symbol 71 MovieClip "Bushy" in Symbol 771 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((this.dex % 3) == 0) {
this.attachMovie("gotMagic", "gotMagic" + this.dex, this.dex);
var randX = (14 - _parent.randomBounded(1, 54));
var randY = (-_parent.randomBounded(1, 40));
var randScale = _parent.randomBounded(25, 60);
this["gotMagic" + this.dex]._xscale = randScale;
this["gotMagic" + this.dex]._yscale = randScale;
this["gotMagic" + this.dex]._x = randX;
this["gotMagic" + this.dex]._y = randY;
}
this.dex++;
}
Symbol 777 MovieClip Frame 21
stop();
Symbol 788 MovieClip Frame 21
stop();
Symbol 799 MovieClip Frame 21
stop();
Symbol 805 MovieClip Frame 23
bloom.play();
Symbol 806 MovieClip Frame 23
bloom.play();
Symbol 812 MovieClip Frame 21
stop();
Symbol 826 MovieClip Frame 1
indicator.dex = 0;
Instance of Symbol 672 MovieClip "indicator" in Symbol 826 MovieClip Frame 1
onClipEvent (enterFrame) {
theFrame = this._currentFrame + 1;
if (theFrame > 5) {
theFrame = 1;
}
this.dex++;
if (this.dex == 45) {
this.gotoAndPlay(theFrame);
this.dex = 0;
}
}
Symbol 826 MovieClip Frame 21
stop();
Symbol 837 MovieClip Frame 1
fakePause.seed1.gotoAndPlay("active");
fakePause.seed2.gotoAndPlay("inactive");
fakePause.seed3.gotoAndPlay("inactive");
fakePause.seed4.gotoAndPlay("inactive");
fakePause.seed5.gotoAndPlay("inactive");
Symbol 837 MovieClip Frame 21
stop();
Symbol 848 MovieClip Frame 1
stop();
Symbol 849 MovieClip Frame 1
click.play();
Instance of Symbol 61 MovieClip "Bushy" in Symbol 849 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((this.dex % 3) == 0) {
this.attachMovie("gotMagic", "gotMagic" + this.dex, this.dex);
var randX = (14 - _parent.randomBounded(1, 54));
var randY = (-_parent.randomBounded(1, 40));
var randScale = _parent.randomBounded(25, 60);
this["gotMagic" + this.dex]._xscale = randScale;
this["gotMagic" + this.dex]._yscale = randScale;
this["gotMagic" + this.dex]._x = randX;
this["gotMagic" + this.dex]._y = randY;
}
this.dex++;
}
Symbol 849 MovieClip Frame 2
function randomBounded(lowerBound, upperBound) {
var _local2 = (upperBound - lowerBound) + 1;
var _local1 = Math.random() * _local2;
return(lowerBound + parseInt(_local1));
}
Bushy.dex = 0;
Instance of Symbol 71 MovieClip "Bushy" in Symbol 849 MovieClip Frame 2
onClipEvent (enterFrame) {
if ((this.dex % 3) == 0) {
this.attachMovie("gotMagic", "gotMagic" + this.dex, this.dex);
var randX = (14 - _parent.randomBounded(1, 54));
var randY = (-_parent.randomBounded(1, 40));
var randScale = _parent.randomBounded(25, 60);
this["gotMagic" + this.dex]._xscale = randScale;
this["gotMagic" + this.dex]._yscale = randScale;
this["gotMagic" + this.dex]._x = randX;
this["gotMagic" + this.dex]._y = randY;
}
this.dex++;
}
Symbol 849 MovieClip Frame 45
click.play();
Symbol 859 MovieClip Frame 1
indicator.dex = 0;
Instance of Symbol 672 MovieClip "indicator" in Symbol 859 MovieClip Frame 1
onClipEvent (enterFrame) {
theFrame = this._currentFrame + 1;
if (theFrame > 5) {
theFrame = 1;
}
this.dex++;
if (this.dex == 43) {
_parent.click.play();
}
if (this.dex == 45) {
this.gotoAndPlay(theFrame);
this.dex = 0;
}
}
Symbol 859 MovieClip Frame 21
stop();
Symbol 866 Button
on (release) {
_parent.gotoAndPlay("menu");
}
Symbol 894 MovieClip Frame 1
hairy_hair.stop();
Symbol 903 MovieClip Frame 440
forMovie.play();
Symbol 903 MovieClip Frame 805
_parent._parent.gotoAndPlay("menu");
Symbol 908 MovieClip Frame 1
function replaceWithCatapult(movieOBJ, textParam) {
}
finalScore.text = _parent.persistentPlayerScore;
Symbol 913 Button
on (release) {
_parent.gotoAndPlay("game");
}
Symbol 915 MovieClip Frame 1
function pieceOTrash(description, points, movieRef, trashType) {
var _local1 = this;
_local1.description = description;
_local1.points = points;
_local1.movieRef = movieRef;
_local1.trashType = trashType;
}
function levelCollected() {
var _local2 = this;
_local2.totalsForLevel = new Array(garbage.length);
_local2.collectedForLevel = new Array(garbage.length);
var _local1 = 0;
while (_local1 < garbage.length) {
_local2.totalsForLevel[_local1] = 0;
_local2.collectedForLevel[_local1] = 0;
_local1++;
}
}
function addToCollected(searchMovie, level) {
var _local2 = searchMovie;
var _local3 = level;
var _local1;
_local1 = 0;
while (_local1 < garbage.length) {
if (_local2 == garbage[_local1].movieRef) {
levels[_local3 - 1].collectedForLevel[_local1]++;
}
_local1++;
}
}
function addToTotal(searchMovie, level) {
var _local2 = searchMovie;
var _local3 = level;
var _local1;
_local1 = 0;
while (_local1 < garbage.length) {
if (_local2 == garbage[_local1].movieRef) {
levels[_local3 - 1].totalsForLevel[_local1]++;
}
_local1++;
}
}
function reportNext() {
var _local2 = betweenScreen[garbage[reportingDex].movieRef + "_num"].text - 0;
var _local1 = betweenScreen.time.text - 0;
if (_local2 != levels[level - 1].collectedForLevel[reportingDex]) {
betweenScreen[garbage[reportingDex].movieRef + "_num"].text = _local2 + 1;
} else if (reportingDex < garbage.length) {
reportingDex++;
}
if (_local1 != (levelEndTime * timeValue)) {
if (((levelEndTime * timeValue) - _local1) >= (5 * timeValue)) {
betweenScreen.time.text = _local1 + (timeValue * 5);
} else {
betweenScreen.time.text = _local1 + timeValue;
}
}
if ((reportingDex == garbage.length) && (_local1 == (levelEndTime * timeValue))) {
persistentPlayerScore = persistentPlayerScore + (levelEndTime * timeValue);
clearInterval(reportingInterval);
level++;
betweenScreen.contButton.play();
}
}
function reportTotals() {
var _local1;
var _local2;
_local2 = 0;
_local1 = 0;
while (_local1 < garbage.length) {
betweenScreen[garbage[_local1].movieRef + "_total"].text = levels[level - 1].totalsForLevel[_local1];
betweenScreen[garbage[_local1].movieRef + "_num"].text = 0;
betweenScreen[garbage[_local1].movieRef + "_pts"].text = ("(" + garbage[_local1].points) + ")";
_local2 = _local2 + (levels[level - 1].collectedForLevel[_local1] * garbage[_local1].points);
_local1++;
}
reportingDex = 0;
reportingInterval = setInterval(reportNext, 50);
betweenScreen.total.text = _local2;
betweenScreen.time.text = 0;
}
var level = 1;
var levelEndTime = 0;
var persistentPlayerScore = 0;
var persistentPlayerLives = 3;
var timeValue = 10;
var garbage = new Array(7);
garbage[0] = new pieceOTrash("Apple core", 50, "trash_appleCore", "biodegradable");
garbage[1] = new pieceOTrash("Banana peel", 70, "trash_banana", "biodegradable");
garbage[2] = new pieceOTrash("Dirty napkin", 100, "trash_napkin", "trash");
garbage[3] = new pieceOTrash("Popcorn box", 150, "trash_popcorn", "trash");
garbage[4] = new pieceOTrash("Foam cup", 200, "trash_cup", "trash");
garbage[5] = new pieceOTrash("Pop can", 400, "trash_popcan", "recyclable");
garbage[6] = new pieceOTrash("Pop bottle", 600, "trash_bottle", "recyclable");
var levels = new Array(3);
levels[0] = new levelCollected();
levels[1] = new levelCollected();
levels[2] = new levelCollected();
var reportingInterval = null;
var reportingDex = 0;
_parent._quality = "HIGH";
stop();
Symbol 915 MovieClip Frame 2
_parent._quality = "MEDIUM";
stop();
Symbol 915 MovieClip Frame 3
_parent._quality = "HIGH";
reportTotals();
stop();
Symbol 915 MovieClip Frame 4
_parent._quality = "HIGH";
stop();
Symbol 915 MovieClip Frame 5
_parent._quality = "HIGH";
_root.WPI_ArcadeStopSingleGame(persistentPlayerScore);
stop();
Symbol 915 MovieClip Frame 6
_parent._quality = "HIGH";
stop();