Frame 1
com.novelgames.flashgames.common.MainDevelopment.initialize(this);
Frame 23
finalScoreTXT.text = "You scored: " + _global.finalScore;
stop();
Instance of Symbol 84 MovieClip in Frame 23
on (release) {
getURL ("http://www.doof.com/?ref=cascade", "_blank");
}
Symbol 9 MovieClip [block] Frame 1
#initclip 16
Object.registerClass("block", com.novelgames.flashgames.bricks.Block);
#endinitclip
Symbol 23 MovieClip [message] Frame 1
#initclip 12
Object.registerClass("message", com.novelgames.flashgames.bricks.Message);
#endinitclip
Symbol 23 MovieClip [message] Frame 20
showClearFinished();
Symbol 23 MovieClip [message] Frame 35
showGameOverFinished();
theScore = _parent.getScore();
trace(theScore);
if (_root.inContainer) {
_root.sendApiScore(theScore);
} else {
trace("game over screen");
_root.displayScore = theScore;
_root.gotoAndPlay("GameOverScreen");
}
Symbol 26 MovieClip [wandsDisplay] Frame 1
#initclip 13
Object.registerClass("wandsDisplay", com.novelgames.flashgames.bricks.WandsDisplay);
#endinitclip
Symbol 38 MovieClip [game] Frame 1
#initclip 14
Object.registerClass("game", com.novelgames.flashgames.bricks.Game);
#endinitclip
Symbol 43 MovieClip [muteButton] Frame 1
#initclip 15
Object.registerClass("muteButton", com.novelgames.flashgames.common.MuteButton);
#endinitclip
Symbol 45 MovieClip [GameConnectorAS2] Frame 1
#initclip 11
Object.registerClass("GameConnectorAS2", com.tmgc.gameconnector.GameConnectorAS2);
#endinitclip
Symbol 59 Button
on (release) {
getURL ("http://www.doof.com/?ref=cascade", "_blank");
}
Symbol 85 MovieClip [__Packages.com.novelgames.flashgames.common.MainDevelopment] Frame 0
class com.novelgames.flashgames.common.MainDevelopment extends MovieClip
{
var gotoAndStop, startButton, highScoresButton, moreGamesButton;
function MainDevelopment () {
super();
}
static function initialize(movieClip) {
movieClip.__proto__ = com.novelgames.flashgames.common.MainDevelopment.prototype;
movieClip.gotoTitlePage();
}
function gotoTitlePage() {
gotoAndStop("title");
startButton.onRelease = function () {
this._parent.gotoInstructionsPage();
};
highScoresButton.onRelease = function () {
this._parent.showHighScores();
};
moreGamesButton.onRelease = function () {
this._parent.getURL("http://www.novelgames.com", "_blank");
};
}
function gotoInstructionsPage() {
gotoAndStop("instructions");
startButton.onRelease = function () {
this._parent.gotoGamePage();
};
}
function gotoGamePage() {
gotoAndStop("game");
}
function showHighScores() {
trace("showHighScores()");
}
function showEnterHighScore(score) {
trace(("showEnterHighScore(" + score) + ")");
}
}
Symbol 86 MovieClip [__Packages.com.novelgames.flashgames.bricks.Message] Frame 0
class com.novelgames.flashgames.bricks.Message extends MovieClip
{
var stop, gotoAndPlay, gotoAndStop, _parent;
function Message () {
super();
stop();
}
function showClear() {
gotoAndPlay("clear");
}
function showGameOver() {
}
function showClearFinished() {
gotoAndStop("hide");
_parent.showNextStage();
}
function showGameOverFinished() {
stop();
}
}
Symbol 87 MovieClip [__Packages.com.novelgames.flashgames.bricks.WandsDisplay] Frame 0
class com.novelgames.flashgames.bricks.WandsDisplay extends MovieClip
{
var stop, gotoAndStop;
function WandsDisplay () {
super();
stop();
}
function updateWands(noOfWands) {
gotoAndStop(6 - noOfWands);
}
}
Symbol 88 MovieClip [__Packages.com.novelgames.flashgames.bricks.Game] Frame 0
class com.novelgames.flashgames.bricks.Game extends MovieClip
{
var isDestroyingBlocks, isDroppingBlocks, isMovingBlocks, noOfWands, score, soundDestroy, soundWand, soundClear, soundGameOver, _parent, levelIntervalID, levelStartTime, strTime, destroyingBlocks, wandsDisplay, blocks, blocksHolder, startDestroyBlocksTime, intervalID, droppingBlocks, startDropBlocksTime, movingBlocks, startMoveBlocksTime, message;
function Game () {
super();
isDestroyingBlocks = false;
isDroppingBlocks = false;
isMovingBlocks = false;
noOfWands = com.novelgames.flashgames.bricks.Config.NOOFWANDS;
score = 0;
soundDestroy = new com.novelgames.flashgames.common.NewSound(this, "soundDestroy");
soundWand = new com.novelgames.flashgames.common.NewSound(this, "soundWand");
soundClear = new com.novelgames.flashgames.common.NewSound(this, "soundClear");
soundGameOver = new com.novelgames.flashgames.common.NewSound(this, "soundGameOver");
_parent.connector.gameStarted(0);
createBlocks();
levelIntervalID = setInterval(mx.utils.Delegate.create(this, checkLevelTime), 1);
}
function checkLevelTime() {
if (isGameActive) {
var _local2 = getTimer() - levelStartTime;
if (_local2 >= com.novelgames.flashgames.bricks.Config.LEVEL_TIME) {
gameOver();
}
strTime = Math.floor((com.novelgames.flashgames.bricks.Config.LEVEL_TIME - _local2) / 1000).toString();
}
}
function blockPressed(block) {
var _local3;
var _local9;
var _local8;
var _local7;
var _local5;
var _local6;
var _local2;
if (isDestroyingBlocks) {
return(undefined);
}
if (isDroppingBlocks) {
return(undefined);
}
if (isMovingBlocks) {
return(undefined);
}
if ((noOfWands == 0) && (!getSameTypesAreAdjacent(block))) {
return(undefined);
}
_local3 = block.type;
block.startDestroying();
destroyingBlocks = [block];
_local2 = 0;
while (_local2 < destroyingBlocks.length) {
addToDestroyingBlocks(destroyingBlocks[_local2].x - 1, destroyingBlocks[_local2].y, _local3);
addToDestroyingBlocks(destroyingBlocks[_local2].x + 1, destroyingBlocks[_local2].y, _local3);
addToDestroyingBlocks(destroyingBlocks[_local2].x, destroyingBlocks[_local2].y - 1, _local3);
addToDestroyingBlocks(destroyingBlocks[_local2].x, destroyingBlocks[_local2].y + 1, _local3);
_local2++;
}
if (destroyingBlocks.length == 1) {
noOfWands--;
wandsDisplay.updateWands(noOfWands);
soundWand.start();
} else {
soundDestroy.start();
}
_local5 = com.novelgames.flashgames.bricks.Config.SCORE_PERBLOCK + (destroyingBlocks.length * com.novelgames.flashgames.bricks.Config.SCORE_PEREXTRABLOCK);
_local6 = destroyingBlocks.length * _local5;
score = score + _local6;
startDestroyingBlocks();
}
function showNextStage() {
createBlocks();
}
function showEnterHighScore() {
_parent.showEnterHighScore(score);
}
function createBlocks() {
levelNum++;
var _local4;
var _local6;
var _local5;
var _local3;
var _local2;
levelStartTime = getTimer();
isGameActive = true;
blocks = new Array();
_local3 = 0;
while (_local3 < com.novelgames.flashgames.bricks.Config.DIMENSION_X) {
blocks[_local3] = new Array();
_local2 = 0;
while (_local2 < com.novelgames.flashgames.bricks.Config.DIMENSION_Y) {
_local4 = blocksHolder.getNextHighestDepth();
_local6 = blocksHolder.attachMovie("block", "block" + _local4, _local4);
_local5 = _local6;
_local5.initialize(_local3, _local2);
blocks[_local3][_local2] = _local5;
_local2++;
}
_local3++;
}
}
function addToDestroyingBlocks(x, y, type) {
var _local2;
if ((((x < 0) || (x >= com.novelgames.flashgames.bricks.Config.DIMENSION_X)) || (y < 0)) || (y >= com.novelgames.flashgames.bricks.Config.DIMENSION_Y)) {
return(undefined);
}
_local2 = blocks[x][y];
if (_local2.destroying) {
return(undefined);
}
if (_local2.type != type) {
return(undefined);
}
_local2.startDestroying();
destroyingBlocks.push(_local2);
}
function startDestroyingBlocks() {
isDestroyingBlocks = true;
startDestroyBlocksTime = getTimer();
intervalID = setInterval(this, "doDestroyBlocks", 1);
}
function doDestroyBlocks() {
var _local5 = getTimer() - startDestroyBlocksTime;
var _local3;
var _local4;
var _local2;
if (_local5 < com.novelgames.flashgames.bricks.Config.BLOCK_DESTROYTIME) {
_local3 = 100 - ((_local5 / com.novelgames.flashgames.bricks.Config.BLOCK_DESTROYTIME) * 100);
_local4 = ((360 * com.novelgames.flashgames.bricks.Config.BLOCK_DESTROYROTATIONS) * _local5) / com.novelgames.flashgames.bricks.Config.BLOCK_DESTROYTIME;
_local2 = 0;
while (_local2 < destroyingBlocks.length) {
destroyingBlocks[_local2]._xscale = _local3;
destroyingBlocks[_local2]._yscale = _local3;
destroyingBlocks[_local2]._rotation = _local4;
_local2++;
}
} else {
isDestroyingBlocks = false;
clearInterval(intervalID);
_local2 = 0;
while (_local2 < destroyingBlocks.length) {
blocks[destroyingBlocks[_local2].x][destroyingBlocks[_local2].y] = null;
destroyingBlocks[_local2].removeMovieClip();
_local2++;
}
startDroppingBlocks();
}
updateAfterEvent();
}
function startDroppingBlocks() {
var _local4;
var _local3;
var _local2;
droppingBlocks = new Array();
_local3 = 0;
while (_local3 < com.novelgames.flashgames.bricks.Config.DIMENSION_X) {
_local4 = 0;
_local2 = com.novelgames.flashgames.bricks.Config.DIMENSION_Y - 1;
while (_local2 >= 0) {
if (blocks[_local3][_local2] == null) {
_local4++;
} else if (_local4 > 0) {
blocks[_local3][_local2].startDropping(_local4);
droppingBlocks.push(blocks[_local3][_local2]);
blocks[_local3][_local2] = null;
}
_local2--;
}
_local3++;
}
isDroppingBlocks = true;
startDropBlocksTime = getTimer();
intervalID = setInterval(this, "doDropBlocks", 1);
}
function doDropBlocks() {
var _local3 = (getTimer() - startDropBlocksTime) / 1000;
var _local2;
_local2 = 0;
while (_local2 < droppingBlocks.length) {
if (droppingBlocks[_local2].doDrop(_local3)) {
blocks[droppingBlocks[_local2].x][droppingBlocks[_local2].y] = droppingBlocks[_local2];
droppingBlocks.splice(_local2, 1);
_local2--;
}
_local2++;
}
if (droppingBlocks.length == 0) {
clearInterval(intervalID);
isDroppingBlocks = false;
if (!checkWin()) {
if (!checkMoveColumns()) {
checkGameOver();
}
}
}
updateAfterEvent();
}
function checkMoveColumns() {
var _local4 = getEmptyColumns();
var _local6 = 0;
var _local7 = 0;
var _local9 = 0;
var _local10;
var _local5;
var _local8;
var _local2;
var _local3;
if (_local4.length == 0) {
return(false);
}
_local2 = 0;
while (_local2 < _local4.length) {
if (_local4[_local2] == _local2) {
_local6++;
}
if (_local4[(_local4.length - _local2) - 1] == ((com.novelgames.flashgames.bricks.Config.DIMENSION_X - _local2) - 1)) {
_local7++;
}
_local2++;
}
if ((_local6 + _local7) == _local4.length) {
return(false);
}
_local9 = Math.floor(_local4.length / 2);
_local10 = _local4.length - _local9;
if (_local9 < _local6) {
_local9 = _local6;
_local10 = _local4.length - _local9;
} else if (_local10 < _local7) {
_local10 = _local7;
_local9 = _local4.length - _local10;
}
movingBlocks = new Array();
_local5 = _local9 - _local6;
_local8 = _local6;
_local2 = _local6;
while (_local2 < (com.novelgames.flashgames.bricks.Config.DIMENSION_X - _local7)) {
if (_local2 == _local4[_local8]) {
_local5--;
_local8++;
} else if (_local5 != 0) {
_local3 = com.novelgames.flashgames.bricks.Config.DIMENSION_Y - 1;
while (_local3 >= 0) {
if (blocks[_local2][_local3] == null) {
break;
}
blocks[_local2][_local3].startMoving(_local5);
movingBlocks.push(blocks[_local2][_local3]);
blocks[_local2][_local3] = null;
_local3--;
}
}
_local2++;
}
isMovingBlocks = true;
startMoveBlocksTime = getTimer();
intervalID = setInterval(this, "doMoveBlocks", 1);
return(true);
}
function getEmptyColumns() {
var _local3 = new Array();
var _local2;
var _local4;
_local2 = 0;
while (_local2 < com.novelgames.flashgames.bricks.Config.DIMENSION_X) {
if (blocks[_local2][com.novelgames.flashgames.bricks.Config.DIMENSION_Y - 1] == null) {
_local3.push(_local2);
}
_local2++;
}
return(_local3);
}
function doMoveBlocks() {
var _local3 = (getTimer() - startMoveBlocksTime) / 1000;
var _local2;
_local2 = 0;
while (_local2 < movingBlocks.length) {
if (movingBlocks[_local2].doMove(_local3)) {
blocks[movingBlocks[_local2].x][movingBlocks[_local2].y] = movingBlocks[_local2];
movingBlocks.splice(_local2, 1);
_local2--;
}
_local2++;
}
if (movingBlocks.length == 0) {
clearInterval(intervalID);
isMovingBlocks = false;
checkGameOver();
}
updateAfterEvent();
}
function getSameTypesAreAdjacent(block) {
if ((block.x > 0) && (blocks[block.x - 1][block.y].type == block.type)) {
return(true);
}
if ((block.x < (com.novelgames.flashgames.bricks.Config.DIMENSION_X - 1)) && (blocks[block.x + 1][block.y].type == block.type)) {
return(true);
}
if ((block.y > 0) && (blocks[block.x][block.y - 1].type == block.type)) {
return(true);
}
if ((block.y < (com.novelgames.flashgames.bricks.Config.DIMENSION_Y - 1)) && (blocks[block.x][block.y + 1].type == block.type)) {
return(true);
}
return(false);
}
function checkWin() {
var _local2;
_local2 = 0;
while (_local2 < com.novelgames.flashgames.bricks.Config.DIMENSION_X) {
if (blocks[_local2][com.novelgames.flashgames.bricks.Config.DIMENSION_Y - 1] != null) {
return(false);
}
_local2++;
}
message.showClear();
score = score + com.novelgames.flashgames.bricks.Config.SCORE_CLEAR;
isGameActive = false;
soundClear.start();
return(true);
}
function checkGameOver() {
var _local3;
var _local2;
if (noOfWands > 0) {
return(undefined);
}
_local3 = 0;
while (_local3 < com.novelgames.flashgames.bricks.Config.DIMENSION_X) {
_local2 = 0;
while (_local2 < com.novelgames.flashgames.bricks.Config.DIMENSION_Y) {
if (blocks[_local3][_local2] == null) {
} else if (getSameTypesAreAdjacent(blocks[_local3][_local2])) {
return(undefined);
}
_local2++;
}
_local3++;
}
gameOver();
}
function gameOver() {
isGameActive = false;
clearInterval(levelIntervalID);
strTime = "0";
message.showGameOver();
soundGameOver.start();
_global.finalScore = score;
_parent.gotoAndStop("gameOverScreen");
}
var isGameActive = false;
var levelNum = 0;
}
Symbol 89 MovieClip [__Packages.com.novelgames.flashgames.bricks.Config] Frame 0
class com.novelgames.flashgames.bricks.Config
{
function Config () {
}
static var DIMENSION_X = 15;
static var DIMENSION_Y = 15;
static var BLOCK_WIDTH = 25;
static var BLOCK_HEIGHT = 25;
static var BLOCK_COLOURS = [16711680, 52224, 16776960];
static var BLOCK_DESTROYTIME = 200;
static var BLOCK_DESTROYROTATIONS = 0.2;
static var BLOCK_DROPACCELERATION = 1000;
static var BLOCK_MOVECOLUMNACCELERATION = 500;
static var NOOFWANDS = 5;
static var SCORE_PERBLOCK = 10;
static var SCORE_PEREXTRABLOCK = 1;
static var SCORE_CLEAR = 10000;
static var LEVEL_TIME = 60000;
}
Symbol 90 MovieClip [__Packages.com.novelgames.flashgames.common.NewSound] Frame 0
class com.novelgames.flashgames.common.NewSound extends Sound
{
var attachSound, setVolume, target, symbolName;
function NewSound (target, symbolName) {
super(target);
var _local3;
attachSound(symbolName);
setVolume(volumeAll);
this.target = target;
this.symbolName = symbolName;
sounds.push(this);
_local3 = 0;
while (_local3 < sounds.length) {
if (sounds[_local3] == this) {
} else if ((sounds[_local3].target == target) && (sounds[_local3].symbolName == symbolName)) {
sounds.splice(_local3, 1);
_local3--;
}
_local3++;
}
}
static function setVolumeAll(volume) {
var _local1;
volumeAll = volume;
_local1 = 0;
while (_local1 < sounds.length) {
sounds[_local1].setVolume(volume);
_local1++;
}
}
static function muteAll() {
setVolumeAll(0);
}
static function unmuteAll() {
setVolumeAll(100);
}
static function getIsMuteAll() {
return(volumeAll == 0);
}
static var sounds = new Array();
static var volumeAll = 100;
}
Symbol 91 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 92 MovieClip [__Packages.com.novelgames.flashgames.bricks.Block] Frame 0
class com.novelgames.flashgames.bricks.Block extends MovieClip
{
var destroying, dropping, stop, x, y, _x, _y, type, colour, gotoAndStop, targetY, moving, targetX, _parent;
function Block () {
super();
destroying = false;
dropping = false;
stop();
}
function initialize(x, y) {
this.x = x;
this.y = y;
_x = (com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH / 2) + (x * com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH);
_y = (com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT / 2) + (y * com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT);
type = Math.floor(Math.random() * com.novelgames.flashgames.bricks.Config.BLOCK_COLOURS.length);
new Color(colour).setRGB(com.novelgames.flashgames.bricks.Config.BLOCK_COLOURS[type]);
}
function startDestroying() {
destroying = true;
gotoAndStop("destroy");
}
function startDropping(noOfSteps) {
dropping = true;
targetY = y + noOfSteps;
}
function doDrop(time) {
_y = ((com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT / 2) + (y * com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT)) + (((com.novelgames.flashgames.bricks.Config.BLOCK_DROPACCELERATION * time) * time) / 2);
if (_y >= ((com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT / 2) + (targetY * com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT))) {
_y = (com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT / 2) + (targetY * com.novelgames.flashgames.bricks.Config.BLOCK_HEIGHT);
y = targetY;
return(true);
}
return(false);
}
function startMoving(noOfSteps) {
moving = true;
targetX = x + noOfSteps;
}
function doMove(time) {
_x = ((com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH / 2) + (x * com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH)) + ((((com.novelgames.flashgames.bricks.Config.BLOCK_MOVECOLUMNACCELERATION * time) * time) / 2) * ((targetX > x) ? 1 : -1));
if (((targetX > x) && (_x >= ((com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH / 2) + (targetX * com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH)))) || ((targetX < x) && (_x <= ((com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH / 2) + (targetX * com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH))))) {
_x = (com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH / 2) + (targetX * com.novelgames.flashgames.bricks.Config.BLOCK_WIDTH);
x = targetX;
return(true);
}
return(false);
}
function onPress() {
_parent._parent.blockPressed(this);
}
}
Symbol 93 MovieClip [__Packages.com.novelgames.flashgames.common.MuteButton] Frame 0
class com.novelgames.flashgames.common.MuteButton extends MovieClip
{
var gotoAndStop;
function MuteButton () {
super();
if (com.novelgames.flashgames.common.NewSound.getIsMuteAll()) {
showOff();
} else {
showOn();
}
}
function onPress() {
if (com.novelgames.flashgames.common.NewSound.getIsMuteAll()) {
com.novelgames.flashgames.common.NewSound.unmuteAll();
showOn();
} else {
com.novelgames.flashgames.common.NewSound.muteAll();
showOff();
}
}
function showOff() {
gotoAndStop("off");
}
function showOn() {
gotoAndStop("on");
}
}
Symbol 44 MovieClip [__Packages.com.tmgc.gameconnector.GameConnectorAS2] Frame 0
class com.tmgc.gameconnector.GameConnectorAS2 extends MovieClip
{
var _url, _localConnection;
function GameConnectorAS2 () {
super();
var _local7 = unescape(_url);
var _local9 = _local7.lastIndexOf("?");
var _local8 = _local7.substr(_local9 + 1, _local7.length);
var _local6 = _local8.split("&");
var _local3 = 0;
while (_local3 < _local6.length) {
var _local5 = _local6[_local3].split("=")[0];
var _local4 = _local6[_local3].split("=")[1];
if (_local5 == "doofConnectionName") {
_doofConnectionName = _local4;
}
if (_local5 == "gameConnectionName") {
_gameConnectionName = _local4;
}
_local3++;
}
_localConnection = new LocalConnection();
try {
_localConnection.connect(gameConnectionName);
} catch(error:Error) {
trace(error);
}
}
function get doofConnectionName() {
return(_doofConnectionName);
}
function get gameConnectionName() {
return(_gameConnectionName);
}
function gameStarted(initialScore) {
trace("GameConnectorAS2.gameStarted() initialScore=" + String(initialScore));
_localConnection.send(doofConnectionName, "gameStarted", initialScore);
}
function gameEnded(finalScore) {
trace("GameConnectorAS2.gameEnded() finalScore=" + String(finalScore));
_localConnection.send(doofConnectionName, "gameEnded", finalScore);
}
function gameScore(score) {
trace("GameConnectorAS2.gameScore() score=" + String(score));
_localConnection.send(doofConnectionName, "gameScore", score);
}
function gameStat(statName, statValue) {
trace((("GameConnectorAS2.gameStat() statName=" + statName) + ", statValue=") + statValue);
_localConnection.send(doofConnectionName, "gameStat", statName, statValue);
}
function gameStatList(stats) {
trace("GameConnectorAS2.gameStatList() stats=" + stats);
_localConnection.send(doofConnectionName, "gameStatList", stats);
}
function stopGame() {
trace("GameConnectorAS2.stopGame()");
}
var _doofConnectionName = "doof";
var _gameConnectionName = "game";
}
Symbol 76 Button
on (release) {
gotoAndPlay ("title");
}
Symbol 79 Button
on (release) {
getURL ("http://www.doof.com/?ref=cascade", "_blank");
}