Frame 2
stop();
Instance of Symbol 45 MovieClip "bgtop" in Frame 2
onClipEvent (load) {
origX = _x;
origY = _y;
shaking = false;
}
onClipEvent (enterFrame) {
if (_parent.shake) {
_x = ((origX + (Math.random() * 4)) - 2);
_y = ((origY + (Math.random() * 4)) - 2);
shaking = true;
} else if (shaking) {
shaking = true;
_x = origX;
_y = origY;
}
}
Instance of Symbol 47 MovieClip "bgbottom" in Frame 2
onClipEvent (load) {
origX = _x;
origY = _y;
shaking = false;
}
onClipEvent (enterFrame) {
if (_parent.shake) {
_x = ((origX + (Math.random() * 4)) - 2);
_y = ((origY + (Math.random() * 4)) - 2);
shaking = true;
} else if (shaking) {
shaking = true;
_x = origX;
_y = origY;
}
}
Instance of Symbol 49 MovieClip in Frame 2
onClipEvent (load) {
origX = _x;
origY = _y;
shaking = false;
}
onClipEvent (enterFrame) {
if (_parent.shake) {
_x = ((origX + (Math.random() * 2)) - 1);
_y = ((origY + (Math.random() * 2)) - 1);
shaking = true;
} else if (shaking) {
shaking = true;
_x = origX;
_y = origY;
}
}
Instance of Symbol 49 MovieClip in Frame 2
onClipEvent (load) {
origX = _x;
origY = _y;
shaking = false;
}
onClipEvent (enterFrame) {
if (_parent.shake) {
_x = ((origX + (Math.random() * 2)) - 1);
_y = ((origY + (Math.random() * 2)) - 1);
shaking = true;
} else if (shaking) {
shaking = true;
_x = origX;
_y = origY;
}
}
Instance of Symbol 51 MovieClip "fgtop" in Frame 2
onClipEvent (load) {
origX = _x;
origY = _y;
shaking = false;
}
onClipEvent (enterFrame) {
if (_parent.shake) {
_x = ((origX + (Math.random() * 2)) - 1);
_y = ((origY + (Math.random() * 2)) - 1);
shaking = true;
} else if (shaking) {
shaking = true;
_x = origX;
_y = origY;
}
}
Instance of Symbol 53 MovieClip in Frame 2
onClipEvent (load) {
starttime = getTimer();
speed = 50;
move = -3.1;
lastx = _x;
}
onClipEvent (enterFrame) {
t = getTimer() - starttime;
if ((t >= 12000) and (t <= 28000)) {
_x = (_x + move);
if (_x > 580) {
move = -Math.abs(move);
}
if (_x < 20) {
move = Math.abs(move);
}
}
if ((t >= 4000) and (t <= 28000)) {
f = Math.floor((t / speed) % 20) + 1;
gotoAndStop(f);
} else {
gotoAndStop (21);
}
if (lastx > _x) {
_rotation = -10;
} else if (lastx < _x) {
_rotation = 10;
} else {
_rotation = 0;
}
lastx = _x;
}
Instance of Symbol 67 MovieClip "fgbottom" in Frame 2
onClipEvent (load) {
origX = _x;
origY = _y;
shaking = false;
}
onClipEvent (enterFrame) {
if (_parent.shake) {
_x = ((origX + (Math.random() * 2)) - 1);
_y = ((origY + (Math.random() * 2)) - 1);
shaking = true;
} else if (shaking) {
shaking = true;
_x = origX;
_y = origY;
}
}
Frame 4
maxpts = 0;
maxblocks = 0;
maxmult = 0;
timedebug = {timeadd:0, timecount:0, timemax:0};
gLevel = 1;
score = 0;
scorecheck = "0";
scoreDisplay.scoreField = 0;
mineDeep = (gLevel * 4) + 14;
mineDepth = "0/" + mineDeep;
mineNumber = gLevel;
stop();
Instance of Symbol 45 MovieClip "bgtop" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Instance of Symbol 47 MovieClip "bgbottom" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Instance of Symbol 49 MovieClip "beam4" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Instance of Symbol 49 MovieClip "beam3" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Instance of Symbol 49 MovieClip "beam2" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Instance of Symbol 49 MovieClip "beam1" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Instance of Symbol 51 MovieClip "fgtop" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Instance of Symbol 67 MovieClip "fgbottom" in Frame 4
onClipEvent (load) {
x = _x;
y = _y;
}
Frame 6
function setGlobals() {
blockClips = new Array("dirt", "slate", "granite", "gold");
blockNum = 1;
maxCol = 15;
maxRow = 9;
spaceCol = 34;
spaceRow = 28;
shake = false;
howDeep = 0;
mineDeep = (gLevel * 4) + 14;
mineDepth = "1/" + mineDeep;
mineNumber = gLevel;
playActive = true;
addDelay = 10000;
dropDelay = 35;
clickDelay = 5;
addTime = getTimer() + addDelay;
dropBlock = true;
pickThrow = false;
removeArray = new Array();
numMult = 0;
timerObject = setInterval(timer, 5);
shake = false;
still = true;
shakeMCs = new Array(fgtop, fgbottom, bgtop, bgbottom, beam1, beam2, beam3, beam4);
scoreFlyNum = 0;
clickBuffer = new Array();
pick._visible = false;
playSound(_root, "startlevel", 50);
}
function timer() {
var _local1 = getTimer();
if ((((!dropBlock) and (addTime > 0)) and (addTime <= _local1)) and (removeArray.length == 0)) {
timedebug.timeadd = timedebug.timeadd + Math.floor((_local1 - addTime) / 1000);
timedebug.timecount = timedebug.timecount + 1;
if (Math.floor((_local1 - addTime) / 1000) > timedebug.timemax) {
timedebug.timemax = Math.floor((_local1 - addTime) / 1000);
}
addColumn();
still = false;
} else if (pickThrow) {
movePick();
still = false;
} else if (dropBlock) {
doDrop();
still = false;
} else if (playActive) {
checkClickBuffer();
still = true;
}
if (((!shake) and (addTime > 0)) and ((addTime - 500) <= _local1)) {
shake = true;
playSound(fgtop, "rumble", 50);
}
shakeAll();
}
function shakeAll() {
if (shake and still) {
shaking = true;
var _local1 = 0;
while (_local1 < shakeMCs.length) {
if (Math.random() < 0.5) {
shakeMCs[_local1]._x = (shakeMCs[_local1].x + (Math.random() * 3)) - 1.5;
shakeMCs[_local1]._y = (shakeMCs[_local1].y + (Math.random() * 3)) - 1.5;
}
_local1++;
}
} else if ((!shake) and shaking) {
shaking = false;
var _local1 = 0;
while (_local1 < shakeMCs.length) {
shakeMCs[_local1]._x = shakeMCs[_local1].x;
shakeMCs[_local1]._y = shakeMCs[_local1].y;
_local1++;
}
}
}
function startMatrix() {
matrix = new Array();
var _local1 = 0;
while (_local1 < maxCol) {
matrix.push(new Array());
_local1++;
}
addMatrixColumn();
}
function addMatrixColumn() {
var _local2 = new Array();
var _local1 = 0;
while (_local1 <= maxRow) {
newBlock = addBlock(matrix.length, _local1);
_local2.push(newBlock);
_local1++;
}
matrix.push(_local2);
howDeep++;
}
function addBlock(col, row) {
newBlockName = blockClips[Math.floor(Math.random() * 4)];
newBlock = matrixMC.attachMovie(newBlockName, "block" + blockNum, 10000 + (blockNum++));
newBlock._xscale = 65;
newBlock._yscale = 65;
newBlock.blockType = newBlockName;
newBlock.row = row;
newBlock.col = col;
newBlock.blockNum = blockNum - 1;
newBlock.marked = false;
newBlock.drop = false;
newBlock.dx = 0;
newBlock.bonus = 0;
newBlock.fallVolume = 0;
newBlock.removed = false;
if (newBlockName == "gold") {
if (Math.random() < (0.01 * ((2 + gLevel) - (numMult * 3)))) {
newBlock.gotoAndStop("object");
newBlock.bonus = 2;
numMult++;
}
} else if (Math.random() < (0.02 + (0.01 * gLevel))) {
newBlock.gotoAndStop("object");
newBlock.bonus = 2;
}
return(newBlock);
}
function drawMatrix() {
var _local1 = 0;
while (_local1 < matrix.length) {
drawColumn(_local1);
_local1++;
}
}
function drawColumn(col) {
var _local2 = col;
var _local1 = 0;
while (_local1 < matrix[_local2].length) {
matrix[_local2][_local1]._x = 525 - (_local2 * spaceCol);
matrix[_local2][_local1]._y = 360 - (_local1 * spaceRow);
matrix[_local2][_local1].swapDepths((100 + (_local2 * (maxRow + 2))) + _local1);
_local1++;
}
}
function addColumn() {
shake = false;
var _local2 = false;
if (howDeep >= mineDeep) {
stopPlay();
checkBonus();
gotoAndStop ("leveldone");
_local2 = true;
} else if (matrix[0][0]._name != undefined) {
_local2 = true;
var _local1 = 0;
while (_local1 < matrix.length) {
if ((matrix[_local1].length == 0) or (matrix[_local1][0]._name == undefined)) {
_local2 = false;
break;
}
_local1++;
}
if (_local2) {
stopPlay();
shake = false;
gotoAndStop ("walkaway");
}
}
if (!_local2) {
addMatrixColumn();
shiftColumns();
drawMatrix();
addDelay = addDelay - (25 + (25 * gLevel));
if (addDelay < 2000) {
addDelay = 2000;
}
addTime = addTime + addDelay;
if (Math.random() < (0.2 + (0.5 * gLevel))) {
blockFall();
}
if (howDeep == mineDeep) {
addTime = addTime + 10000;
}
}
}
function stopPlay() {
addTime = 0;
playActive = false;
}
function shiftColumns() {
var _local2 = matrix.length - 1;
while (_local2 >= 0) {
if ((matrix[_local2][0]._name == undefined) and (matrix[_local2 - 1][0]._name != undefined)) {
matrix.splice(_local2, 1);
matrix.unshift(new Array());
break;
}
_local2--;
}
matrix.splice(0, 1);
_local2 = 0;
while (_local2 < matrix.length) {
var _local1 = 0;
while (_local1 < matrix[_local2].length) {
matrix[_local2][_local1].col = _local2;
matrix[_local2][_local1].row = _local1;
_local1++;
}
_local2++;
}
mineDepth = (howDeep + "/") + mineDeep;
}
function clickBlock(mc) {
clickBuffer.push(mc);
}
function checkClickBuffer() {
if ((clickBuffer.length > 0) and (!((addTime > 0) and (addTime <= getTimer())))) {
clickInfo = clickBuffer.shift();
if (((clickInfo._name != undefined) and (clickInfo.marked != true)) and (clickInfo.drop != true)) {
addScore(-1);
clickedBlock = clickInfo;
pickOrig = {x:pick._x, y:pick._y};
pickDest = {x:clickedBlock._x, y:clickedBlock._y};
pickStartTime = getTimer();
pick.swapDepths(2002);
pick._rotation = 10;
pickThrow = true;
miner.gotoAndPlay("throw");
pick.gotoAndStop(whichPick);
pick._visible = true;
swish = new Sound();
swish.attachSound("swish");
swish.setVolume(25);
swish.start();
}
}
}
function movePick() {
percentTravel = 0.005 * (getTimer() - pickStartTime);
if (percentTravel > 1) {
percentTravel = 1;
}
pick._x = (pickOrig.x * (1 - percentTravel)) + (pickDest.x * percentTravel);
pick._y = (pickOrig.y * (1 - percentTravel)) + (pickDest.y * percentTravel);
pick._rotation = pick._rotation - 15;
if (percentTravel >= 1) {
pick._x = pickOrig.x;
pick._y = pickOrig.y;
pick._rotation = 10;
hitBlock(clickInfo);
pick._visible = false;
pickThrow = false;
}
}
function hitBlock(ci) {
lastHitLoc = {x:ci._x, y:ci._y};
removeArray = new Array();
var numBlocks = preRemoveBlock(ci, ci.blockType, 0);
if (numBlocks > 1) {
if (ci.blockType == "gold") {
removeBlocks(removeArray.length * 10);
bonuses = 1;
var _local1 = 0;
while (_local1 < removeArray.length) {
var _local2 = removeArray[_local1].bonus;
if (_local2 > 1) {
bonuses = bonuses * _local2;
numMult--;
}
_local1++;
}
points = ((numBlocks * numBlocks) * 10) * bonuses;
if (numBlocks > maxblocks) {
maxblocks = numBlocks;
}
if (bonuses > maxmult) {
maxmult = bonuses;
}
if (points > maxpts) {
maxpts = points;
}
playSound(_root, "hitgold", 50);
} else {
bonuses = 0;
var _local1 = 0;
while (_local1 < removeArray.length) {
var _local2 = removeArray[_local1].bonus;
if (_local2 > 0) {
bonuses++;
startScoreFly(100, {x:removeArray[_local1]._x, y:removeArray[_local1]._y}, 0, "");
playSound(_root, "bonus", 100);
}
_local1++;
}
removeBlocks("");
points = 0;
}
} else {
snd = new Sound();
snd.attachSound("miss");
snd.setVolume(15);
snd.start();
unmarkAll();
}
}
function removeBlocks(pts) {
var _local2 = pts;
var _local1 = 0;
while (_local1 < removeArray.length) {
removeArray[_local1].swapDepths(removeArray[_local1].blockNum + 1000);
removeArray[_local1].gotoAndPlay("poof");
removeArray[_local1].poof.points = _local2;
removeArray[_local1].removed = true;
_local1++;
}
playSound(removeArray[0], "hit", 15);
}
function preRemoveBlock(mc, blockType, rcount) {
var _local1 = mc;
var _local3 = blockType;
if (_local1.blockType != _local3) {
return(0);
}
if (_local1.marked) {
return(0);
}
_local1.marked = true;
removeArray.push(_local1);
var _local2 = 1;
if (_local1.col > 0) {
_local2 = _local2 + preRemoveBlock(matrix[_local1.col - 1][_local1.row], _local3, rcount + 1);
}
if (_local1.col < maxCol) {
_local2 = _local2 + preRemoveBlock(matrix[_local1.col + 1][_local1.row], _local3, rcount + 1);
}
if (_local1.row > 0) {
_local2 = _local2 + preRemoveBlock(matrix[_local1.col][_local1.row - 1], _local3, rcount + 1);
}
if (_local1.row < maxRow) {
_local2 = _local2 + preRemoveBlock(matrix[_local1.col][_local1.row + 1], _local3, rcount + 1);
}
return(_local2);
}
function unmarkAll() {
var _local1 = 0;
while (_local1 < removeArray.length) {
removeArray[_local1].marked = false;
_local1++;
}
removeArray = new Array();
}
function donePoof(mc) {
var _local2 = mc;
var _local1 = 0;
while (_local1 < removeArray.length) {
if (_local2 == removeArray[_local1]) {
removeArray.splice(_local1, 1);
break;
}
_local1++;
}
_local2.removeMovieClip();
if (removeArray.length == 0) {
if (points > 0) {
startScoreFly(points, lastHitLoc, 0, "");
}
dropBlock = true;
}
}
function doDrop() {
var _local3 = findDrops() > 0;
if (!_local3) {
dropBlock = false;
drawMatrix();
if (playActive) {
if (!checkAvailable()) {
addTime = Math.min(addTime, getTimer() + 2000);
}
}
} else {
var _local2 = 0;
while (_local2 < matrix.length) {
var _local1 = 0;
while (_local1 < matrix[_local2].length) {
mc = matrix[_local2][_local1];
if (mc.drop) {
mc._y = mc._y + spaceRow;
mc.row--;
mc.drop = false;
matrix[_local2][_local1 - 1] = mc;
matrix[_local2][_local1 - 1].swapDepths((100 + (_local2 * (maxRow + 2))) + _local1);
matrix[_local2][_local1] = undefined;
if (((_local1 - 2) < 0) or (matrix[_local2][_local1 - 2]._name != undefined)) {
matrix[_local2][_local1 - 1].snd = new Sound();
matrix[_local2][_local1 - 1].snd.attachSound("drop");
matrix[_local2][_local1 - 1].snd.setVolume(9 + (9 * matrix[_local2][_local1 - 1].fallVolume));
matrix[_local2][_local1 - 1].snd.start();
matrix[_local2][_local1 - 1].fallVolume = 0;
} else {
matrix[_local2][_local1 - 1].fallVolume++;
}
}
_local1++;
}
_local2++;
}
}
}
function findDrops() {
n = 0;
var _local2 = 0;
while (_local2 < matrix.length) {
var _local1 = 1;
while (_local1 < matrix[_local2].length) {
if (matrix[_local2][_local1]._name == undefined) {
} else if (matrix[_local2][_local1 - 1]._name == undefined) {
var _local3 = _local1 - 1;
while (_local3 < maxRow) {
matrix[_local2][_local1].drop = true;
n++;
_local3++;
}
}
_local1++;
}
_local2++;
}
return(n);
}
function blockFall() {
var _local1 = 0;
while (_local1 < matrix.length) {
if (matrix[_local1].length > 0) {
break;
}
_local1++;
}
_local1 = 15 - Math.floor(Math.random() * (15 - _local1));
if (matrix[_local1][maxRow - 1]._name == undefined) {
newBlock = addBlock(_local1, maxRow - 1);
matrix[_local1][maxRow - 1] = newBlock;
dropBlock = true;
drawMatrix();
return(true);
}
return(false);
}
function startScoreFly(n, loc, delay, snd) {
mc = attachMovie("scoreFly", "scoreFly" + scoreFlyNum, scoreFlyNum + 3000);
scoreFlyNum++;
mc.scoreField = n;
mc.points = n;
mc.scoreFlyOrig = {x:loc.x, y:loc.y};
mc.scoreFlyDest = {x:scoreDisplay._x, y:scoreDisplay._y};
mc._x = lastHitLoc.x;
mc._y = lastHitLoc.y;
mc.scoreFlyTime = getTimer() + delay;
mc.started = false;
mc.scoreFlyObject = setInterval(moveScoreFly, 10, mc);
mc.swapDepths(2004);
}
function moveScoreFly(mc) {
var _local1 = mc;
var _local2 = 0.002 * (getTimer() - _local1.scoreFlyTime);
if (_local2 <= 0) {
_local2 = 0;
_local1._x = -1000;
}
if (_local1.started == false) {
_local1.started = true;
_local1.snd = new Sound();
_local1.snd.attachSound("bonus");
_local1.snd.start();
}
if (_local2 > 1) {
_local2 = 1;
}
_local1._x = (_local1.scoreFlyOrig.x * (1 - _local2)) + (_local1.scoreFlyDest.x * _local2);
_local1._y = (_local1.scoreFlyOrig.y * (1 - _local2)) + (_local1.scoreFlyDest.y * _local2);
_local1._xscale = 40 + (_local2 * 60);
_local1._yscale = 40 + (_local2 * 60);
if (_local2 >= 1) {
addScore(_local1.points);
clearInterval(_local1.scoreFlyObject);
removeMovieClip(_local1);
scoreDisplay.snd = new Sound();
scoreDisplay.snd.attachSound("coins");
scoreDisplay.snd.start();
}
}
function addScore(points) {
score = score + points;
scoreCheck = String(Number(scoreCheck) + points);
if (score < 0) {
score = 0;
scoreCheck = "0";
}
scoreDisplay.scoreField = score;
}
function checkAvailable() {
var _local2 = 1;
while (_local2 < matrix.length) {
var _local1 = 1;
while (_local1 < matrix[_local2].length) {
if (matrix[_local2][_local1].blockType == undefined) {
} else {
if (matrix[_local2][_local1].blockType == matrix[_local2][_local1 - 1].blockType) {
return(true);
}
if (matrix[_local2][_local1].blockType == matrix[_local2 - 1][_local1].blockType) {
return(true);
}
}
_local1++;
}
_local2++;
}
return(false);
}
function checkBonus() {
var _local2 = 1000;
var _local1 = 0;
while (_local1 < matrix.length) {
if (matrix[_local1][0]._name == undefined) {
startScoreFly(100 * gLevel, {x:525 - (_local1 * spaceCol), y:360}, _local2, "bonus");
_local2 = _local2 + 300;
}
_local1++;
}
}
function playSound(mc, soundName, vol) {
var _local1 = soundName;
var _local2 = mc;
_local2[_local1] = new Sound();
_local2[_local1].attachSound(_local1);
_local2[_local1].setVolume(vol);
_local2[_local1].start();
}
setGlobals();
startMatrix();
drawMatrix();
miner.stop();
stop();
Frame 7
stop();
Frame 8
stop();
Instance of Symbol 116 MovieClip in Frame 8
onClipEvent (load) {
if ((_root.scoremode != "guestonly") and (_root.scoremode != "normal")) {
this._visible = false;
}
}
Frame 9
gLevel++;
mineDeep = (gLevel * 4) + 14;
mineDepth = "1/" + mineDeep;
mineNumber = gLevel;
stop();
Instance of Symbol 53 MovieClip "dancer" in Frame 9
onClipEvent (load) {
starttime = getTimer();
speed = 50;
}
onClipEvent (enterFrame) {
t = getTimer() - starttime;
if (t <= 2000) {
f = Math.floor((t / speed) % 20) + 1;
gotoAndStop(f +3);
} else {
gotoAndStop (24);
}
}
Symbol 12 Button
on (press) {
_parent._parent.clickBlock(this);
}
Symbol 16 Button
on (press) {
_parent._parent.clickBlock(this);
}
Symbol 17 MovieClip Frame 9
stop();
_parent._parent._parent.donePoof(_parent);
Symbol 11 MovieClip [dirt] Frame 1
stop();
Symbol 11 MovieClip [dirt] Frame 7
stop();
Symbol 24 MovieClip [granite] Frame 1
stop();
Symbol 24 MovieClip [granite] Frame 7
stop();
Symbol 28 MovieClip [slate] Frame 1
stop();
Symbol 28 MovieClip [slate] Frame 7
stop();
Symbol 31 MovieClip [gold] Frame 1
stop();
Symbol 31 MovieClip [gold] Frame 7
stop();
Symbol 37 MovieClip [scorefly] Frame 1
stop();
Symbol 42 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 47 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 21
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 69 Button
on (release) {
play();
}
Symbol 76 Button
on (release) {
play();
}
Symbol 80 MovieClip Frame 1
stop();
Symbol 92 Button
on (release) {
gotoAndPlay ("preplay");
}
Symbol 93 Button
on (release) {
gotoAndPlay ("preplay");
}
Symbol 94 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 1
stop();
Instance of Symbol 100 MovieClip "pick" in Symbol 97 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.selectedPick);
}
Symbol 97 MovieClip Frame 4
gotoAndPlay ("walk");
Symbol 97 MovieClip Frame 9
gotoAndStop (1);
Symbol 114 Button
on (release) {
_root.getURL("http://flasharcade.com/game.php?goldstrike");
}
Symbol 117 Button
on (press) {
_root.extra = _root.gLevel;
td = Math.floor(_root.timedebug.timeadd / _root.timedebug.timecount);
if (_root.timedebug.timecount < 1) {
td = 0;
}
_root.stats = (((((((("maxpts" + _root.maxpts) + "/") + _root.maxblocks) + "/") + _root.maxmult) + " f") + td) + " m") + _root.timedebug.timemax;
_root.submitScoreFA();
}
Symbol 120 Button
on (release) {
_root.getURL("http://flasharcade.com/game.php?goldstrike");
}
Symbol 121 Button
on (release) {
gotoAndPlay ("preplay");
}