Frame 1
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
gotoAndPlay (2);
} else {
stop();
}
Frame 3
function grainController() {
this.grainQueue = new Array();
}
grainController.prototype.createGrain = function () {
i = 0;
while (i < _root.numberOfGrain) {
duplicateMovieClip ("theGrain", "grain" + i, i + 10);
i++;
}
};
grainController.prototype.resetGrain = function () {
i = 0;
while (i < numberOfGrain) {
eval ("grain" + i)._visible = false;
eval ("grain" + i).state = "stopped";
this.grainQueue.push(eval ("grain" + i));
i++;
}
};
grainController.prototype.removeGrain = function () {
i = 0;
while (i < numberOfGrain) {
eval ("grain" + i)._visible = false;
eval ("grain" + i).state = "stopped";
i++;
}
};
grainController.prototype.dropGrain = function (dropper) {
if (0 < this.grainQueue.length) {
theGrain = this.grainQueue.shift();
eval (theGrain)._visible = true;
eval (theGrain)._x = (dropper._x - (dropper._width / 2)) + random(dropper._width);
eval (theGrain)._y = dropper._y + (dropper._height / 2);
eval (theGrain).setFalling();
}
};
grainController.prototype.grainOffScreen = function (theGrain) {
theGrain.state = "stopped";
theGrain._visible = false;
theGrain.ySpeed = 1;
this.grainQueue.push(theGrain);
};
function hitObjects() {
this.objectList = new Array();
this.screenHeight = 400;
this.noOfStrips = 20;
this.stripHeight = this.screenHeight / this.noOfStrips;
this.stripList = new Array(noOfStrips);
i = this.noOfStrips;
while (i--) {
this.stripList[i] = new Array();
}
}
hitObjects.prototype.addObject = function (object) {
this.objectList.push(object);
};
hitObjects.prototype.hasHit = function (testObject) {
var result = false;
var theStrip = this.getStrip(testObject);
var objectCount = this.stripList[theStrip].length;
while (objectCount--) {
if (this.stripList[theStrip][objectCount].hitTest(testObject._x, testObject._y, false)) {
if (this.stripList[theStrip][objectCount].hitTest(testObject._x, testObject._y, true)) {
this.stripList[theStrip][objectCount].onHitBy(testObject);
result = true;
}
}
}
return(result);
};
hitObjects.prototype.hitBoundBox = function (testObject) {
var result = false;
var theStrip = this.getStrip(testObject);
var nextStrip = (theStrip - 1);
while (theStrip >= nextStrip) {
var objectCount = this.stripList[theStrip].length;
while (objectCount--) {
if (testObject != this.stripList[theStrip][objectCount]) {
if (this.stripList[theStrip][objectCount].hitTest(testObject)) {
for (i in testObject:perim) {
testObject.perim.localToGlobal((p = {x:testObject.perim[i]._x, y:testObject.perim[i]._y}));
if (this.stripList[theStrip][objectCount].hitTest(p.x, p.y, true)) {
result = true;
}
}
}
}
}
theStrip--;
}
return(result);
};
hitObjects.prototype.addTarget = function (targetObject) {
var i = this.noOfStrips;
while (i--) {
if (this.withinStrip(i, targetObject) == true) {
this.stripList[i].push(targetObject);
}
}
};
hitObjects.prototype.removeTarget = function (targetObject) {
var i = this.noOfStrips;
while (i--) {
var j = this.stripList[i].length;
while (j--) {
if (targetObject == this.stripList[i][j]) {
this.stripList[i].splice(j, 1);
}
}
}
};
hitObjects.prototype.moveTarget = function (targetObject) {
this.removeTarget(targetObject);
this.addTarget(targetObject);
};
hitObjects.prototype.withinStrip = function (stripNo, targetObject) {
var result = false;
var stripBottom = (stripNo * this.stripHeight);
var stripTop = ((stripNo + 1) * this.stripHeight);
var bounds = targetObject.getBounds(_root);
if ((bounds.yMax._y >= stripBottom) and (stripTop >= bounds.yMax)) {
result = true;
}
if ((bounds.yMax >= stripTop) and (stripBottom >= bounds.yMin)) {
result = true;
}
if ((bounds.yMin >= stripBottom) and (stripTop >= bounds.yMin)) {
result = true;
}
return(result);
};
hitObjects.prototype.getStrip = function (targetObject) {
return(Math.floor(targetObject._y / this.stripHeight));
};
objectList = new hitObjects();
Instance of Symbol 21 MovieClip "counter" in Frame 5
onClipEvent (enterFrame) {
if (this.state == "counting") {
this.frameCount++;
timeLeft = Math.ceil(this.period - (this.frameCount / this.framesPerSecond));
this.gotoAndStop(300 - (timeLeft * 5));
if (0 >= timeLeft) {
this.state = "stopped";
_root.onTimeUp();
}
} else {
this.gotoAndStop(1);
}
}
Instance of Symbol 30 MovieClip "music" in Frame 7
onClipEvent (load) {
this.gotoAndStop(1);
}
Instance of Symbol 42 MovieClip "right3" in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 47 MovieClip "left2" in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 52 MovieClip in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 56 MovieClip "left3" in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 64 MovieClip "funnel1" in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 69 MovieClip "right2" in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 75 MovieClip "left1" in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 81 MovieClip "right1" in Frame 9
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 90 MovieClip "screw1" in Frame 10
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 92 MovieClip "triangle2" in Frame 10
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 94 MovieClip "triangle1" in Frame 10
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Frame 11
function resetConveyers() {
right1.reset();
right2.reset();
right3.reset();
left1.reset();
left2.reset();
left3.reset();
screw1.reset();
funnel1.reset();
triangle1.reset();
triangle2.reset();
}
function backToStart() {
gotoAndStop (12);
}
function gotoLevel(theLevel) {
var _local1 = 1;
switch (((theLevel - 1) % numberOfLevels) + 1) {
case _local1 :
gotoAndStop (23);
return;
case 2 :
gotoAndStop (26);
return;
case 3 :
gotoAndStop (29);
return;
case 4 :
gotoAndStop (32);
return;
case 5 :
gotoAndStop (35);
return;
case 6 :
gotoAndStop (38);
return;
case 7 :
gotoAndStop (41);
return;
case 8 :
gotoAndStop (43);
}
}
function startGame() {
timeAllowance = 60;
currentLevel = 1;
level.txt = currentLevel;
_root.dragging = false;
bucket.reset();
counter.reset(timeAllowance);
counter.start();
_root.gameState = "playing";
_root.musicSound.start(0, 50);
startButton._visible = false;
gotoLevel(currentLevel);
instructions.txt = "Drag the machines at the bottom of the screen up to control the grain";
instructions._visible = true;
}
function startPractice() {
currentLevel = "practice";
counter._visible = false;
_root.dragging = false;
_root.gameState = "playing";
_root.musicSound.start(0, 50);
startButton._visible = false;
gotoAndStop (15);
instructions.txt = "Drag the machines at the bottom of the screen up to control the grain";
instructions._visible = true;
}
function onTimeUp() {
instructions.txt = "";
_root.musicSound.stop();
resetConveyers();
resultText = "Time's Up";
scoreText = ("You managed to get " + _root.bucket.bucketCount) + " grains in the bucket.";
_root.grainDropper.removeGrain();
if ((numberOfGrain * 0.8) < _root.bucket.bucketCount) {
if ((currentLevel % numberOfLevels) == 0) {
timeAllowance = timeAllowance - 10;
instructions.txt = "Time limit reduced by 10 seconds - better get moving";
_root.gameState = "end level";
gotoAndStop (20);
} else {
scoreText = scoreText + "Which gets you onto the next level";
_root.gameState = "end level";
gotoAndStop (20);
}
} else {
_root.gameState = "end game";
gotoAndStop (18);
}
}
function onBucketFull() {
instructions.txt = "";
_root.musicSound.stop();
resultText = "Well Done";
resetConveyers();
counter.stop();
_root.grainDropper.removeGrain();
scoreText = ("You managed to get all " + _root.bucket.bucketCount) + " grains in the bucket.";
if ((currentLevel % numberOfLevels) == 0) {
timeAllowance = timeAllowance - 10;
instructions.txt = "Time limit reduced by 10 seconds - better get moving";
_root.gameState = "end level";
gotoAndStop (20);
} else if (currentLevel != "practice") {
_root.gameState = "end level";
gotoAndStop (20);
} else {
_root.gameState = "start";
gotoAndStop (12);
}
}
function onNextLevel() {
currentLevel++;
level.txt = currentLevel;
_root.gameState = "playing";
_root.dragging = false;
resetConveyers();
counter.reset(timeAllowance);
counter.start();
grainDropper.resetGrain();
bucket.reset();
_root.musicSound.start(0, 40);
startButton._visible = false;
nextLevelButton._visible = false;
gotoLevel(currentLevel);
if (instructions.txt != "") {
instructions._visible = true;
} else {
instructions._visible = false;
}
}
function onRedoLevel() {
level.txt = currentLevel;
_root.dragging = false;
bucket.reset();
counter.reset(timeAllowance);
grainDropper.resetGrain();
counter.start();
_root.gameState = "playing";
instructions._visible = false;
_root.musicSound.start(0, 50);
startButton._visible = false;
gotoLevel(currentLevel);
}
musicSound = new Sound();
musicSound.attachSound("money");
smallSize = 25;
largerSize = 75;
moverHolderY = 325;
numberOfGrain = 50;
numberOfLevels = 8;
grainDropper = new grainController();
gameState = "start";
startButton._visible = true;
grainDropper.createGrain();
Instance of Symbol 96 MovieClip "theGrain" in Frame 11
onClipEvent (load) {
this.ySpeed = 0;
this.move = new Object();
this.acceleration = 1;
this.xMovement = 0;
this.yMovement = 0;
this.hitSound = new Sound();
this.hitSound.attachSound("snaph");
}
onClipEvent (enterFrame) {
var _local1 = "falling";
switch (this.state) {
case _local1 :
if (_root.objectList.hasHit(this) == true) {
this._y = (this._y + this.oldY) / 2;
this._x = (this._x + this.oldX) / 2;
this.ySpeed = this.ySpeed / 2;
if (Math.floor(this.ySpeed) == 0) {
this.state = "caught";
this.ySpeed = 0;
}
} else if (this._y < 320) {
this.oldY = this._y;
this.oldX = this._x;
if (this.ySpeed < 10) {
this.ySpeed = this.ySpeed + this.acceleration;
}
this._y = this._y + this.ySpeed;
} else {
_root.grainDropper.grainOffScreen(this);
}
break;
case "caught" :
this.oldX = this._x;
this._x = this._x - this.move.x;
this.oldY = this._y;
this._y = this._y - this.move.y;
break;
case "stopped" :
}
}
Instance of Symbol 122 MovieClip "bucket" in Frame 11
/* no clip actions */
Frame 12
resetConveyers();
counter._visible = true;
levelDisplay._visible = false;
counter.reset(30);
gameState = "start";
grainDropper.resetGrain();
bucket.reset();
stop();
Instance of Symbol 127 MovieClip in Frame 15
onClipEvent (enterFrame) {
this.Counter--;
if ((_root.gameState == "playing") and (this.Counter < 0)) {
this.Counter = 5;
_root.grainDropper.dropGrain(this);
}
}
onClipEvent (load) {
this.Counter = 5;
}
Frame 18
trace("game over");
stop();
Instance of Symbol 96 MovieClip "theGrain" in Frame 23
onClipEvent (load) {
this.ySpeed = 0;
this.move = new Object();
this.acceleration = 1;
this.xMovement = 0;
this.yMovement = 0;
}
onClipEvent (enterFrame) {
var _local1 = "falling";
switch (this.state) {
case _local1 :
if (_root.objectList.hasHit(this) == true) {
this._y = (this._y + this.oldY) / 2;
this.ySpeed = this.ySpeed / 2;
if (Math.floor(this.ySpeed) == 0) {
this.state = "caught";
this.ySpeed = 0;
}
} else if (this._y < 320) {
this.oldY = this._y;
if (this.ySpeed < 12) {
this.ySpeed = this.ySpeed + this.acceleration;
}
this._y = this._y + this.ySpeed;
} else {
_root.grainDropper.grainOffScreen(this);
}
break;
case "caught" :
this._x = this._x - this.move.x;
this._y = this._y - this.move.y;
break;
case "stopped" :
}
}
Instance of Symbol 122 MovieClip "bucket" in Frame 23
/* no clip actions */
Instance of Symbol 127 MovieClip in Frame 23
onClipEvent (enterFrame) {
this.Counter--;
if ((_root.gameState == "playing") and (this.Counter < 0)) {
this.Counter = 5;
_root.grainDropper.dropGrain(this);
}
}
onClipEvent (load) {
this.Counter = 5;
}
Instance of Symbol 127 MovieClip in Frame 26
onClipEvent (enterFrame) {
this.Counter--;
if ((_root.gameState == "playing") and (this.Counter < 0)) {
this.Counter = 5;
_root.grainDropper.dropGrain(this);
}
}
onClipEvent (load) {
this.Counter = 5;
}
Instance of Symbol 127 MovieClip in Frame 32
onClipEvent (enterFrame) {
this.Counter--;
if ((_root.gameState == "playing") and (this.Counter < 0)) {
this.Counter = 5;
_root.grainDropper.dropGrain(this);
}
}
onClipEvent (load) {
this.Counter = 5;
}
Instance of Symbol 145 MovieClip in Frame 35
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 148 MovieClip in Frame 35
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 151 MovieClip in Frame 35
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 148 MovieClip in Frame 38
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 151 MovieClip in Frame 38
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 127 MovieClip in Frame 41
onClipEvent (enterFrame) {
this.Counter--;
if ((_root.gameState == "playing") and (this.Counter < 0)) {
this.Counter = 5;
_root.grainDropper.dropGrain(this);
}
}
onClipEvent (load) {
this.Counter = 5;
}
Instance of Symbol 148 MovieClip in Frame 43
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 148 MovieClip in Frame 43
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Instance of Symbol 151 MovieClip in Frame 43
onClipEvent (enterFrame) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
}
var grainCount = this.grainList.length;
while (grainCount--) {
if (this.hitTest(this.grainList[grainCount]._x, this.grainList[grainCount]._y, true) != true) {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
} else if (this.onMoveArea(this.grainList[grainCount]) != false) {
this.grainList[grainCount].move = this.grainMove(this.grainList[grainCount]);
} else {
this.grainList[grainCount].setFalling();
this.grainList.splice(grainCount, 1);
}
}
}
onClipEvent (mouseDown) {
trace("mouse down");
_root.instructions._visible = false;
if ((((this.canDrag != false) and (this.drag == false)) and (_root.dragging != true)) and (_root.gameState == "playing")) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.drag = true;
this.startDrag(false);
_root.dragging = true;
this.dragPath = new Array();
this.dragPath.push([this._x, this._y]);
}
}
}
onClipEvent (mouseMove) {
if (this.drag == true) {
this.dragPath.push([this._x, this._y]);
if (this._y < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this._xscale = _root.smallerSize;
this._yscale = _root.smallerSize;
}
_root.objectList.moveTarget(this);
}
}
onClipEvent (mouseUp) {
if (this.drag == true) {
_root.dragging = false;
this.drag = false;
this.stopDrag();
while ((_root.objectList.hitBoundBox(this) == true) and (0 < this.dragPath.length)) {
oldPos = this.dragPath.pop();
this._x = oldPos[0];
this._y = oldPos[1];
}
if ((this._y + (this._height / 2)) < _root.moverHolderY) {
this._xscale = _root.largerSize;
this._yscale = _root.largerSize;
} else {
this.reset();
}
this.left = (this._x - (this._width / 2)) + 40;
_root.objectList.moveTarget(this);
}
}
Symbol 7 MovieClip Frame 2
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
_parent.play();
} else {
txt = ("loading " + Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100)) + "%";
gotoAndPlay (1);
}
Symbol 16 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 8
gotoAndStop (1);
Symbol 21 MovieClip Frame 1
function reset(timeLeft) {
this.period = timeLeft;
this.framesPerSecond = 20;
this.frameCount = 0;
this.timeDisplay = timeLeft;
this.state = "reset";
}
function start() {
this.state = "counting";
this.startTime = getTimer();
}
function stop() {
this.state = "stopped";
}
Symbol 27 Button
on (release) {
this.play();
}
Symbol 30 MovieClip Frame 1
_root.musicSound.setVolume(100);
stop();
Symbol 30 MovieClip Frame 2
_root.musicSound.setVolume(0);
stop();
Symbol 42 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function onMoveArea(grain) {
if (grain._y < this._y) {
return(true);
}
return(false);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = -3;
move.y = 0;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 42 MovieClip Frame 7
gotoAndPlay (2);
Symbol 47 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function onMoveArea(grain) {
if ((grain._x - this._x) < (grain._y - this._y)) {
return(false);
}
return(true);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = 3;
move.y = 3;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 47 MovieClip Frame 7
gotoAndPlay (2);
Symbol 52 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = 75;
this._yscale = 75;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
this.canDrag = false;
move = new Object();
move.x = 3;
move.y = 0;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 52 MovieClip Frame 7
gotoAndPlay (2);
Symbol 56 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function onMoveArea(grain) {
if (grain._y < this._y) {
return(true);
}
return(false);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = 3;
move.y = 0;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 56 MovieClip Frame 7
gotoAndPlay (2);
Symbol 64 MovieClip Frame 1
function grainMove(grain) {
move = new Object();
if (grain._x < this._x) {
move.x = -3;
move.y = -3;
} else {
move.x = 3;
move.y = -3;
}
return(move);
}
function onMoveArea(grain) {
if (this.hitBit.hitTest(grain._x, grain._y, true)) {
return(true);
}
return(false);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
canDrag = true;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
stop();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 69 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function onMoveArea(grain) {
if ((this._y - grain._y) < (grain._x - this._x)) {
return(false);
}
return(true);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = -3;
move.y = 3;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 69 MovieClip Frame 7
gotoAndPlay (2);
Symbol 75 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = 3;
move.y = 0;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 75 MovieClip Frame 7
gotoAndPlay (2);
Symbol 81 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = -3;
move.y = 0;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 81 MovieClip Frame 7
gotoAndPlay (2);
Symbol 87 MovieClip Frame 10
gotoAndPlay (2);
Symbol 90 MovieClip Frame 1
function grainMove(grain) {
move = new Object();
if (this.redHitArea.hitTest(grain._x, grain._y, true)) {
move.x = -5;
move.y = 5;
} else {
move.x = 3;
move.y = -3;
}
return(move);
}
function onMoveArea(grain) {
if ((grain._x - this._x) < this.dropPoint) {
return(true);
}
return(false);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
this.dropPoint = ((this.redHitArea._width / 2) * 0.75) + 3;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
trace("hit by grain");
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 90 MovieClip Frame 7
gotoAndPlay (2);
Symbol 92 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = -3;
move.y = -3;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
stop();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 94 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function reset() {
this.stopDrag();
this.grainList = [];
this._xscale = _root.smallSize;
this._yscale = _root.smallSize;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
move = new Object();
move.x = 3;
move.y = -3;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
stop();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 96 MovieClip Frame 1
function setFalling() {
this.oldY = this._y;
this.ySpeed = this.ySpeed + this.acceleration;
this._y = this._y + this.ySpeed;
this.state = "falling";
}
_quality = "MEDIUM";
this.ySpeed = 0;
this.state = "stopped";
this.acceleration = 1;
stop();
Symbol 112 MovieClip Frame 10
stop();
Symbol 114 Button
on (release) {
_root.startGame();
}
Symbol 115 Button
on (release) {
_root.startPractice();
}
Symbol 117 MovieClip Frame 18
stop();
Symbol 122 MovieClip Frame 1
function reset() {
trace("reseting bucket");
this.grainList = [];
this.bucketCount = 0;
_root.objectList.moveTarget(this);
}
this.grainList = new Array();
this.hitSound = new Sound();
this.hitSound.attachSound("snaph");
stop();
onHitBy = function (object) {
this.hitSound.start();
object.state = "stopped";
object._visible = false;
this.grainList.push(object);
this.bucketCount++;
if (this.bucketCount >= _root.numberOfGrain) {
_root.onBucketFull();
}
};
Symbol 130 Button
on (release) {
_root.backToStart();
}
Symbol 132 Button
on (press) {
onRedoLevel();
}
Symbol 134 Button
on (press) {
gotoAndStop (12);
}
Symbol 139 Button
on (release) {
onNextLevel();
}
Symbol 145 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function onMoveArea(grain) {
if (this.hitTest(grain._x, grain._y, false)) {
return(true);
}
return(false);
}
function reset() {
this.grainList = [];
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
move = new Object();
move.x = 0;
move.y = -3;
this.grainList = new Array();
reset();
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 148 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function onMoveArea(grain) {
if (this.hitTest(grain._x, grain._y, false)) {
return(true);
}
return(false);
}
function reset() {
this.grainList = [];
this._xscale = 100;
this._yscale = 100;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
canDrag = false;
move = new Object();
move.x = 3;
move.y = -3;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
stop();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};
Symbol 151 MovieClip Frame 1
function grainMove(grain) {
return(move);
}
function onMoveArea(grain) {
if (this.hitTest(grain._x, grain._y, false)) {
return(true);
}
return(false);
}
function reset() {
this.grainList = [];
this._xscale = 100;
this._yscale = 100;
this.drag = false;
this._x = this.startX;
this._y = this.startY;
_root.objectList.moveTarget(this);
}
_quality = "MEDIUM";
canDrag = false;
move = new Object();
move.x = -3;
move.y = -3;
this.startX = this._x;
this.startY = this._y;
this.grainList = new Array();
reset();
stop();
onHitBy = function (object) {
var grainCount = this.grainList.length;
this.grainList.push(object);
};