Instance of Symbol 77 MovieClip in Frame 1
on (release) {
getURL ("http://www.doof.com/?ref=cascade", "_blank");
}
Instance of Symbol 95 MovieClip in Frame 46
onClipEvent (enterFrame) {
_rotation = (_rotation + 5);
}
Frame 201
com.novelgames.flashgames.common.MainDevelopment.initialize(this);
Instance of Symbol 141 MovieClip in Frame 201
on (release) {
getURL ("http://www.doof.com/?ref=starlines", "_blank");
}
Symbol 11 MovieClip [star] Frame 1
#initclip 20
Object.registerClass("star", com.novelgames.flashgames.stars.Star);
#endinitclip
Symbol 14 MovieClip [explodeBig] Frame 1
#initclip 13
Object.registerClass("explodeBig", com.novelgames.flashgames.stars.ExplodeBig);
#endinitclip
Symbol 15 MovieClip [explode] Frame 1
#initclip 14
Object.registerClass("explode", com.novelgames.flashgames.stars.Explode);
#endinitclip
Symbol 25 MovieClip [popup] Frame 1
#initclip 15
Object.registerClass("popup", com.novelgames.flashgames.stars.Popup);
#endinitclip
Instance of Symbol 37 MovieClip in Symbol 38 MovieClip [GameOverScreen] Frame 1
on (release) {
getURL ("http://www.doof.com/?ref=cascade", "_blank");
}
Symbol 43 MovieClip [progressBar] Frame 1
#initclip 16
Object.registerClass("progressBar", com.novelgames.flashgames.stars.ProgressBar);
#endinitclip
Symbol 50 MovieClip [message] Frame 1
#initclip 17
Object.registerClass("message", com.novelgames.flashgames.stars.Message);
#endinitclip
Symbol 62 MovieClip [game] Frame 1
#initclip 18
Object.registerClass("game", com.novelgames.flashgames.stars.Game);
#endinitclip
Symbol 67 MovieClip [muteButton] Frame 1
#initclip 19
Object.registerClass("muteButton", com.novelgames.flashgames.common.MuteButton);
#endinitclip
Symbol 154 MovieClip [__Packages.com.novelgames.flashgames.stars.ExplodeBig] Frame 0
class com.novelgames.flashgames.stars.ExplodeBig extends MovieClip
{
var _x, _y, explode;
function ExplodeBig () {
super();
}
function initialize(x, y) {
_x = x * com.novelgames.flashgames.stars.Config.STARS_SPACINGX;
_y = y * com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
}
function move(time) {
var _local2 = (100 * (1 - (time / com.novelgames.flashgames.stars.Config.EXPLODE_TIME))) + ((com.novelgames.flashgames.stars.Config.EXPLODE_BIGENDSCALE * time) / com.novelgames.flashgames.stars.Config.EXPLODE_TIME);
explode._xscale = _local2;
explode._yscale = _local2;
explode._alpha = 100 * (1 - (time / com.novelgames.flashgames.stars.Config.EXPLODE_TIME));
}
}
Symbol 155 MovieClip [__Packages.com.novelgames.flashgames.stars.Config] Frame 0
class com.novelgames.flashgames.stars.Config
{
function Config () {
}
static var STARS_DIMENSIONX = 6;
static var STARS_DIMENSIONY = 6;
static var STARS_SPACINGX = 60;
static var STARS_SPACINGY = 60;
static var STARS_COLOURS = [16711680, 52224, 26367, 16776960, 16664062, 7930570, 16750848, 16777215];
static var STARS_INITIALDROPSPEED = 500;
static var STARS_INITIALSPACINGY = 120;
static var STARS_GAMEOVERDROPSPEED = 300;
static var STARS_GAMEOVERROWINTERVAL = 200;
static var STARS_UNDRAGSPEED = 1000;
static var STARS_DROPSPEED = 1000;
static var STARS_LOCKEDMOVEDISTANCE = 10;
static var EXPLODE_STARSCALE = 50;
static var EXPLODE_STARSNO = 6;
static var EXPLODE_STARBEGINANGLE = 0;
static var EXPLODE_TIME = 150;
static var EXPLODE_DISTANCE = 30;
static var EXPLODE_BIGENDSCALE = 500;
static var LOCK_STARTSCALE = 1000;
static var LOCK_TIME = 200;
static var GROUP_MINSIZE = 3;
static var GROUP_MINEXPLODESIZE = 5;
static var PROGRESSBAR_EMPTYY = 106;
static var PROGRESSBAR_FULLY = 10;
static var MESSAGE_LEVELTIME = 1000;
static var MESSAGE_CLEARTIME = 3000;
static var MESSAGE_CLEARWAITTIME = 1000;
static var MESSAGE_GAMEOVERTIME = 1000;
static var POPUP_MOVEHEIGHT = 40;
static var POPUP_MOVETIME = 200;
static var POPUP_STAYTIME = 300;
static var SCORE_GROUP = 10;
static var SCORE_PEREXTRASTAR = 5;
static var SCORE_PEREXTRAGROUP = 10;
static var SCORE_LEVEL = 1000;
static var LEVEL_INITIALSTARS = 70;
static var LEVEL_STARSINCREASE = 20;
static var LEVEL_STARTLOCKLEVEL = 3;
static var LEVEL_INITIALLOCKINTERVAL = 20000;
static var LEVEL_LOCKINTERVALDECREASE = 0.2;
static var LEVEL_TIME = 60000;
}
Symbol 156 MovieClip [__Packages.com.novelgames.flashgames.stars.Explode] Frame 0
class com.novelgames.flashgames.stars.Explode extends MovieClip
{
var _x, _y, starX, starY, stars, directions, attachMovie;
function Explode () {
super();
}
function initialize(x, y, colour) {
var _local4;
var _local3;
var _local2;
_x = x * com.novelgames.flashgames.stars.Config.STARS_SPACINGX;
_y = y * com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
starX = (com.novelgames.flashgames.stars.Config.STARS_SPACINGX * (100 - com.novelgames.flashgames.stars.Config.EXPLODE_STARSCALE)) / 200;
starY = (com.novelgames.flashgames.stars.Config.STARS_SPACINGY * (100 - com.novelgames.flashgames.stars.Config.EXPLODE_STARSCALE)) / 200;
stars = new Array();
directions = new Array();
_local2 = 0;
while (_local2 < com.novelgames.flashgames.stars.Config.EXPLODE_STARSNO) {
_local4 = attachMovie("star", "star" + _local2, _local2);
_local3 = _local4;
_local3.setColour(colour);
_local3._xscale = com.novelgames.flashgames.stars.Config.EXPLODE_STARSCALE;
_local3._yscale = com.novelgames.flashgames.stars.Config.EXPLODE_STARSCALE;
stars.push(_local4);
directions[_local2] = new Object();
directions[_local2].x = Math.cos(((_local2 * Math.PI) * 2) / com.novelgames.flashgames.stars.Config.EXPLODE_STARSNO);
directions[_local2].y = Math.sin(((_local2 * Math.PI) * 2) / com.novelgames.flashgames.stars.Config.EXPLODE_STARSNO);
_local2++;
}
move(0);
}
function move(time) {
var _local3 = (com.novelgames.flashgames.stars.Config.EXPLODE_DISTANCE * time) / com.novelgames.flashgames.stars.Config.EXPLODE_TIME;
var _local4 = 100 * (1 - (time / com.novelgames.flashgames.stars.Config.EXPLODE_TIME));
var _local2;
_local2 = 0;
while (_local2 < stars.length) {
stars[_local2]._x = starX + (_local3 * directions[_local2].x);
stars[_local2]._y = starY + (_local3 * directions[_local2].y);
stars[_local2]._alpha = _local4;
_local2++;
}
}
}
Symbol 157 MovieClip [__Packages.com.novelgames.flashgames.stars.Star] Frame 0
class com.novelgames.flashgames.stars.Star extends MovieClip
{
var locked, willExplode, explodeMark, stop, cacheAsBitmap, x, y, originalX, originalY, colour, colourDisplay, _x, _y, gotoAndStop;
function Star () {
super();
locked = false;
willExplode = false;
explodeMark.stop();
stop();
explodeMark._visible = false;
cacheAsBitmap = true;
}
function initialize(x, y, colour) {
this.x = x;
this.y = y;
originalX = x;
originalY = y;
resetXY();
setColour(colour);
}
function setColour(colour) {
this.colour = colour;
new Color(colourDisplay).setRGB(colour);
}
function resetXY() {
_x = originalX * com.novelgames.flashgames.stars.Config.STARS_SPACINGX;
_y = originalY * com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
}
function setStatus(star) {
setColour(star.colour);
if (star.locked) {
setLocked();
} else {
setUnlocked();
}
if (star.willExplode) {
setWillExplode();
explodeMark.gotoAndPlay(star.explodeMark._currentframe);
} else {
unsetWillExplode();
}
}
function setLocked() {
locked = true;
gotoAndStop("locked");
}
function setUnlocked() {
locked = false;
gotoAndStop("normal");
}
function setWillExplode() {
willExplode = true;
explodeMark._visible = true;
explodeMark.play();
}
function unsetWillExplode() {
willExplode = false;
explodeMark._visible = false;
explodeMark.stop();
}
}
Symbol 158 MovieClip [__Packages.com.novelgames.flashgames.stars.Popup] Frame 0
class com.novelgames.flashgames.stars.Popup extends MovieClip
{
var stop, _x, _y, startY, score, gotoAndStop, intervalID, removeMovieClip, startMoveTime, _parent;
function Popup () {
super();
stop();
}
function showScore(x, y, score) {
_x = x;
_y = y;
startY = y;
this.score = score;
gotoAndStop("score");
startMoving();
}
function showCombo(x, y, score) {
_x = x;
_y = y;
startY = y;
this.score = score;
gotoAndStop("combo");
startMoving();
}
function showSuper(x, y, score) {
_x = x;
_y = y;
startY = y;
this.score = score;
gotoAndStop("super");
startMoving();
}
function hide() {
gotoAndStop("hide");
}
function destroy() {
clearInterval(intervalID);
removeMovieClip();
}
function startMoving() {
startMoveTime = getTimer();
intervalID = setInterval(this, "onMoveTime", 1);
}
function onMoveTime() {
var _local3 = getTimer();
var _local2 = _local3 - startMoveTime;
if (_local2 >= com.novelgames.flashgames.stars.Config.POPUP_MOVETIME) {
_y = startY;
clearInterval(intervalID);
intervalID = setInterval(this, "finishedStaying", com.novelgames.flashgames.stars.Config.POPUP_STAYTIME - (_local2 - com.novelgames.flashgames.stars.Config.POPUP_MOVETIME));
} else {
_y = startY - (com.novelgames.flashgames.stars.Config.POPUP_MOVEHEIGHT * Math.sin((Math.PI * _local2) / com.novelgames.flashgames.stars.Config.POPUP_MOVETIME));
}
updateAfterEvent();
}
function finishedStaying() {
clearInterval(intervalID);
_parent._parent.removePopup(this);
}
}
Symbol 159 MovieClip [__Packages.com.novelgames.flashgames.stars.ProgressBar] Frame 0
class com.novelgames.flashgames.stars.ProgressBar extends MovieClip
{
var mask;
function ProgressBar () {
super();
setProgress(0);
}
function setProgress(progress) {
mask._y = (com.novelgames.flashgames.stars.Config.PROGRESSBAR_EMPTYY * (1 - progress)) + (com.novelgames.flashgames.stars.Config.PROGRESSBAR_FULLY * progress);
}
}
Symbol 160 MovieClip [__Packages.com.novelgames.flashgames.stars.Message] Frame 0
class com.novelgames.flashgames.stars.Message extends MovieClip
{
var stop, gotoAndStop, level, playAgainButton;
function Message () {
super();
stop();
}
function showLevel(level) {
gotoAndStop("level");
this.level = level;
}
function showClear() {
gotoAndStop("clear");
}
function showGameOver() {
}
function showPlayAgain() {
gotoAndStop("playAgain");
playAgainButton.onRelease = function () {
this._parent._parent._parent.gotoTitlePage();
};
}
function hide() {
gotoAndStop("hide");
}
}
Symbol 161 MovieClip [__Packages.com.novelgames.flashgames.stars.Game] Frame 0
class com.novelgames.flashgames.stars.Game extends MovieClip
{
var score, _parent, progressBar, message, soundDestroy, soundLock, soundClear, soundGameOver, levelIntervalID, levelStartTime, strTime, popups, level, noOfStars, willGenerateLocks, lockInterval, mouseListener, starsHolder, explodes, locks, noOfStarsDestroyed, startInitialDropTime, intervalID, wrappingStar, stars, isDragging, lastLockTime, isDraggingX, isDraggingY, startDragMouseX, startDragMouseY, startDragX, startDragY, dragDistanceX, dragDistanceY, startUndragTime, startExplodeTime, popupsHolder, explodesHolder, droppingStars, startDropTime, locksHolder, startLockTime, startClearScore, startClearTime, startGameOverDropTime;
function Game () {
super();
score = 0;
_parent.connector.gameStarted(0);
progressBar.__proto__ = com.novelgames.flashgames.stars.ProgressBar.prototype;
message.__proto__ = com.novelgames.flashgames.stars.Message.prototype;
soundDestroy = new com.novelgames.flashgames.common.NewSound(this, "soundDestroy");
soundLock = new com.novelgames.flashgames.common.NewSound(this, "soundLock");
soundClear = new com.novelgames.flashgames.common.NewSound(this, "soundClear");
soundGameOver = new com.novelgames.flashgames.common.NewSound(this, "soundGameOver");
startLevel(1);
levelIntervalID = setInterval(mx.utils.Delegate.create(this, checkLevelTime), 1);
}
function checkLevelTime() {
if (isGameActive) {
var _local2 = getTimer() - levelStartTime;
if (_local2 >= com.novelgames.flashgames.stars.Config.LEVEL_TIME) {
gameOver();
}
strTime = Math.floor((com.novelgames.flashgames.stars.Config.LEVEL_TIME - _local2) / 1000).toString();
}
}
function removePopup(popup) {
var _local2;
_local2 = 0;
while (_local2 < popups.length) {
if (popups[_local2] == popup) {
popup.destroy();
popups.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function startLevel(level) {
var _local2;
isGameActive = false;
this.level = level;
noOfStars = com.novelgames.flashgames.stars.Config.LEVEL_INITIALSTARS + ((level - 1) * com.novelgames.flashgames.stars.Config.LEVEL_STARSINCREASE);
willGenerateLocks = level >= com.novelgames.flashgames.stars.Config.LEVEL_STARTLOCKLEVEL;
lockInterval = com.novelgames.flashgames.stars.Config.LEVEL_INITIALLOCKINTERVAL * Math.pow(1 - com.novelgames.flashgames.stars.Config.LEVEL_LOCKINTERVALDECREASE, level - com.novelgames.flashgames.stars.Config.LEVEL_STARTLOCKLEVEL);
mouseListener = createRectangle(starsHolder, com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX * com.novelgames.flashgames.stars.Config.STARS_SPACINGX, com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY * com.novelgames.flashgames.stars.Config.STARS_SPACINGY);
createWrappingStar();
createInitialStars();
_local2 = 0;
while (_local2 < explodes.length) {
explodes[_local2].removeMovieClip();
_local2++;
}
explodes = new Array();
_local2 = 0;
while (_local2 < locks.length) {
locks[_local2].removeMovieClip();
_local2++;
}
locks = new Array();
_local2 = 0;
while (_local2 < popups.length) {
popups[_local2].removeMovieClip();
_local2++;
}
popups = new Array();
noOfStarsDestroyed = 0;
progressBar.setProgress(0);
message.showLevel(level);
startInitialDropTime = getTimer();
intervalID = setInterval(this, "onInitialDropTime", 1);
}
function createRectangle(parent, width, height) {
var _local2 = parent.getNextHighestDepth();
var _local1 = parent.createEmptyMovieClip("rect" + _local2, _local2);
_local1.beginFill(0, 0);
_local1.moveTo(0, 0);
_local1.lineTo(width, 0);
_local1.lineTo(width, height);
_local1.lineTo(0, height);
_local1.lineTo(0, 0);
_local1.endFill();
return(_local1);
}
function createWrappingStar() {
var _local2 = starsHolder.getNextHighestDepth();
var _local3 = starsHolder.attachMovie("star", "star" + _local2, _local2);
wrappingStar = _local3;
wrappingStar._visible = false;
}
function createInitialStars() {
var _local5;
var _local4;
var _local2;
var _local3;
do {
_local2 = 0;
while (_local2 < stars.length) {
_local3 = 0;
while (_local3 < stars[_local2].length) {
stars[_local2][_local3].removeMovieClip();
_local3++;
}
_local2++;
}
stars = new Array(com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX);
_local2 = 0;
while (_local2 < stars.length) {
stars[_local2] = new Array(com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY);
_local3 = 0;
while (_local3 < stars[_local2].length) {
_local5 = createStar(_local2, _local3);
stars[_local2][_local3] = _local5;
_local3++;
}
_local2++;
}
while (true) {
_local4 = getConnectedGroups();
if (_local4.length <= 0) {
break;
}
_local2 = 0;
while (_local2 < _local4.length) {
_local4[_local2][Math.floor(Math.random() * _local4[_local2].length)].setColour(com.novelgames.flashgames.stars.Config.STARS_COLOURS[Math.floor(Math.random() * com.novelgames.flashgames.stars.Config.STARS_COLOURS.length)]);
_local2++;
}
}
} while (!checkMoveExists());
_local2 = 0;
while (_local2 < stars.length) {
_local3 = 0;
while (_local3 < stars[_local2].length) {
stars[_local2][_local3]._y = getInitialY(_local3);
_local3++;
}
_local2++;
}
}
function getInitialY(row) {
return(((row * com.novelgames.flashgames.stars.Config.STARS_SPACINGY) - (com.novelgames.flashgames.stars.Config.STARS_SPACINGY * com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY)) - (((com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY - row) - 1) * (com.novelgames.flashgames.stars.Config.STARS_INITIALSPACINGY - com.novelgames.flashgames.stars.Config.STARS_SPACINGY)));
}
function createStar(x, y) {
var _local2 = starsHolder.getNextHighestDepth();
var _local4 = starsHolder.attachMovie("star", "star" + _local2, _local2);
var _local3 = _local4;
_local3.initialize(x, y, com.novelgames.flashgames.stars.Config.STARS_COLOURS[Math.floor(Math.random() * com.novelgames.flashgames.stars.Config.STARS_COLOURS.length)]);
return(_local3);
}
function getConnectedGroups() {
var _local5 = new Array();
var _local4;
var _local3;
var _local2;
_local3 = 0;
while (_local3 < stars.length) {
_local2 = 0;
while (_local2 < stars[_local3].length) {
if (getStarIsInGroups(stars[_local3][_local2], _local5)) {
} else {
_local4 = getConnectedGroup(stars[_local3][_local2]);
if (_local4.length < com.novelgames.flashgames.stars.Config.GROUP_MINSIZE) {
} else {
_local5.push(_local4);
}
}
_local2++;
}
_local3++;
}
return(_local5);
}
function getConnectedGroup(star) {
var _local4 = [star];
var _local5 = star.colour;
var _local7;
var _local3;
var _local2;
var _local6;
_local6 = 0;
while (_local6 < _local4.length) {
_local7 = _local4[_local6];
_local3 = _local7.x;
_local2 = _local7.y;
if (((_local3 > 0) && (stars[_local3 - 1][_local2].colour == _local5)) && (!getStarIsInGroup(stars[_local3 - 1][_local2], _local4))) {
_local4.push(stars[_local3 - 1][_local2]);
}
if (((_local3 < (com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX - 1)) && (stars[_local3 + 1][_local2].colour == _local5)) && (!getStarIsInGroup(stars[_local3 + 1][_local2], _local4))) {
_local4.push(stars[_local3 + 1][_local2]);
}
if (((_local2 > 0) && (stars[_local3][_local2 - 1].colour == _local5)) && (!getStarIsInGroup(stars[_local3][_local2 - 1], _local4))) {
_local4.push(stars[_local3][_local2 - 1]);
}
if (((_local2 < (com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY - 1)) && (stars[_local3][_local2 + 1].colour == _local5)) && (!getStarIsInGroup(stars[_local3][_local2 + 1], _local4))) {
_local4.push(stars[_local3][_local2 + 1]);
}
_local6++;
}
return(_local4);
}
function getStarIsInGroups(star, groups) {
var _local2;
_local2 = 0;
while (_local2 < groups.length) {
if (getStarIsInGroup(star, groups[_local2])) {
return(true);
}
_local2++;
}
return(false);
}
function getStarIsInGroup(star, group) {
var _local1;
_local1 = 0;
while (_local1 < group.length) {
if (star == group[_local1]) {
return(true);
}
_local1++;
}
return(false);
}
function checkMoveExists() {
var _local5;
var _local3;
var _local4;
var _local2;
_local3 = 0;
while (_local3 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY) {
if (checkRowIsLocked(_local3)) {
} else {
_local4 = 1;
while (_local4 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
simulateShift(0, _local3, 1, 0);
_local2 = 0;
while (_local2 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
_local5 = getConnectedGroup(stars[_local2][_local3]);
if (_local5.length >= com.novelgames.flashgames.stars.Config.GROUP_MINSIZE) {
break;
}
_local2++;
}
if (_local2 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
simulateShift(0, _local3, -_local4, 0);
return(true);
}
_local4++;
}
simulateShift(0, _local3, 1, 0);
}
_local3++;
}
_local3 = 0;
while (_local3 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
if (checkColumnIsLocked(_local3)) {
} else {
_local4 = 1;
while (_local4 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY) {
simulateShift(_local3, 0, 0, 1);
_local2 = 0;
while (_local2 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY) {
_local5 = getConnectedGroup(stars[_local3][_local2]);
if (_local5.length >= com.novelgames.flashgames.stars.Config.GROUP_MINSIZE) {
break;
}
_local2++;
}
if (_local2 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY) {
simulateShift(_local3, 0, 0, -_local4);
return(true);
}
_local4++;
}
simulateShift(_local3, 0, 0, 1);
}
_local3++;
}
return(false);
}
function checkRowIsLocked(rowNo) {
var _local2;
_local2 = 0;
while (_local2 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
if (stars[_local2][rowNo].locked) {
return(true);
}
_local2++;
}
return(false);
}
function checkColumnIsLocked(columnNo) {
var _local2;
_local2 = 0;
while (_local2 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY) {
if (stars[columnNo][_local2].locked) {
return(true);
}
_local2++;
}
return(false);
}
function simulateShift(x, y, stepX, stepY) {
var _local3 = ((stepX != 0) ? (com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) : (com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY));
var _local4 = new Array(_local3);
var _local6;
var _local5;
var _local2;
_local2 = 0;
while (_local2 < _local3) {
if (stepX == 0) {
_local6 = x;
} else {
_local6 = (_local2 - stepX) % _local3;
if (_local6 < 0) {
_local6 = _local6 + _local3;
}
}
if (stepY == 0) {
_local5 = y;
} else {
_local5 = (_local2 - stepY) % _local3;
if (_local5 < 0) {
_local5 = _local5 + _local3;
}
}
_local4[_local2] = stars[_local6][_local5];
if (stepX != 0) {
_local4[_local2].x = _local2;
} else {
_local4[_local2].y = _local2;
}
_local2++;
}
_local2 = 0;
while (_local2 < _local3) {
if (stepX != 0) {
stars[_local2][y] = _local4[_local2];
} else {
stars[x][_local2] = _local4[_local2];
}
_local2++;
}
}
function onInitialDropTime() {
var _local8 = getTimer();
var _local9 = _local8 - startInitialDropTime;
var _local7 = (com.novelgames.flashgames.stars.Config.STARS_INITIALDROPSPEED * _local9) / 1000;
var _local6 = true;
var _local5;
var _local3;
var _local4;
var _local2;
_local4 = 0;
while (_local4 < stars.length) {
_local2 = 0;
while (_local2 < stars[_local4].length) {
_local5 = getInitialY(_local2);
_local3 = _local5 + _local7;
if (_local3 >= (_local2 * com.novelgames.flashgames.stars.Config.STARS_SPACINGY)) {
_local3 = _local2 * com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
} else {
_local6 = false;
}
stars[_local4][_local2]._y = _local3;
_local2++;
}
_local4++;
}
if (_local6) {
clearInterval(intervalID);
intervalID = setInterval(this, "startPlay", com.novelgames.flashgames.stars.Config.MESSAGE_LEVELTIME);
}
updateAfterEvent();
}
function startPlay() {
clearInterval(intervalID);
levelStartTime = getTimer();
isGameActive = true;
message.hide();
isDragging = false;
lastLockTime = getTimer();
setControls();
}
function setControls() {
var game = this;
mouseListener.onPress = function () {
game.onPlayMouseDown();
};
mouseListener.onRelease = function () {
game.onPlayMouseUp();
};
mouseListener.onReleaseOutside = mouseListener.onRelease;
mouseListener.useHandCursor = true;
}
function unsetControls() {
mouseListener.onPress = null;
mouseListener.onRelease = null;
mouseListener.onReleaseOutside = null;
mouseListener.useHandCursor = false;
}
function onPlayMouseDown() {
if (isDragging) {
return(undefined);
}
isDragging = true;
isDraggingX = false;
isDraggingY = false;
startDragMouseX = starsHolder._xmouse;
startDragMouseY = starsHolder._ymouse;
startDragX = Math.floor(startDragMouseX / com.novelgames.flashgames.stars.Config.STARS_SPACINGX);
startDragY = Math.floor(startDragMouseY / com.novelgames.flashgames.stars.Config.STARS_SPACINGY);
dragDistanceX = 0;
dragDistanceY = 0;
onDragTime();
intervalID = setInterval(this, "onDragTime", 1);
}
function onPlayMouseUp() {
var _local2;
if (!isDragging) {
return(undefined);
}
isDragging = false;
setStarXYsAccordingToPosition();
_local2 = getConnectedGroups();
clearInterval(intervalID);
unsetControls();
if (_local2.length > 0) {
setStarOriginalXYs();
resetStarXYs();
wrappingStar._visible = false;
destroyGroups(_local2);
} else {
startUndragTime = getTimer();
intervalID = setInterval(this, "onUndragTime", 1);
}
}
function onDragTime() {
var _local2 = getDragDistances();
var _local3;
if (_local2.x != 0) {
dragDistanceY = 0;
if (checkRowIsLocked(startDragY)) {
if (_local2.x >= com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE) {
if (dragDistanceX != com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE) {
dragDistanceX = com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE;
}
} else if (_local2.x <= (-com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE)) {
if (dragDistanceX != (-com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE)) {
dragDistanceX = -com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE;
}
}
} else {
dragDistanceX = _local2.x;
}
} else {
dragDistanceX = 0;
if (checkColumnIsLocked(startDragX)) {
if (_local2.y >= com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE) {
if (dragDistanceY != com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE) {
dragDistanceY = com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE;
}
} else if (_local2.y <= (-com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE)) {
if (dragDistanceY != (-com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE)) {
dragDistanceY = -com.novelgames.flashgames.stars.Config.STARS_LOCKEDMOVEDISTANCE;
}
}
} else {
dragDistanceY = _local2.y;
}
}
setDraggingLinePosition(dragDistanceX, dragDistanceY);
updateAfterEvent();
}
function getDragDistances() {
var _local3;
var _local2;
var _local5;
var _local4;
if (!isDragging) {
return(undefined);
}
_local3 = starsHolder._xmouse;
_local2 = starsHolder._ymouse;
_local5 = Math.floor(_local3 / com.novelgames.flashgames.stars.Config.STARS_SPACINGX);
_local4 = Math.floor(_local2 / com.novelgames.flashgames.stars.Config.STARS_SPACINGY);
if (_local5 == startDragX) {
isDraggingX = false;
}
if (_local4 == startDragY) {
isDraggingY = false;
}
if ((!isDraggingX) && (!isDraggingY)) {
if (Math.abs(_local3 - startDragMouseX) >= Math.abs(_local2 - startDragMouseY)) {
isDraggingX = true;
} else {
isDraggingY = true;
}
}
if (!isDraggingX) {
_local3 = startDragMouseX;
_local5 = startDragX;
}
if (!isDraggingY) {
_local2 = startDragMouseY;
_local4 = startDragY;
}
return({x:_local3 - startDragMouseX, y:_local2 - startDragMouseY});
}
function setDraggingLinePosition(distanceX, distanceY) {
var _local10;
var _local9;
var _local7;
var _local6;
var _local11;
var _local4;
var _local5;
var _local2;
var _local3;
if (distanceX == 0) {
_local3 = 0;
while (_local3 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
stars[_local3][startDragY].resetXY();
_local3++;
}
}
if (distanceY == 0) {
_local3 = 0;
while (_local3 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY) {
stars[startDragX][_local3].resetXY();
_local3++;
}
}
if ((distanceX == 0) && (distanceY == 0)) {
return(undefined);
}
if (distanceX != 0) {
_local10 = 0;
_local9 = startDragY;
_local7 = 1;
_local6 = 0;
_local11 = com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX;
} else {
_local10 = startDragX;
_local9 = 0;
_local7 = 0;
_local6 = 1;
_local11 = com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY;
}
_local4 = com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX * com.novelgames.flashgames.stars.Config.STARS_SPACINGX;
_local5 = com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY * com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
_local3 = 0;
while (_local3 < _local11) {
_local2 = stars[_local10 + (_local3 * _local7)][_local9 + (_local3 * _local6)];
_local2._x = ((_local2.originalX * com.novelgames.flashgames.stars.Config.STARS_SPACINGX) + distanceX) % _local4;
if (_local2._x < (-com.novelgames.flashgames.stars.Config.STARS_SPACINGX)) {
_local2._x = _local2._x + _local4;
}
_local2._y = ((_local2.originalY * com.novelgames.flashgames.stars.Config.STARS_SPACINGY) + distanceY) % _local5;
if (_local2._y < (-com.novelgames.flashgames.stars.Config.STARS_SPACINGY)) {
_local2._y = _local2._y + _local5;
}
if ((_local2._x < 0) || (_local2._y < 0)) {
wrappingStar.setStatus(_local2);
wrappingStar._x = _local2._x + (_local7 * _local4);
wrappingStar._y = _local2._y + (_local6 * _local5);
} else if ((_local2._x > (_local4 - com.novelgames.flashgames.stars.Config.STARS_SPACINGX)) || (_local2._y > (_local5 - com.novelgames.flashgames.stars.Config.STARS_SPACINGY))) {
wrappingStar.setStatus(_local2);
wrappingStar._x = _local2._x - (_local7 * _local4);
wrappingStar._y = _local2._y - (_local6 * _local5);
}
_local3++;
}
wrappingStar._visible = true;
}
function setStarXYsAccordingToPosition() {
var _local6 = new Array(com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX);
var _local3;
var _local2;
var _local4;
var _local5;
_local4 = 0;
while (_local4 < _local6.length) {
_local6[_local4] = new Array(com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY);
_local4++;
}
_local4 = 0;
while (_local4 < stars.length) {
_local5 = 0;
while (_local5 < stars[_local4].length) {
_local3 = Math.floor((stars[_local4][_local5]._x + (com.novelgames.flashgames.stars.Config.STARS_SPACINGX / 2)) / com.novelgames.flashgames.stars.Config.STARS_SPACINGX);
_local2 = Math.floor((stars[_local4][_local5]._y + (com.novelgames.flashgames.stars.Config.STARS_SPACINGY / 2)) / com.novelgames.flashgames.stars.Config.STARS_SPACINGY);
if (_local3 < 0) {
_local3 = com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX - 1;
} else if (_local3 >= com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
_local3 = 0;
}
if (_local2 < 0) {
_local2 = com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY - 1;
} else if (_local2 >= com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY) {
_local2 = 0;
}
_local6[_local3][_local2] = stars[_local4][_local5];
_local6[_local3][_local2].x = _local3;
_local6[_local3][_local2].y = _local2;
_local5++;
}
_local4++;
}
stars = _local6;
}
function setStarOriginalXYs() {
var _local3;
var _local2;
_local3 = 0;
while (_local3 < stars.length) {
_local2 = 0;
while (_local2 < stars[_local3].length) {
stars[_local3][_local2].originalX = stars[_local3][_local2].x;
stars[_local3][_local2].originalY = stars[_local3][_local2].y;
_local2++;
}
_local3++;
}
}
function resetStarXYs() {
var _local3;
var _local2;
_local3 = 0;
while (_local3 < stars.length) {
_local2 = 0;
while (_local2 < stars[_local3].length) {
stars[_local3][_local2].resetXY();
_local2++;
}
_local3++;
}
}
function onUndragTime() {
var _local3 = getTimer();
var _local2 = (com.novelgames.flashgames.stars.Config.STARS_UNDRAGSPEED * (_local3 - startUndragTime)) / 1000;
var _local5;
var _local4;
if ((_local2 >= Math.abs(dragDistanceX)) && (_local2 >= Math.abs(dragDistanceY))) {
setDraggingLinePosition(0, 0);
setStarXYsAccordingToPosition();
wrappingStar._visible = false;
clearInterval(intervalID);
setControls();
} else {
_local5 = ((dragDistanceX == 0) ? 0 : (((dragDistanceX > 0) ? (dragDistanceX - _local2) : (dragDistanceX + _local2))));
_local4 = ((dragDistanceY == 0) ? 0 : (((dragDistanceY > 0) ? (dragDistanceY - _local2) : (dragDistanceY + _local2))));
setDraggingLinePosition(_local5, _local4);
}
updateAfterEvent();
}
function destroyGroups(groups) {
var _local5 = getExplodedStars(groups);
var _local7;
var _local6;
var _local8 = 0;
var _local2;
var _local4;
_local2 = 0;
while (_local2 < _local5.length) {
if (_local5[_local2].willExplode) {
createBigExplode(_local5[_local2]);
} else {
createExplode(_local5[_local2]);
}
stars[_local5[_local2].x][_local5[_local2].y] = null;
_local5[_local2].removeMovieClip();
_local8++;
_local2++;
}
if (groups.length > 1) {
createComboPopup(groups);
}
_local2 = 0;
while (_local2 < groups.length) {
_local7 = groups[_local2].length >= com.novelgames.flashgames.stars.Config.GROUP_MINEXPLODESIZE;
if (_local7) {
_local6 = Math.floor(Math.random() * groups[_local2].length);
groups[_local2][_local6].setWillExplode();
groups[_local2][_local6].setUnlocked();
createSuperPopup(groups[_local2]);
} else {
createScorePopup(groups[_local2]);
}
_local4 = 0;
while (_local4 < groups[_local2].length) {
if (_local7 && (_local4 == _local6)) {
} else {
if (groups[_local2][_local4].willExplode) {
createBigExplode(groups[_local2][_local4]);
} else {
createExplode(groups[_local2][_local4]);
}
stars[groups[_local2][_local4].x][groups[_local2][_local4].y] = null;
groups[_local2][_local4].removeMovieClip();
_local8++;
}
_local4++;
}
_local2++;
}
noOfStarsDestroyed = noOfStarsDestroyed + _local8;
progressBar.setProgress(noOfStarsDestroyed / noOfStars);
soundDestroy.start();
startExplodeTime = getTimer();
intervalID = setInterval(this, "onExplodeTime", 1);
}
function getExplodedStars(groups) {
var _local7 = new Array();
var _local12;
var _local11;
var _local5;
var _local2;
var _local3;
var _local8;
var _local10;
var _local6;
var _local4;
_local8 = 0;
while (_local8 < groups.length) {
_local10 = 0;
while (_local10 < groups[_local8].length) {
if (!groups[_local8][_local10].willExplode) {
} else {
_local12 = groups[_local8][_local10].x;
_local11 = groups[_local8][_local10].y;
_local6 = -1;
while (_local6 <= 1) {
_local5 = _local12 + _local6;
if ((_local5 < 0) || (_local5 >= com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX)) {
} else {
_local4 = -1;
while (_local4 <= 1) {
_local2 = _local11 + _local4;
if ((_local2 < 0) || (_local2 >= com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY)) {
} else {
_local3 = stars[_local5][_local2];
if (getStarIsInGroups(_local3, groups)) {
} else if (getStarIsInGroup(_local3, _local7)) {
} else {
_local7.push(_local3);
}
}
_local4++;
}
}
_local6++;
}
}
_local10++;
}
_local8++;
}
_local8 = 0;
while (_local8 < _local7.length) {
if (!_local7[_local8].willExplode) {
} else {
_local12 = _local7[_local8].x;
_local11 = _local7[_local8].y;
_local6 = -1;
while (_local6 <= 1) {
_local5 = _local12 + _local6;
if ((_local5 < 0) || (_local5 >= com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX)) {
} else {
_local4 = -1;
while (_local4 <= 1) {
_local2 = _local11 + _local4;
if ((_local2 < 0) || (_local2 >= com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY)) {
} else {
_local3 = stars[_local5][_local2];
if (getStarIsInGroups(_local3, groups)) {
} else if (getStarIsInGroup(_local3, _local7)) {
} else {
_local7.push(_local3);
}
}
_local4++;
}
}
_local6++;
}
}
_local8++;
}
return(_local7);
}
function createScorePopup(group) {
var _local5 = com.novelgames.flashgames.stars.Config.SCORE_GROUP + ((group.length - com.novelgames.flashgames.stars.Config.GROUP_MINSIZE) * com.novelgames.flashgames.stars.Config.SCORE_PEREXTRASTAR);
var _local2 = getGroupBounds(group);
var _local4 = popupsHolder.getNextHighestDepth();
var _local6 = popupsHolder.attachMovie("popup", "popup" + _local4, _local4);
var _local3 = _local6;
_local3.showScore((_local2.left + _local2.right) / 2, (_local2.top + _local2.bottom) / 2, _local5);
popups.push(_local3);
score = score + _local5;
}
function createSuperPopup(group) {
var _local5 = com.novelgames.flashgames.stars.Config.SCORE_GROUP + ((group.length - com.novelgames.flashgames.stars.Config.GROUP_MINSIZE) * com.novelgames.flashgames.stars.Config.SCORE_PEREXTRASTAR);
var _local2 = getGroupBounds(group);
var _local4 = popupsHolder.getNextHighestDepth();
var _local6 = popupsHolder.attachMovie("popup", "popup" + _local4, _local4);
var _local3 = _local6;
_local3.showSuper((_local2.left + _local2.right) / 2, (_local2.top + _local2.bottom) / 2, _local5);
popups.push(_local3);
score = score + _local5;
}
function createComboPopup(groups) {
var _local5 = (groups.length - 1) * com.novelgames.flashgames.stars.Config.SCORE_PEREXTRAGROUP;
var _local2 = getGroupsBounds(groups);
var _local4 = popupsHolder.getNextHighestDepth();
var _local6 = popupsHolder.attachMovie("popup", "popup" + _local4, _local4);
var _local3 = _local6;
_local3.showCombo((_local2.left + _local2.right) / 2, (_local2.top + _local2.bottom) / 2, _local5);
popups.push(_local3);
score = score + _local5;
}
function getGroupBounds(group) {
var _local6 = Number.POSITIVE_INFINITY;
var _local4 = Number.NEGATIVE_INFINITY;
var _local5 = Number.POSITIVE_INFINITY;
var _local3 = Number.NEGATIVE_INFINITY;
var _local1;
_local1 = 0;
while (_local1 < group.length) {
if (group[_local1]._x < _local6) {
_local6 = group[_local1]._x;
}
if (group[_local1]._x > _local4) {
_local4 = group[_local1]._x;
}
if (group[_local1]._y < _local5) {
_local5 = group[_local1]._y;
}
if (group[_local1]._y > _local3) {
_local3 = group[_local1]._y;
}
_local1++;
}
_local4 = _local4 + com.novelgames.flashgames.stars.Config.STARS_SPACINGX;
_local3 = _local3 + com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
return({left:_local6, right:_local4, top:_local5, bottom:_local3});
}
function getGroupsBounds(groups) {
var _local8 = Number.POSITIVE_INFINITY;
var _local6 = Number.NEGATIVE_INFINITY;
var _local7 = Number.POSITIVE_INFINITY;
var _local5 = Number.NEGATIVE_INFINITY;
var _local2;
var _local3;
_local3 = 0;
while (_local3 < groups.length) {
_local2 = getGroupBounds(groups[_local3]);
if (_local2.left < _local8) {
_local8 = _local2.left;
}
if (_local2.right > _local6) {
_local6 = _local2.right;
}
if (_local2.top < _local7) {
_local7 = _local2.top;
}
if (_local2.bottom > _local5) {
_local5 = _local2.bottom;
}
_local3++;
}
return({left:_local8, right:_local6, top:_local7, bottom:_local5});
}
function createExplode(star) {
var _local2 = explodesHolder.getNextHighestDepth();
var _local4 = explodesHolder.attachMovie("explode", "explode" + _local2, _local2);
var _local3 = _local4;
_local3.initialize(star.x, star.y, star.colour);
explodes.push(_local3);
}
function createBigExplode(star) {
var _local2 = explodesHolder.getNextHighestDepth();
var _local4 = explodesHolder.attachMovie("explodeBig", "explode" + _local2, _local2);
var _local3 = _local4;
_local3.initialize(star.x, star.y);
explodes.push(_local3);
}
function onExplodeTime() {
var _local4 = getTimer();
var _local3 = _local4 - startExplodeTime;
var _local2;
_local2 = 0;
while (_local2 < explodes.length) {
explodes[_local2].move(_local3);
_local2++;
}
if (_local3 >= com.novelgames.flashgames.stars.Config.EXPLODE_TIME) {
_local2 = 0;
while (_local2 < explodes.length) {
explodes[_local2].removeMovieClip();
_local2++;
}
explodes = new Array();
clearInterval(intervalID);
startDropStars();
}
updateAfterEvent();
}
function startDropStars() {
var _local4;
var _local5;
var _local3;
var _local2;
droppingStars = new Array();
_local3 = 0;
while (_local3 < com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX) {
_local4 = 0;
_local2 = com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY - 1;
while (_local2 >= 0) {
if (stars[_local3][_local2] == null) {
_local4++;
} else if (_local4 > 0) {
stars[_local3][_local2].y = stars[_local3][_local2].originalY + _local4;
droppingStars.push(stars[_local3][_local2]);
}
_local2--;
}
_local2 = 0;
while (_local2 < _local4) {
_local5 = createStar(_local3, (-_local2) - 1);
_local5.y = (_local4 - _local2) - 1;
droppingStars.push(_local5);
_local2++;
}
_local3++;
}
startDropTime = getTimer();
intervalID = setInterval(this, "onDropTime", 1);
}
function onDropTime() {
var _local5 = getTimer();
var _local4;
var _local3;
var _local2;
_local2 = 0;
while (_local2 < droppingStars.length) {
_local4 = (droppingStars[_local2].y - droppingStars[_local2].originalY) * com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
_local3 = (com.novelgames.flashgames.stars.Config.STARS_DROPSPEED * (_local5 - startDropTime)) / 1000;
if (_local3 >= _local4) {
droppingStars[_local2]._y = droppingStars[_local2].y * com.novelgames.flashgames.stars.Config.STARS_SPACINGY;
droppingStars[_local2].originalY = droppingStars[_local2].y;
stars[droppingStars[_local2].x][droppingStars[_local2].y] = droppingStars[_local2];
droppingStars.splice(_local2, 1);
_local2--;
} else {
droppingStars[_local2]._y = (droppingStars[_local2].originalY * com.novelgames.flashgames.stars.Config.STARS_SPACINGY) + _local3;
}
_local2++;
}
if (droppingStars.length <= 0) {
clearInterval(intervalID);
dropFinished();
}
updateAfterEvent();
}
function dropFinished() {
var _local2 = getConnectedGroups();
var _local3;
if (_local2.length > 0) {
destroyGroups(_local2);
} else if (noOfStarsDestroyed >= noOfStars) {
startClear();
} else {
_local3 = getNoOfLocksToGenerate();
if (_local3 > 0) {
generateLocks(_local3);
} else {
if (checkGameOver()) {
return(undefined);
}
setControls();
}
}
}
function getNoOfLocksToGenerate() {
var _local2;
var _local3;
if (!willGenerateLocks) {
return(0);
}
_local2 = getTimer();
_local3 = Math.floor((_local2 - lastLockTime) / lockInterval);
if (_local3 > 0) {
lastLockTime = _local2;
return(_local3);
}
return(0);
}
function generateLocks(noOfLocks) {
var _local3;
var _local2;
var _local5;
var _local4;
var _local6;
noOfLocks = Math.min(noOfLocks, getNoOfUnlockedStars());
_local6 = 0;
while (_local6 < noOfLocks) {
if (true) {
_local5 = Math.floor(Math.random() * com.novelgames.flashgames.stars.Config.STARS_DIMENSIONX);
_local4 = Math.floor(Math.random() * com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY);
if (stars[_local5][_local4].locked) {
// unexpected jump
}
_local3 = locksHolder.getNextHighestDepth();
_local2 = locksHolder.attachMovie("lock", "lock" + _local3, _local3);
_local2._x = (_local5 * com.novelgames.flashgames.stars.Config.STARS_SPACINGX) + (com.novelgames.flashgames.stars.Config.STARS_SPACINGX / 2);
_local2._y = (_local4 * com.novelgames.flashgames.stars.Config.STARS_SPACINGX) + (com.novelgames.flashgames.stars.Config.STARS_SPACINGX / 2);
_local2._xscale = com.novelgames.flashgames.stars.Config.LOCK_STARTSCALE;
_local2._yscale = com.novelgames.flashgames.stars.Config.LOCK_STARTSCALE;
locks.push(_local2);
}
_local6++;
}
soundLock.start();
startLockTime = getTimer();
intervalID = setInterval(this, "onLockTime", 1);
}
function getNoOfUnlockedStars() {
var _local4 = 0;
var _local3;
var _local2;
_local3 = 0;
while (_local3 < stars.length) {
_local2 = 0;
while (_local2 < stars[_local3].length) {
if (!stars[_local3][_local2].locked) {
_local4++;
}
_local2++;
}
_local3++;
}
return(_local4);
}
function onLockTime() {
var _local7 = getTimer();
var _local6 = _local7 - startLockTime;
var _local3;
var _local5;
var _local4;
var _local2;
if (_local6 >= com.novelgames.flashgames.stars.Config.LOCK_TIME) {
_local3 = 100;
} else {
_local3 = (com.novelgames.flashgames.stars.Config.LOCK_STARTSCALE * (1 - (_local6 / com.novelgames.flashgames.stars.Config.LOCK_TIME))) + ((100 * _local6) / com.novelgames.flashgames.stars.Config.LOCK_TIME);
}
_local2 = 0;
while (_local2 < locks.length) {
locks[_local2]._xscale = _local3;
locks[_local2]._yscale = _local3;
_local2++;
}
if (_local3 == 100) {
clearInterval(intervalID);
_local2 = 0;
while (_local2 < locks.length) {
_local5 = Math.floor(locks[_local2]._x / com.novelgames.flashgames.stars.Config.STARS_SPACINGX);
_local4 = Math.floor(locks[_local2]._y / com.novelgames.flashgames.stars.Config.STARS_SPACINGY);
stars[_local5][_local4].setLocked();
locks[_local2].removeMovieClip();
_local2++;
}
locks = new Array();
if (checkGameOver()) {
return(undefined);
}
setControls();
}
updateAfterEvent();
}
function startClear() {
message.showClear();
soundClear.start();
startClearScore = score;
startClearTime = getTimer();
intervalID = setInterval(this, "onClearTime", 1);
}
function onClearTime() {
var _local3 = getTimer();
var _local2 = _local3 - startClearTime;
if (_local2 >= com.novelgames.flashgames.stars.Config.MESSAGE_CLEARTIME) {
clearInterval(intervalID);
score = startClearScore + com.novelgames.flashgames.stars.Config.SCORE_LEVEL;
progressBar.setProgress(0);
intervalID = setInterval(this, "startNextLevel", com.novelgames.flashgames.stars.Config.MESSAGE_CLEARWAITTIME);
} else {
score = startClearScore + Math.floor((com.novelgames.flashgames.stars.Config.SCORE_LEVEL * _local2) / com.novelgames.flashgames.stars.Config.MESSAGE_CLEARTIME);
progressBar.setProgress(1 - (_local2 / com.novelgames.flashgames.stars.Config.MESSAGE_CLEARTIME));
}
updateAfterEvent();
}
function startNextLevel() {
clearInterval(intervalID);
startLevel(level + 1);
}
function checkGameOver() {
if (checkMoveExists()) {
return(false);
}
gameOver();
return(true);
}
function gameOver() {
isGameActive = false;
soundGameOver.start();
_root.attachMovie("GameOverScreen", "GameOverScreen", _root.getNextHighestDepth());
_root.GameOverScreen.finalScoreTXT.text = "You scored: " + score;
}
function onGameOverDropTime() {
var _local7 = getTimer();
var _local6 = _local7 - startGameOverDropTime;
var _local5 = true;
var _local4;
var _local3;
var _local2;
_local3 = 0;
while (_local3 < stars.length) {
_local2 = 0;
while (_local2 < stars[_local3].length) {
_local4 = _local6 - (((com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY - _local2) - 1) * com.novelgames.flashgames.stars.Config.STARS_GAMEOVERROWINTERVAL);
if (_local4 < 0) {
} else {
stars[_local3][_local2]._y = (_local2 * com.novelgames.flashgames.stars.Config.STARS_SPACINGY) + ((com.novelgames.flashgames.stars.Config.STARS_GAMEOVERDROPSPEED * _local4) / 1000);
if (stars[_local3][_local2]._y < (com.novelgames.flashgames.stars.Config.STARS_SPACINGY * com.novelgames.flashgames.stars.Config.STARS_DIMENSIONY)) {
_local5 = false;
}
}
_local2++;
}
_local3++;
}
if (_local5) {
clearInterval(intervalID);
intervalID = setInterval(this, "showPlayAgain", com.novelgames.flashgames.stars.Config.MESSAGE_GAMEOVERTIME);
}
}
function showPlayAgain() {
clearInterval(intervalID);
message.showPlayAgain();
_root.sendApiScore(score);
_parent.showEnterHighScore(score);
}
var isGameActive = false;
}
Symbol 162 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 163 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 164 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 165 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 115 MovieClip Frame 82
gotoAndPlay (15);