Frame 2
stop();
Frame 3
function game_init() {
removed = 0;
score = 0;
interval = 250;
x2_horiz_pos = 0;
mult = 1;
game_over = 0;
turns = 0;
tiles_placed = 0;
x = 0;
while (x < 10) {
field[x] = Array();
y = 0;
while (y < 10) {
field[x][y] = 0;
y++;
}
x++;
}
_root.createEmptyMovieClip("things", _root.getNextHighestDepth());
score_obj.score.text = "Score: " + score;
place_line();
}
function place_line() {
x = 0;
while (x < 10) {
tiles_placed++;
if (field[x][0] != 0) {
push_blocks(x);
}
tile = things.attachMovie("tile", "tile_" + tiles_placed, tiles_placed, {_x:10 + (32 * x), _y:300});
num = Math.floor(Math.random() * 6) + 1;
tile.gotoAndStop(num);
field[x][0] = tiles_placed;
x++;
}
}
function push_blocks(col_number) {
i = 9;
while (i >= 0) {
if (!game_over) {
if (field[col_number][i] != 0) {
if (i != 9) {
field[col_number][i + 1] = field[col_number][i];
things["tile_" + field[col_number][i]]._y = things["tile_" + field[col_number][i]]._y - 32;
} else {
things._alpha = 50;
game_over = 1;
bXlnYW1lX25hbWVfdmFyaWFibGU = player_name;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = score;
__rankz_send__("MTk0MWolZSVhJW4lcw==", "cHltcFpTaGI=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
rankz_t10_send = new LoadVars();
_root.attachMovie("ohno", "ohno", _root.getNextHighestDepth(), {_x:75, _y:5});
again_button = ohno.attachMovie("playagain", "playagain", _root.getNextHighestDepth());
again_button._x = 100;
again_button._y = 300;
again_button.onPress = function () {
things.removeMovieClip();
game_init();
ohno.removeMovieClip();
};
}
}
}
i--;
}
}
function remove_tiles(tx, ty, clicked) {
tile_type = things["tile_" + field[tx][ty]]._currentframe;
if (!clicked) {
things["tile_" + field[tx][ty]].onEnterFrame = function () {
this._y++;
this._alpha--;
if (this._alpha == 0) {
this.removeMovieClip();
}
};
field[tx][ty] = 0;
removed++;
if (ty == x2_horiz_pos) {
mult = 2;
}
}
if ((field[tx + 1][ty] != 0) and (things["tile_" + field[tx + 1][ty]]._currentframe == tile_type)) {
remove_tiles(tx + 1, ty);
}
if ((field[tx - 1][ty] != 0) and (things["tile_" + field[tx - 1][ty]]._currentframe == tile_type)) {
remove_tiles(tx - 1, ty);
}
if ((field[tx][ty + 1] != 0) and (things["tile_" + field[tx][ty + 1]]._currentframe == tile_type)) {
remove_tiles(tx, ty + 1);
}
if ((field[tx][ty - 1] != 0) and (things["tile_" + field[tx][ty - 1]]._currentframe == tile_type)) {
remove_tiles(tx, ty - 1);
}
}
function update_field() {
i = 0;
while (i < 10) {
j = 1;
while (j < 10) {
if ((field[i][j] != 0) and (field[i][j - 1] == 0)) {
falling = j - 1;
while ((field[i][falling] == 0) and (falling >= 0)) {
field[i][falling] = field[i][falling + 1];
things["tile_" + field[i][falling + 1]]._y = things["tile_" + field[i][falling + 1]]._y + 32;
field[i][falling + 1] = 0;
falling--;
}
}
j++;
}
i++;
}
}
stop();
field = Array();
_root.attachMovie("splash", "splash", _root.getNextHighestDepth());
_root.attachMovie("playbutton", "playbutton", _root.getNextHighestDepth());
_root.attachMovie("soundbutton", "soundbutton", _root.getNextHighestDepth());
playbutton._x = 105;
playbutton._y = 222;
soundbutton._x = 425;
soundbutton._y = 40;
music = new Sound(this);
music.attachSound("music");
music.start(0, 10000);
playing_the_game = false;
playbutton.onPress = function () {
player_name = splash.your_name.text;
playing_the_game = true;
_root.attachMovie("bg", "bg", _root.getNextHighestDepth());
_root.attachMovie("x2_horiz", "x2_horiz", _root.getNextHighestDepth(), {_x:10});
_root.createEmptyMovieClip("bar", _root.getNextHighestDepth());
_root.attachMovie("score", "score_obj", _root.getNextHighestDepth(), {_x:340, _y:10});
game_init();
splash.removeMovieClip();
_root.soundbutton._y = 10000;
this._y = 10000;
};
soundbutton.onPress = function () {
music.stop();
};
_root.onEnterFrame = function () {
if (!game_over) {
interval--;
if (interval == 0) {
turns++;
interval = 250 - turns;
place_line();
x2_horiz_pos = Math.floor(Math.random() * 10);
x2_horiz._y = 300 - (x2_horiz_pos * 32);
}
bar.clear();
bar.lineStyle(6, 16777215);
bar.moveTo(10, 350);
bar.lineTo(328, 350);
bar.lineStyle(4, 0);
bar.moveTo(10, 350);
bar.lineTo(10 + ((318 * interval) / (250 - turns)), 350);
}
};
onMouseDown = function () {
if (playing_the_game) {
if (!game_over) {
x_tile_clicked = Math.floor((_root._xmouse - 10) / 32);
y_tile_clicked = -Math.floor((_root._ymouse - 300) / 32);
if ((((x_tile_clicked >= 0) and (x_tile_clicked <= 9)) and (y_tile_clicked >= 0)) and (y_tile_clicked <= 9)) {
if (field[x_tile_clicked][y_tile_clicked] != 0) {
remove_tiles(x_tile_clicked, y_tile_clicked, 1);
update_field();
i = 1;
while (i <= removed) {
score = score + (i * mult);
i++;
}
score_obj.score.text = "Score: " + score;
removed = 0;
mult = 1;
}
}
}
}
};
Symbol 18 Button
on (release) {
getURL ("http://lulz.ws", "_blank");
}
Symbol 19 Button
on (release) {
getURL ("http://thatcomposerguy.newgrounds.com/", "_blank");
}
Symbol 34 MovieClip Frame 11
stop();
Symbol 36 Button
on (release) {
getURL ("http://lulz.ws/", "_blank");
}
Symbol 39 Button
on (release) {
getURL ("http://lulz.ws/index.php?task=tag&t=christmas", "_blank");
}
Symbol 58 MovieClip Frame 83
stop();
Symbol 59 MovieClip Frame 180
_root.nextFrame();
Symbol 60 Button
on (release) {
var link = "http://www.lulz.ws";
this.getURL(link, "_blank");
}