Frame 1
function init() {
Process.start(main, [], 1, 2);
State.set(State.NONE);
showMenuW();
fmusic = true;
fsound = true;
_linesLeft = level1Lines;
timeNum = 0;
loadScores();
showMenuW();
}
function initGame() {
_root.scoresTimer.start();
w_pregame._visible = false;
w_curWindow.destroy();
points = 0;
bonus = 0;
multBy = 1;
levelNum = 0;
levelNum_lbl.text = levelNum + 1;
field = new cField(t_field);
field.init();
levelNum = 0;
fHammerFlying = false;
hammer._x = hammerX;
hammer._y = hammerY;
hammer._rotation = 0;
hammer._visible = false;
soundEngine.CSound.getInstance().playMusic(soundEngine.CSound.GAME_MUSIC);
}
function main() {
if (!State.is(State.RUNNING)) {
return(undefined);
}
field.main();
points_lbl.text = points;
linesLeft_lbl.text = _linesLeft;
}
function countPoints(selectedLen, bonus, multBy) {
trace("countPoints " + [selectedLen, bonus, multBy]);
if (multBy == 0) {
multBy = 1;
}
points = points + ((((selectedLen * selectedLen) * _root.blockValue) * multBy) + bonus);
}
function showReady() {
trace("showReady");
_root._IGNOREUSER = true;
field.ST_STOP = true;
w_ready.txtLevelNum.text = "Level " + (levelNum + 1);
w_ready._visible = true;
}
function ready() {
trace("ready");
field.clear();
if (endPoints > 0) {
trace("end points");
points = points + endPoints;
endPoints = 0;
scoresTimer.stop();
}
w_ready._visible = false;
field.ST_STOP = false;
_IGNOREUSER = false;
_LEVELEND = false;
timeNum = 0;
trace("_LEVELEND " + _LEVELEND);
State.set(State.RUNNING);
}
function showMenuW() {
w_pregame._visible = true;
w_instruction._visible = false;
w_gameover._visible = false;
w_scores._visible = false;
w_curWindow.destroy();
}
function showInstructions() {
w_pregame._visible = false;
w_instruction._visible = true;
}
function pause(from) {
if (State.is(State.RUNNING)) {
State.set(State.PAUSE);
w_pause._visible = true;
} else if (State.is(State.PAUSE)) {
w_pause._visible = false;
State.set(State.RUNNING);
w_curWindow.destroy();
}
}
function countLevelEndPoints() {
var _local2 = Math.floor(scoresTimer.getTime() / 10);
if (timeNum < _local2) {
timeNum = _local2;
points = points + 11;
endPoints = endPoints - 11;
if (endPoints < 11) {
points = points + endPoints;
endPoints = 0;
scoresTimer.stop();
_root.showReady();
}
}
}
function showHiScores() {
trace(_root.w_instruction._visible);
w_curWindow.destroy();
w_pregame._visible = false;
showScores();
}
function showGameOver() {
w_gameover.txtScore.text = points;
w_gameover._visible = true;
}
function showPrompt(_text, fn) {
function cbfn() {
w_curWindow.destroy();
State.set(State.RUNNING);
fn();
}
if (!State.is(State.RUNNING)) {
return(undefined);
}
State.set(State.NONE);
var _local1 = new Array();
_local1 = [{title:"Ok", cbfunc:cbfn}, {title:"Cancel", cbfunc:cancel}];
CWindow.nBtnDefaultY = 50;
CWindow.nBtnIndent = 15;
w_curWindow = new CWindow("", _text, _local1, bDelOld);
}
function cancel() {
w_curWindow.destroy();
State.set(State.RUNNING);
}
function clearHiscores() {
clearScores();
loadScores();
showScores();
}
function exit() {
w_quitMenu._visible = true;
}
function moreGames() {
_root.getURL(sMoreGamesLink, "_blank");
}
function showQuitGame() {
w_quit._visible = true;
}
function checkFullScreen() {
if (_root.fullScreen) {
fscommand ("fullscreen", true);
} else {
fscommand ("fullscreen", false);
}
}
function press(tile) {
if (_IGNOREUSER) {
return(undefined);
}
if (!State.is(State.RUNNING)) {
return(undefined);
}
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.SHOOT);
hammer.destX = _root._xmouse;
hammer.destY = _root._ymouse;
if (_LEVELEND) {
hammer._visible = false;
return(undefined);
}
_root.mcGameField.mcBaby.mcHand.gotoAndPlay(2);
curTile = tile;
}
function startFlying(tile) {
hammer._visible = true;
fHammerFlying = true;
Process.start(hammerFly, [curTile], 2, 0);
}
function check(rfield, tile) {
_selected.length = 0;
bonus = 0;
multBy = 0;
if (tile._currentframe == TL_BOMB) {
trace("bomb here");
rBCheck(field._field, tile);
countPoints(_selected.length, 0, 1);
field.remove(_selected);
return(undefined);
}
_color = tile._currentframe;
switch (tile._currentframe) {
case _root.TL_MULT2 :
multBy = multBy + 2;
_color = TL_GOLD;
break;
case _root.TL_MULT3 :
multBy = multBy + 3;
_color = TL_GOLD;
}
if ((tile._currentframe > 10) && (tile._currentframe < _root.TL_MULT2)) {
_color = tile._currentframe - 9;
rCheck(field._field, tile._j, tile._i);
bonus = bonus + BONUS_PTS;
} else {
rCheck(field._field, tile._j, tile._i);
}
if (_selected.length >= 2) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.HIT);
if (_color == TL_GOLD) {
countPoints(_selected.length, bonus, multBy);
}
field.remove(_selected);
}
}
function rCheck(_field, i, j) {
_selected.push(_field[i][j]);
var _local7 = 0;
var _local3 = 0;
while (_local3 < 4) {
var _local2 = _field[i + di[_local3]][j + dj[_local3]];
if (((((_local2._currentframe == _color) || (_local2._currentframe == TL_BOMB)) || (_local2._currentframe == (9 + _color))) || ((_color == _root.TL_GOLD) && (_local2._currentframe == _root.TL_MULT3))) && (!_selected.search(_local2))) {
switch (_local2._currentframe) {
case _root.TL_MULT2 :
multBy = multBy + 2;
break;
case _root.TL_MULT3 :
multBy = multBy + 3;
break;
case 9 + _color :
bonus = bonus + BONUS_PTS;
}
rCheck(_field, i + di[_local3], j + dj[_local3]);
}
_local3++;
}
explode(_field[i][j], _local2._currentframe, _local7);
_local7++;
}
function rBCheck(_field, tile) {
power = 0;
var _local6 = new Object();
_local6.x = tile._x;
_local6.y = tile._y;
tile._parent.localToGlobal(_local6);
t_bombdamage._x = _local6.x + (tile._width / 2);
t_bombdamage._y = _local6.y + (tile._height / 2);
var _local4 = 0;
var _local2 = 0;
while (_local2 < 12) {
var _local1 = 15;
while (_local1 > -1) {
if (_field[_local1][_local2]._currentframe == TL_CLEAR) {
break;
}
if (_field[_local1][_local2].hitTest(t_bombdamage)) {
if (_field[_local1][_local2]._currentframe == TL_BOMB) {
power = power + 1;
t_bombdamage._width = t_bombdamage._width + 20;
t_bombdamage._height = t_bombdamage._height + 20;
}
if ((TL_CBOMB <= _field[_local1][_local2]._currentframe) && (_field[_local1][_local2]._currentframe < (TL_CBOMB + 4))) {
rCCheck(_field, _field[_local1][_local2]);
}
explode(_field[_local1][_local2], tile._currentframe, _local4);
_local4++;
_selected.push(_field[_local1][_local2]);
}
_local1--;
}
_local2++;
}
}
function explode(tile, col, d) {
var _local4;
if ((col == 10) && (tile._currentframe != 10)) {
_local4 = "botexpl" + (tile._currentframe + 9);
} else {
_local4 = "botexpl" + col;
}
if (tile._currentframe > 10) {
_local4 = "botexpl_" + tile._currentframe;
}
_root.field.attachMovie(_local4, "expl" + d, (1000000 + _root.getNextHighestDepth()) + d);
_root.field["expl" + d].stop();
_root.field["expl" + d]._x = tile._x;
_root.field["expl" + d]._y = tile._y;
_root.field["expl" + d].play();
}
function rCCheck(_field, tile) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BLOW);
var _local5 = 0;
var _local2 = 0;
while (_local2 < 12) {
var _local1 = 15;
while (_local1 > -1) {
if ((_field[_local1][_local2]._currentframe == (tile._currentframe - 9)) || (_field[_local1][_local2]._currentframe == tile._currentframe)) {
explode(_field[_local1][_local2], tile._currentframe, _local5);
_local5++;
_selected.push(_field[_local1][_local2]);
}
if (_field[_local1][_local2]._currentframe == TL_CLEAR) {
break;
}
_local1--;
}
_local2++;
}
}
function nextLevel() {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.WIN);
levelNum++;
levelNum_lbl.text = levelNum + 1;
timeNum = 0;
fHammerFlying = false;
if (levelNum == 5) {
endGame();
} else {
field.settings(levelNum);
}
}
function hammerFly(tile) {
if (_LEVELEND) {
hammer._visible = false;
return(undefined);
}
_IGNOREUSER = true;
var _local1 = 0;
while (_local1 < hammerSpeed) {
if (hammer._x < hammer.destX) {
hammer._x++;
} else if (hammer._x > hammer.destX) {
hammer._x--;
}
if (hammer._y < hammer.destY) {
hammer._y++;
} else if (hammer._y > hammer.destY) {
hammer._y--;
}
_local1++;
}
if (((hammer._x > (hammer.destX - 1)) && (hammer._x < (hammer.destX + 1))) && ((hammer._y > (hammer.destY - 1)) && (hammer._y < (hammer.destY + 1)))) {
hammer._x = hammerX;
hammer._y = hammerY;
hammer._rotation = 0;
Process.kill(hammerFly, 2);
if (points > 0) {
points--;
}
if (tile._type == "line") {
tile._parent.lineFill();
} else {
check(tile._parent, tile);
}
_IGNOREUSER = false;
hammer._visible = false;
} else {
return(Process.HOLD);
}
}
function gameOver() {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.LOOSE);
showGameOver();
}
function endGame() {
soundEngine.CSound.getInstance().playMusic(soundEngine.CSound.MENU_MUSIC);
field.clear();
field.ST_STOP = true;
w_quit._visible = false;
showMenuW();
}
function quitToOS() {
fscommand ("quit");
}
function showScores() {
_root.w_scores._visible = true;
_root.w_gameover._visible = false;
var _local2 = 0;
while (_local2 < _root.numHiScores) {
_root.w_scores["name" + _local2].text = _root.hiScores[_local2][0];
_root.w_scores["name" + _local2].maxChars = 10;
_root.w_scores["scores" + _local2].text = _root.hiScores[_local2][1];
_local2++;
}
}
function checkScores() {
var _local2 = 0;
pos = -1;
while (_local2 < _root.numHiScores) {
if ((_root.points > _root.hiScores[_local2][1]) || (_root.hiScores[_local2][0] == "undefined")) {
pos = _local2;
askName(pos);
_local2 = _root.numHiScores;
}
_local2++;
}
}
function askName(pos) {
_root.pos = pos;
_root.bPutName = true;
_root.hiScores.splice(pos, 0, new Array("unnamed", _root.points));
if (_root.hiScores.length >= _root.numHiScores) {
_root.hiScores.splice(_root.numHiScores, 1);
}
showScores();
var col = new Color(_root.w_scores["scores" + pos]);
col.setRGB(10053273);
_root.w_scores["name" + pos].text = "unnamed";
_root.w_scores["name" + pos].type = "input";
_root.w_scores["name" + pos].selectable = true;
Selection.setFocus(_root.w_scores["name" + pos]);
Selection.setSelection(0, _root.w_scores["name" + pos].length);
_root.w_scores["name" + pos].onKillFocus = function (newFocus) {
if ((_root.w_scores["name" + pos].type == "input") && (_root.w_scores["name" + pos].text != "unnamed")) {
_root.w_scores["name" + pos].type = "dynamic";
saveName(_root.w_scores["name" + pos].text, pos);
_root.w_scores["name" + pos].selectable = false;
_root.bPutName = false;
col.setRGB(0);
}
};
}
function saveName(_text, pos) {
_root.hiScores[pos][0] = _text;
_root.showScores();
_root.saveScores();
}
function updateScoresProperties() {
var _local2 = 0;
while (_local2 < _root.numHiScores) {
_root.w_scores["name" + _local2].maxChars = 20;
_local2++;
}
}
function loadScores() {
if (settings.data.firstLoad == undefined) {
trace("first time");
clearScores();
settings.data.firstLoad = 1;
}
_root.hiScores = new Array();
var _local2 = 0;
while (_local2 < _root.numHiScores) {
_root.hiScores.push(new Array(settings.data["name" + _local2], settings.data["scores" + _local2]));
_local2++;
}
}
function saveScores() {
trace((("save scores " + _root.numHiScores) + " ") + _root.hiScores[0][0]);
var _local2 = 0;
while (_local2 < _root.numHiScores) {
settings.data["name" + _local2] = _root.hiScores[_local2][0];
settings.data["scores" + _local2] = _root.hiScores[_local2][1];
_local2++;
}
}
function clearScores() {
trace(("clearScores(" + [arguments]) + ")");
trace(defUsers[0][0]);
var _local3 = 0;
while (_local3 < _root.numHiScores) {
settings.data["name" + _local3] = defUsers[_local3][0];
settings.data["scores" + _local3] = defUsers[_local3][1];
_local3++;
}
}
function loadSettings(bRedefined) {
if ((!bRedefined) && (settings.data.first == undefined)) {
redefineSettings();
return(undefined);
}
_root.soundon = settings.data.soundon;
_root.musicon = settings.data.musicon;
soundEngine.CSound.getInstance().setMute(_root.soundon);
_root.fullScreen = settings.data.fullScreen;
fscommand ("fullscreen", false);
}
function saveSettings() {
settings.data.soundon = _root.soundon;
settings.data.musicon = _root.musicon;
settings.data.fullScreen = _root.fullScreen;
}
function redefineSettings() {
settings.data.soundon = new Boolean();
settings.data.soundon = true;
settings.data.musicon = new Boolean();
settings.data.musicon = true;
settings.data.fullScreen = new Boolean();
settings.data.fullScreen = true;
settings.data.first = new Boolean();
settings.data.first = false;
loadSettings(true);
}
var TL_CLEAR = 1;
var TL_BOMB = 10;
var TL_CBOMB = 11;
var TL_OVER = 20;
var TL_EBOMB = 25;
var TL_STAR = 26;
var TL_GOLD = 5;
var TL_MULT2 = 14;
var TL_MULT3 = 15;
var SIZEX = 14;
var SIZEY = 10;
var BONUS_PTS = 100;
var hammerX = 590;
var hammerY = 355;
var hammerSpeed = 35;
var numHiScores = 10;
var game = new Game();
var w_curWindow;
var field;
var _selected = new Array();
var points = 0;
var di = new Array(0, 0, 1, -1);
var dj = new Array(1, -1, 0, 0);
var bonus;
var multBy;
var levelNum = 0;
var _linesLeft;
var game = new Game();
var scoresTimer;
var endPoints;
var hiScores;
var level1Lines = 15;
var blockValue = 10;
var sMoreGamesLink = "http://www.myplaycity.com";
var curTile;
_selected.search = function (elem) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == elem) {
return(true);
}
_local2++;
}
return(false);
};
var bPutName = false;
var oKeyListener = new Object();
oKeyListener.onKeyUp = function () {
if (_root.bPutName && (Key.getCode() == 13)) {
if ((_root.w_scores["name" + _root.pos].type == "input") && (_root.w_scores["name" + _root.pos].text != "unnamed")) {
_root.w_scores["name" + _root.pos].type = "dynamic";
saveName(_root.w_scores["name" + _root.pos].text, pos);
_root.w_scores["name" + _root.pos].selectable = false;
_root.bPutName = false;
var _local2 = new Color(_root.w_scores["scores" + _root.pos]);
_local2.setRGB(0);
}
}
};
Key.addListener(oKeyListener);
var defUsers = [["Jack", 3579500], ["Smith", 2158654], ["Tom", 1904127], ["Tracy", 1804127], ["Jane", 1304127], ["Kyle", 1004127], ["Stane", 804127], ["Cole", 504127], ["Larry", 4904127], ["John", 489124]];
var settings = SharedObject.getLocal("childs_room_1.0");
loadSettings(false);
var defUsers = [["Jack", 3579500], ["Smith", 2158654], ["Tom", 1904127], ["Tracy", 1804127], ["Jane", 1304127], ["Kyle", 1004127], ["Stane", 804127], ["Cole", 504127], ["Larry", 4904127], ["John", 489124]];
nag._visible = false;
t_field.t_tile._visible = false;
w_pause._visible = false;
w_ready._visible = false;
w_scores._visible = false;
w_instruction._visible = false;
w_gameover._visible = false;
w_quit._visible = false;
w_quitto._visible = false;
w_clearhs._visible = false;
w_quitMenu._visible = false;
init();
_root.scoresTimer = new CTimer(2, _root.countLevelEndPoints, []);
_root.updateScoresProperties();
soundEngine.CSound.getInstance();
if (_root.musicon) {
soundEngine.CSound.getInstance().playMusic(soundEngine.CSound.MENU_MUSIC);
}
Frame 3
gotoAndPlay ("game");
Symbol 42 Button
on (release) {
_root.nag._visible = false;
_root.nextLevel();
}
Symbol 46 Button
on (release) {
getURL ("http://myplaycity.com/vivid_bricks", "_blank");
}
Symbol 47 MovieClip [nag] Frame 1
btn_cover.useHandCursor = false;
Symbol 116 MovieClip Frame 5
if (!State.is(State.RUNNING)) {
if (((w_pregame._visible == true) || (w_pregame._visible == undefined)) && ((_root.w_scores._visible == false) && (_root.w_instruction._visible == false))) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.MORG);
}
}
Symbol 116 MovieClip Frame 21
if (!State.is(State.RUNNING)) {
if (((w_pregame._visible == true) || (w_pregame._visible == undefined)) && ((_root.w_scores._visible == false) && (_root.w_instruction._visible == false))) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.MORG);
}
}
Symbol 153 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.w_clearhs._visible = true;
}
Symbol 157 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.w_scores._visible = false;
_root.showMenuW();
}
Symbol 207 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 10
_root.startFlying();
Symbol 214 MovieClip Frame 12
gotoAndStop (1);
Symbol 234 Button
on (release) {
if (_root._IGNOREUSER) {
return(undefined);
}
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.pause();
}
Symbol 237 Button
on (release) {
if (_root._IGNOREUSER) {
return(undefined);
}
_root.showQuitGame();
State.set(State.PAUSE);
}
Symbol 244 Button
on (release) {
_root.press(this);
}
Symbol 250 MovieClip Frame 31
if (!State.is(State.RUNNING)) {
if (((w_pregame._visible == true) || (w_pregame._visible == undefined)) && ((_root.w_scores._visible == false) && (_root.w_instruction._visible == false))) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.MORG2);
}
}
Symbol 256 MovieClip Frame 52
if (!State.is(State.RUNNING)) {
if (((w_pregame._visible == true) || (w_pregame._visible == undefined)) && ((_root.w_scores._visible == false) && (_root.w_instruction._visible == false))) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.MORG3);
}
}
Symbol 288 MovieClip Frame 29
gotoAndPlay(_root.TL_STAR);
Symbol 341 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.showMenuW();
}
Symbol 346 MovieClip Frame 1
mc.useHandCursor = false;
Instance of Symbol 296 MovieClip "mc" in Symbol 346 MovieClip Frame 1
on (release) {
}
Symbol 399 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.initGame();
}
Symbol 403 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.showInstructions();
}
Symbol 407 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.moreGames();
}
Symbol 412 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
getURL ("http://www.myplaycity.com/vivid_bricks", "_blank");
}
Symbol 417 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
getURL ("http://www.myplaycity.com/free_content", "_blank");
}
Symbol 422 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
getURL ("http://www.myplaycity.com/online_games", "_blank");
}
Symbol 423 MovieClip Frame 1
btn_cover.useHandCursor = false;
Instance of Symbol 387 MovieClip "mcLogo" in Symbol 423 MovieClip Frame 1
on (release) {
getURL ("http://www.myplaycity.com", "_blank");
}
Instance of Symbol 390 MovieClip "link" in Symbol 423 MovieClip Frame 1
on (release) {
getURL ("http://www.myplaycity.com", "_blank");
}
Symbol 430 Button
on (release) {
if (_root.soundon) {
_root.soundon = false;
soundEngine.CSound.getInstance().setMute(false);
this.gotoAndStop(1);
} else {
_root.soundon = true;
soundEngine.CSound.getInstance().setMute(true);
this.gotoAndStop(3);
}
_root.saveSettings();
if (_root.soundon) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(4);
}
}
on (rollOver) {
if (_root.soundon) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(4);
}
}
on (rollOut) {
if (_root.soundon) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(3);
}
}
Symbol 434 MovieClip Frame 1
onEnterFrame();
if (_root.soundon) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(3);
}
stop();
Symbol 438 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_visible = false;
}
Symbol 439 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.clearHiscores();
_root.showScores();
_visible = false;
}
Symbol 440 MovieClip Frame 1
btn_cover.useHandCursor = false;
Symbol 449 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_visible = false;
}
Symbol 452 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_visible = false;
_root.quitToOS();
}
Symbol 453 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_visible = false;
_root.endGame();
}
Symbol 454 MovieClip Frame 1
btn_cover.useHandCursor = false;
Symbol 463 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
State.set(State.RUNNING);
_root.w_quit._visible = false;
}
Symbol 464 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.endGame();
_visible = false;
}
Symbol 465 MovieClip Frame 1
btn_cover.useHandCursor = false;
Symbol 498 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
if (!_root.w_scores._visible) {
_root.showMenuW();
}
}
Symbol 499 MovieClip Frame 1
btn_cover.useHandCursor = false;
Symbol 510 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.ready();
}
Symbol 511 MovieClip Frame 1
btn_cover.useHandCursor = false;
Symbol 528 Button
on (release) {
if (_root._IGNOREUSER) {
return(undefined);
}
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.pause();
}
Symbol 529 MovieClip Frame 1
btn_cover.useHandCursor = false;
Symbol 535 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
_root.w_quitMenu._visible = false;
}
Symbol 536 Button
on (release) {
soundEngine.CSound.getInstance().playSound(soundEngine.CSound.BUTTON_CLICK);
fscommand ("quit");
fscommand ("this.close");
}
Symbol 537 MovieClip Frame 1
btn_cover.useHandCursor = false;
Symbol 538 MovieClip [__Packages.State] Frame 0
class State
{
function State () {
}
static function set(_status) {
if (_status == undefined) {
return(false);
}
current = _status;
return(true);
}
static function addState(_value) {
if (_value == undefined) {
return(false);
}
current = current | _value;
}
static function deleteState(_value) {
if ((_value == undefined) || (!is(_value))) {
return(false);
}
current = current - _value;
}
static function get() {
return(current);
}
static function is(_value) {
return((((current & _value) != 0) ? true : false));
}
static function addNew(_statuses) {
_defLen = getLastState();
var _local1 = 0;
while (_local1 < _statuses.length) {
State[_statuses[_local1]] = 1 << ((_defLen + _local1) + 1);
_local1++;
}
_defLen = _defLen + _statuses.length;
}
static function getLastState() {
var _local1 = 0;
for (var _local2 in State) {
_local1 = (((State[_local2] > _local1) && (typeof(State[_local2]) == "number")) ? (State[_local2]) : (_local1));
}
return(Bit.countBits(_local1));
}
static function getStateName(_value) {
for (var _local2 in State) {
if (((typeof(State[_local2]) == "number") && (State[_local2] == _value)) && (_local2 != "current")) {
return(_local2);
}
}
}
function toString() {
return("[class State]");
}
static var NONE = 1;
static var NEW_GAME = 2;
static var RUNNING = 4;
static var WAIT = 8;
static var PAUSE = 16;
static var PLAY_AGAIN = 32;
static var WIN = 64;
static var LOSE = 128;
static var _defOffset = 0;
static var _defLen = 7;
static var current = 0;
}
Symbol 539 MovieClip [__Packages.Bit] Frame 0
class Bit
{
function Bit () {
}
static function getBits(value, st, len) {
return((((value >>> st) >>> len) << len) ^ (value >>> st));
}
static function setBits(value, val, st, len) {
var _local3 = getBits(value, st, len);
var _local2 = value ^ (_local3 << st);
var _local1 = val << st;
return(_local2 ^ _local1);
}
static function countBits(value) {
return(Math.ceil(Math.log(value) / Math.LN2));
}
static function bit2bin(a, b) {
return(a | (b << 16));
}
static function bin2bit(value) {
return({b:value >>> 16, a:value ^ ((value >>> 16) << 16)});
}
}
Symbol 540 MovieClip [__Packages.soundEngine.CSound] Frame 0
class soundEngine.CSound
{
static var GAME_MUSIC, MENU_MUSIC, WIN, LOOSE, BLOW, SHOOT, MISS, HIT, MORG, MORG2, MORG3, BUTTON_CLICK, instance;
var Snd, Mus;
function CSound () {
Snd = new soundEngine.WaveEngine(1);
Mus = new soundEngine.WaveEngine(2);
GAME_MUSIC = Mus.addStream("gameMusic", false);
MENU_MUSIC = Mus.addStream("menuMusic", false);
WIN = Snd.addStream("winGame", false);
LOOSE = Snd.addStream("gameEnd", false);
BLOW = Snd.addStream("blowCub", false);
SHOOT = Snd.addStream("shoot", false);
MISS = Snd.addStream("miss", false);
HIT = Snd.addStream("hit", false);
MORG = Snd.addStream("morg", false);
MORG2 = Snd.addStream("morg2", false);
MORG3 = Snd.addStream("morg3", false);
BUTTON_CLICK = Snd.addStream("button", false);
}
static function getInstance() {
if (instance == null) {
instance = new soundEngine.CSound();
}
return(instance);
}
function playSound(nId) {
if (bMute) {
return(undefined);
}
Snd.play(nId);
}
function playMusic(nId) {
if (bMuteMusic) {
return(undefined);
}
Mus.stopAll();
Mus.play(nId, 0, 10000);
}
function setMute(_bMute) {
bMute = !_bMute;
_root.settings.data.soundon = _bMute;
_root.soundon = _bMute;
if (bMute) {
Snd.soundOff();
} else {
Snd.soundOn();
}
}
function getMute() {
return(bMute);
}
function setMuteMusic(_bMuteMusic) {
bMuteMusic = !_bMuteMusic;
_root.musicon.data.Music = _bMuteMusic;
_root.musicon = _bMuteMusic;
if (bMuteMusic) {
Mus.stopAll();
}
}
function setSoundVolume(nVolume) {
nSoundVolume = nVolume;
Snd.setAllVolume(nSoundVolume);
}
function setMusicVolume(nVolume) {
nMusicVolume = nVolume;
Mus.setAllVolume(nMusicVolume);
}
var bMute = false;
var bMuteMusic = false;
var nSoundVolume = 100;
var nMusicVolume = 100;
}
Symbol 541 MovieClip [__Packages.soundEngine.WaveEngine] Frame 0
class soundEngine.WaveEngine
{
var type, stack, debugOn, mute, _mc;
function WaveEngine (type, debugOn) {
this.type = ((type == undefined) ? 1 : (type));
stack = new Object();
this.debugOn = ((type == undefined) ? false : (debugOn));
mute = false;
init();
}
function init() {
_numClass++;
_mc = _root.createEmptyMovieClip((("WaveEngine_" + _numClass) + "_") + type, _root.getNextHighestDepth());
}
function soundOff() {
if (!mute) {
debug("soundOff()");
for (var _local2 in stack) {
stack[_local2]._oldVolume = stack[_local2].getVolume();
setVolume(_local2, 0);
}
mute = true;
}
}
function soundOn() {
if (mute) {
mute = false;
debug("soundOn()");
for (var _local3 in stack) {
var _local2 = ((stack[_local3]._oldVolume == undefined) ? 100 : (stack[_local3]._oldVolume));
setVolume(_local3, _local2);
}
}
}
function getSoundStatus() {
return(!mute);
}
function play(id, secondsOffset, loops) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
if (type == 2) {
stopAll();
}
secondsOffset = ((secondsOffset == undefined) ? 0 : (secondsOffset));
loops = ((loops == undefined) ? 1 : (loops));
var _local3 = stack[id];
if (mute) {
_local3.setVolume(0);
} else if (type == 2) {
_local3.setVolume(nMucisVolume);
}
if (type == 2) {
loops = 65536;
}
_local3.start(secondsOffset, loops);
debug(((((("play(" + _local3.__link) + ", ") + secondsOffset) + ", ") + loops) + ")");
}
function playAll(secondsOffset, loops, autoDelete) {
for (var _local5 in stack) {
play(_local5, secondsOffset, loops, autoDelete);
}
}
function addStream(link_name, autoDelete) {
if (link_name == undefined) {
return(0);
}
autoDelete = ((autoDelete == undefined) ? true : (autoDelete));
var _local4 = _mc.createEmptyMovieClip("attachS_" + (++_numSound), _mc.getNextHighestDepth());
var _local2 = new Sound(_local4);
_local2.attachSound(link_name);
_local2.__parent = this;
_local2.__link = link_name;
_local2.__num = _numSound;
_local2.__mc = _local4;
_local2.__autoDelete = autoDelete;
_local2.onSoundComplete = function () {
if (this.__autoDelete) {
this.__parent.deleteSound(this.__num);
}
};
debug(("addStream(" + link_name) + ")");
stack[_numSound] = _local2;
return(_local2.__num);
}
function deleteSound(id) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
var _local2 = stack[id];
debug("Stack deletes a " + _local2.__link);
delete stack[id];
removeMovieClip(_local2.__mc);
}
function deleteAllSound() {
debug("deleteAllSound()");
for (var _local2 in stack) {
deleteSound(_local2);
}
}
function stop(id) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
var _local3 = stack[id];
_local3.stop();
debug(("stop(" + _local3.__link) + ")");
if (_local3.__autoDelete) {
if ((id != _numSound) || (type != 2)) {
deleteSound(id);
}
}
}
function stopAll() {
debug("stopAll()");
for (var _local2 in stack) {
stop(_local2);
}
}
function setVolume(id, volume) {
if (((id == undefined) || (volume == undefined)) || (stack[id] == undefined)) {
return(0);
}
var _local2 = stack[id];
if (type == 2) {
nMucisVolume = volume;
}
if (mute) {
_local2._oldVolume = volume;
return(0);
}
debug(((("setVolume(" + _local2.__link) + ", ") + volume) + ")");
if (_local2 != undefined) {
_local2.setVolume(volume);
}
}
function setAllVolume(volume) {
for (var _local2 in stack) {
setVolume(_local2, volume);
}
}
function debug(msg) {
if (debugOn) {
trace((type + " ") + msg);
}
}
function toString() {
return("[sound.CsoundEngine.WaveEngine]");
}
var _numSound = 0;
var nMucisVolume = 100;
static var _numClass = 0;
}
Symbol 542 MovieClip [__Packages.Process] Frame 0
class Process
{
function Process () {
}
static function main() {
var _local1 = 0;
while (_local1 < PROCESSES.length) {
var _local2 = PROCESSES[_local1][0].apply(null, PROCESSES[_local1][1]);
if (_local2 == KILL) {
kill(PROCESSES[_local1][0], PROCESSES[_local1][2]);
} else if (_local2 == HOLD) {
return(undefined);
}
_local1++;
}
}
static function start(ps, args, id, priority) {
id = ((id == undefined) ? -1 : (id));
if (priority == undefined) {
PROCESSES.push([ps, args, id]);
} else {
PROCESSES.splice(priority, 0, [ps, args, id]);
}
}
static function kill(ps, id) {
id = ((id == undefined) ? -1 : (id));
var _local1 = 0;
while (_local1 < PROCESSES.length) {
if (((PROCESSES[_local1][0] == ps) || ((PROCESSES[_local1][0].func == ps.func) && (ps.func != undefined))) && (PROCESSES[_local1][2] == id)) {
PROCESSES.splice(_local1--, 1);
}
_local1++;
}
}
static function killAll() {
PROCESSES = new Array();
}
static function is(ps, id) {
id = ((id == undefined) ? -1 : (id));
var _local1 = 0;
while (_local1 < PROCESSES.length) {
if (((PROCESSES[_local1][0] == ps) || (PROCESSES[_local1][0].func == ps.func)) && (PROCESSES[_local1][2] == id)) {
return(true);
}
_local1++;
}
return(false);
}
static function toString() {
return("[com.itpremium.games.Process]");
}
static function keepId() {
return(lastId++);
}
static var PROCESSES = new Array();
static var lastId = 1;
static var KILL = 0;
static var HOLD = -1;
}
Symbol 543 MovieClip [__Packages.Game] Frame 0
class Game
{
function Game () {
}
function toString() {
return("[class Game]");
}
}
Symbol 544 MovieClip [__Packages.CWindow] Frame 0
class CWindow
{
static var wndOld;
var mcWnd, amcBtn;
function CWindow (sHeader, sMsg, aoBtn, bDelOld) {
if (bDelOld && (wndOld != undefined)) {
wndOld.destroy();
}
wndOld = this;
mcWnd = _root.attachMovie(sWndTplName, "wnd_CWindow_" + (nWndNum++), _root.getNextHighestDepth());
mcWnd._x = nCenterX;
mcWnd._y = nCenterY;
setMessage(sMsg);
setHeader(sHeader);
amcBtn = new Array();
if ((aoBtn != undefined) && (aoBtn.length > 0)) {
addBtns(aoBtn);
}
}
function createBanner(sUrlMc, sUrlClick, nX, nY) {
}
function createCountDown(nTime, cbF, nX, nY) {
}
function setMessage(sMsg) {
mcWnd.msg.text = sMsg;
}
function setHeader(sHeader) {
mcWnd.header.text = sHeader;
}
function addBtns(aoBtn) {
var _local2 = 0;
while (_local2 < aoBtn.length) {
addBtn(aoBtn[_local2]);
_local2++;
}
alignBtns();
}
function addBtn(oBtn) {
var _local2;
_local2 = mcWnd.attachMovie(sBtnTplName, "btn" + amcBtn.length, mcWnd.getNextHighestDepth());
amcBtn.push(_local2);
_local2.fDelegate = mx.utils.Delegate.create(this, onRelease);
_local2.fCb = oBtn.cbfunc;
_local2.onRelease = function () {
this.fDelegate(this.fCb);
};
_local2.title.text = oBtn.title;
_local2._y = nBtnDefaultY;
}
function destroy() {
removeMovieClip(mcWnd);
}
function onRelease(fCb) {
var _local2 = fCb();
if (_local2 == KILL) {
destroy();
}
}
function alignBtns() {
if (amcBtn.length == 0) {
return(false);
}
var _local3 = ((-((amcBtn.length * amcBtn[0]._width) + ((amcBtn.length - 1) * nBtnIndent))) / 2) + (amcBtn[0]._width / 2);
var _local2 = 0;
while (_local2 < amcBtn.length) {
amcBtn[_local2]._x = (_local3 + (_local2 * amcBtn[0]._width)) + (_local2 * nBtnIndent);
_local2++;
}
}
static var KILL = 0;
static var nWndNum = 0;
static var nBtnDefaultY = 130;
static var nBtnIndent = 10;
static var nCenterX = Stage.width / 2;
static var nCenterY = Stage.height / 2;
var sWndTplName = "wndTpl";
var sBtnTplName = "btnTpl";
}
Symbol 545 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, aArgs, bMerge) {
var _local2 = function () {
var _local3 = arguments.callee.target;
var _local2 = arguments.callee.func;
var _local4 = arguments.callee.bMerge;
if (_local4) {
var _local5 = mx.utils.Delegate.merge(arguments, arguments.callee.aArgs);
} else {
var _local5 = ((arguments.length > 0) ? arguments : (arguments.callee.aArgs));
}
_local2.___nCount = arguments.callee.nCount;
return(_local2.apply(_local3, _local5));
};
_local2.type = "Delegate";
_local2.target = obj;
_local2.func = func;
_local2.nCount = ++nCount;
if (_local2.func.___aInnerValues == undefined) {
_local2.func.___aInnerValues = new Array();
}
_local2.func.___aInnerValues[nCount] = new Object();
_local2.aArgs = aArgs;
_local2.bMerge = bMerge;
return(_local2);
}
static function set(sValueName, value) {
return((arguments.caller.___aInnerValues[arguments.caller.___nCount][sValueName] = value));
}
static function get(sValueName) {
return(arguments.caller.___aInnerValues[arguments.caller.___nCount][sValueName]);
}
static function merge(aA, aB) {
var _local1 = 0;
while (_local1 < aB.length) {
aA.push(aB[_local1]);
_local1++;
}
return(aA);
}
static function clone(fDelegate) {
if ((fDelegate.target != undefined) && (fDelegate.func != undefined)) {
return(create(fDelegate.target, fDelegate.func, fDelegate.aArgs, fDelegate.bMerge));
}
return(fDelegate);
}
function createDelegate(obj) {
return(create(obj, func));
}
static var nCount = 0;
}
Symbol 546 MovieClip [__Packages.CXML] Frame 0
class CXML extends XML
{
var oResult, cbfunc;
function CXML () {
super();
}
function onLoad(bSuccess) {
trace("on");
if (bSuccess) {
parse(this, (oResult = new Object()));
}
return(cbfunc(bSuccess));
}
function parse(node, oRes) {
node.ignoreWhite = true;
var _local2 = 0;
while (_local2 < node.childNodes.length) {
if (node.childNodes[_local2].childNodes.length > 1) {
parse(node.childNodes[_local2], (oRes[node.childNodes[_local2].nodeName] = new Object()));
} else if (node.childNodes[_local2].hasChildNodes()) {
switch (node.childNodes[_local2].attributes.type) {
case "Number" :
var _local4 = Number(node.childNodes[_local2].firstChild.nodeValue);
break;
case "nArray" :
_local4 = conv2NumAr(node.childNodes[_local2].firstChild.nodeValue.split(node.childNodes[_local2].attributes.separator));
break;
case "sArray" :
_local4 = node.childNodes[_local2].firstChild.nodeValue.split(node.childNodes[_local2].attributes.separator);
break;
default :
_local4 = node.childNodes[_local2].firstChild.nodeValue;
}
oRes[node.childNodes[_local2].nodeName] = _local4;
}
_local2++;
}
}
function conv2NumAr(ar) {
var _local1 = 0;
while (_local1 < ar.length) {
ar[_local1] = Number(ar[_local1]);
_local1++;
}
return(ar);
}
}
Symbol 547 MovieClip [__Packages.CTimer] Frame 0
class CTimer
{
var countAmount, tempTime, elapsed, timerId, fn, startTime;
function CTimer (ca, _fn, _args) {
countAmount = ca;
tempTime = 0;
elapsed = 0;
Id++;
timerId = Id;
fn = _fn;
args = _args;
}
function start() {
startTime = getTimer();
createGameProcess();
Process.start(mx.utils.Delegate.create(this, checkTime), [], timerId, 1);
}
function createGameProcess() {
var _local3 = _root.createEmptyMovieClip("Timer_" + timerId, 999999);
_local3.onEnterFrame = mx.utils.Delegate.create(this, mainProcess);
}
function stop() {
Process.kill(mx.utils.Delegate.create(this, checkTime), timerId);
elapsed = 0;
tempTime = 0;
}
function terminate() {
fn.apply(null, args);
stop();
}
function pause() {
Process.kill(mx.utils.Delegate.create(this, checkTime), timerId);
if (elapsed > 1) {
tempTime = tempTime + elapsed;
}
}
function getTime() {
return(elapsed);
}
function checkTime() {
elapsed = (getTimer() - startTime) + tempTime;
if ((Math.floor(elapsed / 10) % countAmount) == 0) {
fn.apply(null, args);
}
}
function mainProcess() {
Process.main();
}
static var Id = 0;
var args = new Array();
}
Symbol 548 MovieClip [__Packages.cField] Frame 0
class cField
{
var mc, _field, _line, _lineLimit, stOver, ej, ei;
function cField (_mc) {
mc = _mc;
_field = new Array(_root.SIZEX);
_line = new Array(_root.SIZEY);
}
function init() {
createField();
line();
LOADED = true;
settings(0);
ST_STARTLINES = true;
ST_ENDLEVEL = false;
_root.showReady();
overSound = false;
_root.scoresTimer.stop();
}
function main() {
if (!LOADED) {
init();
return(undefined);
}
switch (true) {
case ST_STOP :
return(undefined);
case ST_CENTRALIZE :
centralize();
break;
case ST_END :
end();
return(undefined);
case ST_SAVER :
saver();
return(undefined);
case ST_OVER :
over();
return(undefined);
case ST_STARTLINES :
startLines();
break;
case ST_DROP :
dropBlock();
}
linePush();
}
function createField() {
var _local5 = 0;
while (_local5 < _root.SIZEX) {
_field[_local5] = new Array(_root.SIZEY);
var _local4 = 0;
while (_local4 < _root.SIZEY) {
var _local3 = mc.t_tile.duplicateMovieClip((("tile" + _local5) + "_") + _local4, (FIELDDEPTH + (_local5 * 20)) + (_root.SIZEY - _local4));
_local3._y = tileWidth * _local4;
if (_root.HSINDEX < 2) {
_local3._x = tileHeight * _local5;
} else {
_local3._x = tileHeight * (15 - _local5);
}
_local3._i = _local4;
_local3._j = _local5;
_local3.gotoAndStop(_root.TL_CLEAR);
_field[_local5][_local4] = _local3;
_local4++;
}
_local5++;
}
mc.t_tile._visible = false;
return(true);
}
function line() {
var _local3 = 0;
while (_local3 < _root.SIZEY) {
var _local4 = mc.t_tile.duplicateMovieClip("line" + _local3, LINEDEPTH + _local3);
_local4._y = tileWidth * _local3;
_local4._x = -100;
_local4.gotoAndStop(_root.TL_CLEAR);
_local4._type = "line";
_line[_local3] = _local4;
_line[_local3]._visible = false;
_linepos = 0;
_local3++;
}
}
function randomFrame() {
if ((BOMBCHANCE > 0) && (random(BOMBCHANCE + 1) == 1)) {
return(_root.TL_BOMB);
}
if ((CBOMBCHANCE > 0) && (random(CBOMBCHANCE + 1) == 1)) {
return(_root.TL_CBOMB + random(MAXCOLORS + 1));
}
return(random(MAXCOLORS) + 2);
}
function addLine() {
trace("addLine");
if (ST_ENDLEVEL) {
return(undefined);
}
if (checkEnd()) {
ST_OVER = true;
_root._IGNOREUSER = true;
overI = 0;
return(undefined);
}
rowUp();
if (_lineLimit > 0) {
var _local3 = 0;
while (_local3 < _root.SIZEY) {
_field[_root.SIZEX - 1][_local3].gotoAndStop(_line[_local3]._currentframe);
_line[_local3].gotoAndStop(_root.TL_CLEAR);
_local3++;
}
}
_lineLimit--;
if (_lineLimit >= 0) {
_root._linesLeft = _lineLimit;
}
if (_root.ARCADE && (_lineLimit < 0)) {
_root.nextLevel();
} else if (_lineLimit <= 0) {
levelEnd();
}
_linepos = 0;
}
function checkEnd() {
if (checkBottom() > 0) {
return(false);
}
return(true);
}
function checkBottom() {
var _local4 = 0;
var _local3 = 0;
while (_local3 < _root.SIZEX) {
if ((_field[_local3][_root.SIZEY - 1]._currentframe == _root.TL_CLEAR) || (_field[_local3][_root.SIZEY - 1]._currentframe == undefined)) {
_local4++;
}
_local3++;
}
return(_local4);
}
function rowUp() {
var _local5 = _root.SIZEX - 1;
while ((_field[_local5][_root.SIZEY - 1]._currentframe != _root.TL_CLEAR) && (_field[_local5][_root.SIZEY - 1]._currentframe != undefined)) {
_local5--;
}
var _local4 = _local5;
while (_local4 < (_root.SIZEX - 1)) {
var _local3 = 0;
while (_local3 < _root.SIZEY) {
_field[_local4][_local3].gotoAndStop(_field[_local4 + 1][_local3]._currentframe);
_local3++;
}
_local4++;
}
_field[_root.SIZEX - 1][_local3].gotoAndStop(_root.TL_CLEAR);
}
function lineFill() {
if (_root._linesLeft <= 0) {
return(undefined);
}
var _local3 = _linepos;
while (_local3 < _root.SIZEY) {
_line[_local3].gotoAndStop(randomFrame());
_local3++;
}
_linepos = 0;
addLine();
stTime = 0;
}
function linePush() {
if (ST_ENDLEVEL) {
return(undefined);
}
if (_linepos >= _root.SIZEY) {
addLine();
}
if (_lineLimit == 0) {
if ((getTimer() - _lastPush) < 100) {
return(false);
}
_line[_linepos].gotoAndStop(_root.TL_CLEAR);
} else {
if ((getTimer() - _lastPush) < (PUSHTIME - 1000)) {
return(false);
}
_line[_linepos].gotoAndStop(randomFrame());
}
_linepos++;
_lastPush = getTimer();
if ((DROPCHANCE > 0) && (random(DROPCHANCE + 1) == 1)) {
ST_DROP = true;
}
return(true);
}
function centralize() {
var _local5 = 0;
var _local4 = 0;
while (_local4 < _root.SIZEX) {
var _local3 = 0;
while (_local3 < _root.SIZEY) {
if ((_field[_local4][_local3]._currentframe != _root.TL_CLEAR) && (_field[_local4][_local3 + 1]._currentframe == _root.TL_CLEAR)) {
_field[_local4][_local3 + 1].gotoAndStop(_field[_local4][_local3]._currentframe);
_field[_local4][_local3].gotoAndStop(_root.TL_CLEAR);
_local5++;
}
_local3++;
}
_local4++;
}
if (!_local5) {
ST_CENTRALIZE = false;
}
}
function remove(_selected) {
if (_selected.length > 30) {
_root.bonus(_selected.length * 3);
_root.countPoints(_selected.length * 2, 0, 1);
}
while (_selected.length > 0) {
_selected.pop().gotoAndStop(_root.TL_CLEAR);
}
ST_CENTRALIZE = true;
_root.t_bombdamage._width = _root.BOMB_SIZE;
_root.t_bombdamage._height = _root.BOMB_SIZE;
}
function over() {
if (ST_CENTRALIZE || (ST_DROP)) {
return(undefined);
}
if (!overSound) {
_root.playSound("snd_gameOver");
overSound = true;
}
overI++;
if (overI >= _root.SIZEX) {
ST_OVER = false;
saverGameOver();
}
}
function stop() {
ST_STOP = true;
}
function settings(levelNum) {
if (levelNum < 4) {
PUSHTIME = PUSHTIME - 30;
} else {
PUSHTIME = PUSHTIME - 30;
}
_lineLimit = _root.level1Lines + (5 * levelNum);
_startLines = 2;
_root._linesLeft = _lineLimit;
}
function clear() {
ST_ENDLEVEL = false;
var _local3 = 0;
while (_local3 < _root.SIZEX) {
var _local4 = 0;
while (_local4 < _root.SIZEY) {
_field[_local3][_local4].gotoAndStop(_root.TL_CLEAR);
_local4++;
}
_local3++;
}
var _local4 = 0;
while (_local4 < _root.SIZEY) {
_line[_local4].gotoAndStop(_root.TL_CLEAR);
_local4++;
}
return(true);
}
function saverGameOver() {
ST_SAVER = true;
stOver = getTimer();
}
function saver() {
if ((getTimer() - stOver) > 500) {
trace("saver ingore false");
_root._IGNOREUSER = false;
clear();
ST_OVER = false;
ST_STOP = true;
ST_SAVER = false;
ST_OVER = false;
ST_STARTLINES = false;
_root.gameOver();
}
}
function levelEnd() {
trace("levelEnd");
_root.playSound("snd_nextLevel");
_root.endPoints = checkBottom() * 100;
ST_END = true;
ST_ENDLEVEL = true;
_root._LEVELEND = true;
_root._IGNOREUSER = true;
_line[0].gotoAndStop(_root.TL_CLEAR);
ej = 0;
ei = 0;
_root.scoresTimer.start();
}
function end() {
if (ST_CENTRALIZE) {
return(false);
}
ei++;
if (ei > _root.SIZEX) {
_linePos = 0;
ST_STARTLINES = true;
ST_END = false;
showNag();
}
}
function showNag() {
_root.nag._visible = true;
}
function startLines() {
lineFill();
_startLines--;
if (_startLines <= 0) {
ST_STARTLINES = false;
}
}
function dropBlock() {
var _local3 = _root.SIZEX - 1;
while ((_field[_local3][_root.SIZEY - 1]._currentframe != _root.TL_CLEAR) && (_field[_local3][_root.SIZEY - 1]._currentframe != undefined)) {
_local3--;
}
var _local4 = random((_root.SIZEX - _local3) - 1);
_local4 = _local4 + (_local3 + 1);
if (_field[_local4][0]._currentframe == _root.TL_CLEAR) {
_field[_local4][0].gotoAndStop(randomFrame());
}
ST_CENTRALIZE = true;
ST_DROP = false;
}
var MAXCOLORS = 4;
var DROPCHANCE = 15;
var BOMBCHANCE = 0;
var CBOMBCHANCE = 20;
var PUSHTIME = 1500;
var _startLines = 2;
var overI = 0;
var _type = 0;
var _linepos = 0;
var _lastPush = 0;
var _linePos = 0;
var overSound = false;
var FIELDDEPTH = 100;
var LINEDEPTH = 1000;
var ST_DROP = false;
var ST_CENTRALIZE = false;
var ST_STOP = false;
var LOADED = false;
var ST_OVER = false;
var ST_SAVER = false;
var ST_STARTLINES = false;
var ST_END = false;
var ST_ENDLEVEL = false;
var stTime = 0;
var tileWidth = 42;
var tileHeight = 42;
}