Combined Code
movieClip 2 Skin_Symbol_03 {
}
movieClip 9 Skin_Symbol_02 {
}
movieClip 12 Skin_Symbol_01 {
}
movieClip 13 Skin_Symbol_03 {
}
movieClip 14 Skin_Symbol_01 {
}
movieClip 15 Skin_Symbol_03 {
}
movieClip 16 Skin_Symbol_02 {
}
movieClip 17 Skin_Symbol_02 {
}
frame 1 {
if (useScores eq '1' and doOnce < 1) {
doOnce = 1;
_focusrect = false;
fscommand('showmenu', 'false');
savegame = '';
getURL('Javascript: tetrisArcade_DoFSCommand('Load', 0)', '');
}
ifFrameLoaded (3) {
gotoAndPlay(3);
}
}
frame 2 {
gotoAndPlay(1);
}
movieClip 22 {
}
movieClip 27 {
frame 1 {
stop();
}
}
movieClip 30 {
frame 1 {
stop();
}
}
movieClip 33 {
frame 1 {
stop();
}
}
movieClip 36 {
frame 1 {
stop();
}
}
movieClip 38 {
frame 1 {
stop();
}
instance TL of movieClip 27 {
onClipEvent (load) {
gotoAndPlay(2);
}
}
instance TL of movieClip 27 {
onClipEvent (load) {
gotoAndPlay(2);
}
}
instance BL of movieClip 30 {
onClipEvent (load) {
gotoAndPlay(3);
}
}
instance BL of movieClip 30 {
onClipEvent (load) {
gotoAndPlay(3);
}
}
instance BR of movieClip 33 {
onClipEvent (load) {
gotoAndPlay(4);
}
}
instance BR of movieClip 33 {
onClipEvent (load) {
gotoAndPlay(4);
}
}
instance TR of movieClip 36 {
onClipEvent (load) {
gotoAndPlay(5);
}
}
instance TR of movieClip 36 {
onClipEvent (load) {
gotoAndPlay(5);
}
}
}
instance LoadCircle of movieClip 38 {
onClipEvent (load) {
/:TestMode = false;
/:Total = int(_root.getBytesTotal() / 1024);
Time1 = int(getTimer() / 1000);
Kbps1 = 0;
}
onClipEvent (enterFrame) {
/:Loaded = int(_root.getBytesLoaded() / 1024);
/:Percent = int(/:Loaded / (/:Total / 100));
if (99 < /:Percent) {
/:Percent = 99;
}
if (_root.getBytesLoaded() >= _root.getBytesTotal() and !/:TestMode) {
_root.gotoAndPlay(_root._currentframe + 1);
} else {
_parent.LoadCircle.gotoAndStop(/:Percent);
/:SecondsLeft = int((/:Total - /:Loaded) / /:Speed);
Time2 = int(getTimer() / 1000);
if (Time2 - Time1 >= 3) {
Time1 = Time2;
/:Speed = (_root.getBytesLoaded() - Kbps) / 1024 / 3;
/:Speed = String(/:Speed);
if (/:Speed.indexOf('.') >= 0) {
/:Speed = /:Speed.split('.');
/:Speed = /:Speed[0] add '.' add substring(/:Speed[1], 1, 2);
}
Kbps = _root.getBytesLoaded();
}
}
}
}
button 50 {
on (press) {
getURL('http://www.miniclip.com', '_blank');
}
}
frame 51 {
if (!(savegame eq '') and !(savegame eq 'Null')) {
dummy = savegame.split('|');
scores = new Array();
names = new Array();
c = 0;
while (9 >= c) {
names[c] = dummy[c * 2];
scores[c] = Number(dummy[c * 2 + 1]);
++c;
}
} else {
scores = new Array(4000, 3000, 2000, 1000, 800, 600, 400, 300, 200, 100);
names = new Array();
c = 0;
while (9 >= c) {
_root.names[c] = 'JOHNDOE';
++c;
}
}
stop();
}
movieClip 58 {
}
button 66 {
on (release) {
getURL('http://www.miniclip.com/signup.htm', '_blank');
}
}
button 71 {
on (press) {
getURL('http://www.miniclip.com/Homepage.htm', '_blank');
}
}
button 74 {
on (press) {
getURL('http://www.miniclip.com/download_tetris.htm', '_blank');
}
}
button 76 {
on (press) {
getURL('http://www.miniclip.com/Downloads.htm', '_blank');
}
}
movieClip 81 {
frame 1 {
stop();
}
}
movieClip 83 {
}
movieClip 91 {
frame 1 {
this.gotoAndStop(_parent._parent._parent.brickType);
stop();
}
}
movieClip 92 {
frame 1 {
this.gotoAndStop(_parent._parent._parent.brickType);
stop();
}
}
movieClip 93 {
frame 1 {
stop();
}
frame 10 {
play();
}
frame 18 {
gotoAndPlay(10);
}
}
movieClip 94 {
frame 1 {
Box._visible = 0;
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
}
movieClip 95 {
}
button 96 {
on (keyPress '<Space>') {
if (!gameRunning and !gamePaused and !Misc.running) {
} else {
if (gameRunning and !gamePaused) {
Sounds.gotoAndPlay('QuickDrop');
GamePiece.quickDrop();
}
}
}
on (keyPress '<Left>') {
if (gameRunning and !gamePaused) {
GamePiece.moveLeft();
}
}
on (keyPress '<Right>') {
if (gameRunning and !gamePaused) {
GamePiece.moveRight();
}
}
on (keyPress '<Down>') {
if (gameRunning and !gamePaused) {
GamePiece.moveDown();
}
}
on (keyPress '<Up>') {
if (gameRunning and !gamePaused) {
Sounds.gotoAndPlay('Rotate');
GamePiece.rotate();
}
}
on (keyPress 'p') {
if (gameRunning and !gamePaused) {
gamePaused = true;
stopAllSounds();
Text3D.write('PAUSED!', 105, 135);
} else {
if (gameRunning and gamePaused) {
Music.gotoAndPlay(Music._currentframe - 1);
gamePaused = false;
}
}
}
on (keyPress 'q') {
if (gameRunning) {
gamePaused = false;
GamePiece.gameOver();
}
}
}
movieClip 108 {
frame 1 {
stop();
}
frame 6 {
stop();
}
frame 16 {
stop();
}
frame 27 {
stop();
}
frame 36 {
stop();
}
frame 46 {
stop();
}
frame 56 {
stop();
}
frame 66 {
stop();
}
frame 77 {
stop();
}
frame 87 {
stop();
}
frame 96 {
stop();
}
frame 107 {
stop();
}
frame 116 {
stop();
}
frame 121 {
stop();
}
frame 126 {
stop();
}
}
movieClip 118 {
frame 1 {
stop();
}
frame 2 {
play();
}
frame 16 {
stop();
}
}
movieClip 179 {
frame 1 {
stop();
}
}
movieClip 180 {
frame 1 {
stop();
}
}
movieClip 181 {
frame 1 {
stop();
}
frame 2 {
gotoAndPlay('In' add _parent.animation);
}
frame 3 {
play();
}
frame 18 {
Timer.start();
stop();
}
instance Timer of movieClip 180 {
onClipEvent (enterFrame) {
++loop;
if (loop >= _parent._parent.stayTime and !_parent.dontFade) {
loop = 0;
_parent.gotoAndPlay('Out');
}
}
}
frame 19 {
play();
}
frame 35 {
Timer.start();
stop();
}
instance Timer of movieClip 180 {
onClipEvent (enterFrame) {
++loop;
if (loop >= _parent._parent.stayTime and !_parent.dontFade) {
loop = 0;
_parent.gotoAndPlay('Out');
}
}
}
frame 36 {
play();
}
frame 55 {
Timer.start();
stop();
}
instance Timer of movieClip 180 {
onClipEvent (enterFrame) {
++loop;
if (loop >= _parent._parent.stayTime and !_parent.dontFade) {
loop = 0;
_parent.gotoAndPlay('Out');
}
}
}
frame 56 {
play();
}
frame 79 {
Timer.start();
stop();
}
instance Timer of movieClip 180 {
onClipEvent (enterFrame) {
++loop;
if (loop >= _parent._parent.stayTime and !_parent.dontFade) {
loop = 0;
_parent.gotoAndPlay('Out');
}
}
}
frame 80 {
play();
}
frame 114 {
Timer.start();
stop();
}
instance Timer of movieClip 180 {
onClipEvent (enterFrame) {
++loop;
if (loop >= _parent._parent.stayTime and !_parent.dontFade) {
loop = 0;
_parent.gotoAndPlay('Out');
}
}
}
frame 125 {
stop();
}
}
movieClip 182 {
}
movieClip 184 {
frame 1 {
this.swapDepths(10001);
}
frame 44 {
_parent.Options._visible = 1;
if (_root.scores[9] < _parent.score) {
_parent.Options.gotoAndStop(8);
} else {
_parent.Options.gotoAndStop(1);
}
stop();
}
}
movieClip 185 {
frame 1 {
running = false;
if (screenFilled) {
gotoAndPlay(5);
} else {
stop();
}
}
frame 5 {
col = 0;
row = 1;
dir = 'r';
left = 1;
top = 1;
right = _parent.cols;
bottom = _parent.rows;
total = right * bottom + 2;
count = 0;
if (screenFilled < 1) {
screenFilled = 1;
brickType = 4;
time1 = int(getTimer() / 1000);
} else {
screenFilled = 0;
brickType = 1;
}
running = true;
this.gotoAndPlay('Type' add (int(Math.random() * 4) + 1));
}
frame 10 {
if (dir eq 'r') {
if (right >= col) {
++col;
} else {
col = right;
--right;
dir = 'd';
}
} else {
if (dir eq 'd') {
if (bottom >= row) {
++row;
} else {
row = bottom;
--bottom;
dir = 'l';
}
} else {
if (dir eq 'l') {
if (col >= left) {
--col;
} else {
col = left;
++left;
dir = 'u';
}
} else {
if (dir eq 'u') {
if (top < row) {
--row;
} else {
row = top + 1;
++top;
dir = 'r';
}
}
}
}
}
if ((eval('_parent.Box' + col + '_' + row))._currentframe != brickType) {
(eval('_parent.Box' + col + '_' + row)).gotoAndStop(brickType);
(eval('_parent.Box' + col + '_' + row)).filled = false;
++count;
}
if (total < count) {
if (!screenFilled) {
_parent.showTitle();
}
gotoAndStop(1);
}
}
frame 11 {
if (dir eq 'r') {
if (right >= col) {
++col;
} else {
col = right;
--right;
dir = 'd';
}
} else {
if (dir eq 'd') {
if (bottom >= row) {
++row;
} else {
row = bottom;
--bottom;
dir = 'l';
}
} else {
if (dir eq 'l') {
if (col >= left) {
--col;
} else {
col = left;
++left;
dir = 'u';
}
} else {
if (dir eq 'u') {
if (top < row) {
--row;
} else {
row = top + 1;
++top;
dir = 'r';
}
}
}
}
}
if ((eval('_parent.Box' + col + '_' + row))._currentframe != brickType) {
(eval('_parent.Box' + col + '_' + row)).gotoAndStop(brickType);
(eval('_parent.Box' + col + '_' + row)).filled = false;
++count;
}
if (total < count) {
if (!screenFilled) {
_parent.showTitle();
}
gotoAndStop(1);
}
gotoAndPlay(_currentframe - 1);
}
frame 15 {
col = 1;
while (_parent.cols >= col) {
(eval('_parent.Box' + col + '_' + row)).gotoAndStop(brickType);
(eval('_parent.Box' + col + '_' + row)).filled = false;
++col;
}
++row;
if (_parent.rows < row) {
if (!screenFilled) {
_parent.showTitle();
}
gotoAndStop(1);
}
}
frame 17 {
gotoAndPlay(_currentframe - 2);
}
frame 20 {
row = 1;
while (_parent.rows >= row) {
(eval('_parent.Box' + left + '_' + row)).gotoAndStop(brickType);
(eval('_parent.Box' + left + '_' + row)).filled = false;
(eval('_parent.Box' + right + '_' + row)).gotoAndStop(brickType);
(eval('_parent.Box' + right + '_' + row)).filled = false;
++row;
}
++left;
--right;
if (left >= right) {
if (!screenFilled) {
_parent.showTitle();
}
gotoAndStop(1);
}
}
frame 23 {
gotoAndPlay(_currentframe - 3);
}
frame 25 {
if (dir eq 'r') {
++col;
if (right < col) {
dir = 'l';
++row;
}
} else {
--col;
if (col < 1) {
dir = 'r';
++row;
}
}
if (bottom >= row) {
(eval('_parent.Box' + col + '_' + row)).gotoAndStop(brickType);
(eval('_parent.Box' + col + '_' + row)).filled = false;
} else {
if (!screenFilled) {
_parent.showTitle();
}
gotoAndStop(1);
}
}
frame 26 {
if (dir eq 'r') {
++col;
if (right < col) {
dir = 'l';
++row;
}
} else {
--col;
if (col < 1) {
dir = 'r';
++row;
}
}
if (bottom >= row) {
(eval('_parent.Box' + col + '_' + row)).gotoAndStop(brickType);
(eval('_parent.Box' + col + '_' + row)).filled = false;
} else {
if (!screenFilled) {
_parent.showTitle();
}
gotoAndStop(1);
}
gotoAndPlay(_currentframe - 1);
}
}
button 187 {
on (press) {
if (!gameRunning and !gamePaused and !Misc.running) {
gotoAndStop(10);
_parent.startGame();
}
}
}
button 188 {
on (press) {
gotoAndStop(4);
}
}
button 189 {
on (press) {
gotoAndStop(2);
}
}
button 191 {
on (press) {
gotoAndStop(3);
}
}
button 195 {
on (press) {
fscommand('quit');
}
}
movieClip 197 {
frame 1 {
stop();
}
}
button 199 {
on (press) {
gotoAndStop(1);
}
}
movieClip 206 {
}
button 219 {
on (press) {
getURL('http://www.miniclip.com/store.htm', '_blank');
}
}
button 221 {
on (press) {
getURL('http://www.miniclip.com/TermsandConditions.htm', '_blank');
}
}
button 222 {
on (press) {
gotoAndStop(5);
}
}
button 223 {
on (press) {
gotoAndStop(6);
}
}
button 224 {
on (press) {
gotoAndStop(7);
}
}
button 227 {
on (press) {
if (_parent.rotationDir eq 'cw') {
_parent.rotationDir = 'ccw';
rotationText = 'ROTATION: LEFT';
} else {
_parent.rotationDir = 'cw';
rotationText = 'ROTATION: RIGHT';
}
}
}
button 239 {
on (press) {
if (10 < _parent.userSpeed) {
--_parent.userSpeed;
}
}
}
button 240 {
on (press) {
if (_parent.userSpeed < 40) {
++_parent.userSpeed;
}
}
}
button 241 {
on (press) {
if (0 < _parent.linesAtStart) {
--_parent.linesAtStart;
}
}
}
button 242 {
on (press) {
if (_parent.linesAtStart < 10) {
++_parent.linesAtStart;
}
}
}
button 243 {
on (press) {
if (10 < _parent.linesToRemove) {
--_parent.linesToRemove;
}
}
}
button 244 {
on (press) {
if (_parent.linesToRemove < 40) {
++_parent.linesToRemove;
}
}
}
button 246 {
on (press) {
if (1 < Brick._currentframe) {
Brick.prevFrame();
_parent.brickType = Brick._currentframe;
}
}
}
button 247 {
on (press) {
if (Brick._currentframe < Brick._totalframes) {
Brick.nextFrame();
_parent.brickType = Brick._currentframe;
}
}
}
movieClip 249 {
frame 1 {
stop();
}
}
button 250 {
on (press) {
if (_parent.piece[14]) {
_parent.piece[14] = false;
_parent.piece[15] = false;
Check14.gotoAndStop(1);
} else {
_parent.piece[14] = true;
_parent.piece[15] = true;
Check14.gotoAndStop(2);
}
}
}
button 251 {
on (press) {
if (_parent.piece[16]) {
_parent.piece[16] = false;
Check16.gotoAndStop(1);
} else {
_parent.piece[16] = true;
Check16.gotoAndStop(2);
}
}
}
button 252 {
on (press) {
if (_parent.piece[17]) {
_parent.piece[17] = false;
Check17.gotoAndStop(1);
} else {
_parent.piece[17] = true;
Check17.gotoAndStop(2);
}
}
}
button 253 {
on (press) {
if (_parent.piece[12]) {
_parent.piece[12] = false;
_parent.piece[13] = false;
Check12.gotoAndStop(1);
} else {
_parent.piece[12] = true;
_parent.piece[13] = true;
Check12.gotoAndStop(2);
}
}
}
button 254 {
on (press) {
if (_parent.piece[8]) {
_parent.piece[8] = false;
Check8.gotoAndStop(1);
} else {
_parent.piece[8] = true;
Check8.gotoAndStop(2);
}
}
}
button 255 {
on (press) {
if (_parent.piece[9]) {
_parent.piece[9] = false;
Check9.gotoAndStop(1);
} else {
_parent.piece[9] = true;
Check9.gotoAndStop(2);
}
}
}
button 256 {
on (press) {
if (_parent.piece[10]) {
_parent.piece[10] = false;
_parent.piece[11] = false;
Check10.gotoAndStop(1);
} else {
_parent.piece[10] = true;
_parent.piece[11] = true;
Check10.gotoAndStop(2);
}
}
}
movieClip 263 {
}
button 265 {
on (press) {
dragging = true;
startDrag('', false, left, _y, right, _y);
}
on (release, releaseOutside) {
stopDrag();
dragging = false;
}
}
movieClip 266 {
frame 1 {
stop();
}
}
movieClip 267 {
frame 1 {
stop();
}
}
movieClip 271 {
frame 1 {
stop();
}
instance Timer of movieClip 197 {
onClipEvent (load) {
time1 = int(getTimer() / 1000);
}
onClipEvent (enterFrame) {
time2 = int(getTimer() / 1000);
if (time2 - time1 >= 25) {
_parent.quickHighscores = true;
_parent.gotoAndPlay(9);
}
}
}
frame 6 {
c = 8;
while (_parent.piece.length - 1 >= c) {
if (_parent.piece[c]) {
(eval('Check' + c)).gotoAndStop(2);
}
++c;
}
}
instance Slider1 of movieClip 266 {
onClipEvent (load) {
left = _parent.Sliderbar1._x - _parent.Sliderbar1._width / 2;
right = _parent.Sliderbar1._x + _parent.Sliderbar1._width / 2;
onePercent = (right - left) / 100;
_x = left + _parent.FXVolume * onePercent;
}
onClipEvent (enterFrame) {
if (dragging) {
++loop;
if (5 < loop) {
loop = 0;
_parent._parent.Sounds.gotoAndPlay('Lines1');
}
_parent.FXVolume = int((_x - left) / onePercent);
_parent._parent.FXObject.setVolume(_parent.FXVolume);
}
}
}
instance Slider2 of movieClip 267 {
onClipEvent (load) {
left = _parent.Sliderbar2._x - _parent.Sliderbar2._width / 2;
right = _parent.Sliderbar2._x + _parent.Sliderbar2._width / 2;
onePercent = (right - left) / 100;
_x = left + _parent.BGVolume * onePercent;
}
onClipEvent (enterFrame) {
if (dragging) {
_parent.BGVolume = int((_x - left) / onePercent);
_parent._parent.MusicObject.setVolume(_parent.BGVolume);
}
}
}
frame 8 {
c = 1;
while (7 >= c) {
(eval('Char' + c)).dontFade = true;
(eval('Char' + c)).Char.gotoAndStop('SPACE');
(eval('Char' + c)).CharShadow.gotoAndStop('SPACE');
++c;
}
c = 1;
while (9 >= c) {
title = 'TOPSCORE!';
(eval('Title' + c)).dontFade = true;
(eval('Title' + c)).Char.gotoAndStop(title.substr(c - 1, 1));
(eval('Title' + c)).CharShadow.gotoAndStop(title.substr(c - 1, 1));
++c;
}
playerName = '';
stop();
}
frame 8 {
gotoAndPlay(1);
}
frame 9 {
gotoAndPlay(1);
}
frame 10 {
_visible = 0;
stop();
}
}
movieClip 276 {
frame 1 {
stop();
}
frame 5 {
stop();
}
frame 7 {
stop();
}
frame 9 {
stop();
}
frame 11 {
gotoAndPlay(5);
}
frame 15 {
play();
}
frame 17 {
gotoAndPlay(1);
}
frame 20 {
play();
}
frame 22 {
gotoAndPlay(1);
}
}
movieClip 277 {
frame 1 {
if (_name eq 'Explosion') {
_visible = 0;
}
}
frame 21 {
stop();
}
}
movieClip 278 {
frame 1 {
function createBoxes() {
y = 1;
while (rows >= y) {
x = 1;
while (cols >= x) {
duplicateMovieClip('Box', 'Box' + x + '_' + y, /:zIndex);
eval('Box' + x + '_' + y)._x = Box._x + (x - 1) * (Box._width + 2);
eval('Box' + x + '_' + y)._y = Box._y + (y - 1) * (Box._height + 2);
++/:zIndex;
++x;
}
++y;
}
}
function startGame() {
stopAllSounds();
Title._visible = 0;
Text3D.write('GET READY!', 65, 135);
Sounds.gotoAndPlay('Start');
Music.gotoAndPlay(5);
GamePiece.start(startX, startY);
BG.gotoAndStop(1);
gameRunning = true;
removedLines = 0;
level = 1;
score = 0;
speed = userSpeed;
c = 0;
while (c < linesAtStart) {
x = 1;
while (cols >= x) {
if (int(Math.random() * 2) + 1 == 2) {
(eval('Box' + x + '_' + (rows - c))).gotoAndStop(2);
(eval('Box' + x + '_' + (rows - c))).Brick.gotoAndStop(int(Math.random() * 9) + 1);
(eval('Box' + x + '_' + (rows - c))).filled = true;
}
++x;
}
++c;
}
}
function showTitle() {
Title._visible = 1;
Options._visible = 0;
Options.gotoAndStop(1);
Title.gotoAndPlay(1);
Music.gotoAndPlay('Title');
}
function highScoreSort(scoresArray, playersArray) {
i = (eval('_root.' + scoresArray)).length - 2;
while (i >= 0) {
j = 0;
while (i >= j) {
if ((eval('_root.' + scoresArray))[j] < (eval('_root.' + scoresArray))[j + 1]) {
temp1 = (eval('_root.' + scoresArray))[j];
temp2 = (eval('_root.' + playersArray))[j];
(eval('_root.' + scoresArray))[j] = (eval('_root.' + scoresArray))[j + 1];
(eval('_root.' + playersArray))[j] = (eval('_root.' + playersArray))[j + 1];
(eval('_root.' + scoresArray))[j + 1] = temp1;
(eval('_root.' + playersArray))[j + 1] = temp2;
}
++j;
}
--i;
}
}
}
frame 1 {
/:zIndex = 100;
rows = 18;
cols = 10;
startX = 5;
startY = 1;
points1 = 15;
points2 = 50;
points3 = 150;
points4 = 350;
FXVolume = 100;
BGVolume = 100;
MusicObject = new Sound(Music);
FXObject = new Sound(Sounds);
specialFrequency = 25;
userSpeed = 30;
rotationDir = 'cw';
brickType = 1;
standardTetris = false;
linesToRemove = 15;
linesAtStart = 3;
piece = new Array();
piece[0] = false;
piece[1] = true;
piece[2] = true;
piece[3] = true;
piece[4] = true;
piece[5] = true;
piece[6] = true;
piece[7] = true;
piece[8] = false;
piece[9] = false;
piece[10] = false;
piece[11] = false;
piece[12] = false;
piece[13] = false;
piece[14] = false;
piece[15] = false;
piece[16] = false;
piece[17] = false;
createBoxes();
showTitle();
stop();
}
instance GamePiece of movieClip 95 {
onClipEvent (load) {
function start(startX, startY) {
selectPiece();
c = 1;
while (4 >= c) {
x[c] = startX + Number(coords[currPiece].substr(c - 1, 1));
y[c] = startY + Number(coords[currPiece].substr(c + 3, 1));
++c;
}
if (!special) {
if (!(eval('_parent.Box' + x[1] + '_' + y[1])).filled and !(eval('_parent.Box' + x[2] + '_' + y[2])).filled and !(eval('_parent.Box' + x[3] + '_' + y[3])).filled and !(eval('_parent.Box' + x[4] + '_' + y[4])).filled) {
draw();
} else {
gameOver();
}
}
time1 = int(getTimer() / 100);
}
function selectPiece() {
if (int(Math.random() * _parent.specialFrequency) == 5) {
_parent.Sounds.gotoAndPlay('Special2');
currPiece = 18;
currColor = 10;
special = true;
this.depth = 500;
return undefined;
}
currPiece = nextPiece;
currColor = nextColor;
special = false;
nextPiece = 0;
while (nextPiece < 1 or _parent.piece[nextPiece] == false) {
nextPiece = int(Math.random() * numPieces);
nextColor = coords[nextPiece].substr(9, 1);
}
c = 1;
while (4 >= c) {
(eval('_parent.Prev' + c + '_1')).gotoAndStop(1);
(eval('_parent.Prev' + c + '_2')).gotoAndStop(1);
++c;
}
c = 1;
while (4 >= c) {
x[c] = 1 + Number(coords[nextPiece].substr(c - 1, 1));
y[c] = 1 + Number(coords[nextPiece].substr(c + 3, 1));
(eval('_parent.Prev' + x[c] + '_' + y[c])).gotoAndPlay(2);
(eval('_parent.Prev' + x[c] + '_' + y[c])).Brick.gotoAndStop(nextColor);
++c;
}
}
function draw() {
c = 1;
while (4 >= c) {
(eval('_parent.Box' + x[c] + '_' + y[c])).gotoAndStop(2);
(eval('_parent.Box' + x[c] + '_' + y[c])).Brick.gotoAndStop(currColor);
(eval('_parent.Box' + x[c] + '_' + y[c])).filled = true;
++c;
}
}
function moveDown() {
liftPiece();
blocked = false;
if (special) {
if (y[1] == _parent.rows + 1) {
blocked = true;
special = false;
_parent.Sounds.gotoAndPlay('Whom');
} else {
if ((eval('_parent.Box' + x[1] + '_' + (y[1] + 1))).filled) {
_parent.Sounds.gotoAndPlay('Special1');
duplicateMovieClip(_parent.Explosion, 'Explosion' + depth, depth);
eval('_parent.Explosion' + depth)._x = (eval('_parent.Box' + x[1] + '_' + (y[1] + 1)))._x;
eval('_parent.Explosion' + depth)._y = (eval('_parent.Box' + x[1] + '_' + (y[1] + 1)))._y;
(eval('_parent.Explosion' + depth)).Brick.gotoAndStop((eval('_parent.Box' + x[1] + '_' + (y[1] + 1))).Brick._currentframe);
++depth;
}
}
} else {
c = 1;
while (4 >= c) {
if (y[c] == _parent.rows or (eval('_parent.Box' + x[c] + '_' + (y[c] + 1))).filled) {
blocked = true;
}
++c;
}
}
if (!blocked) {
++y[1];
++y[2];
++y[3];
++y[4];
draw();
return true;
} else {
_parent.Sounds.gotoAndPlay('Ground');
draw();
findFull();
start(_parent.startX, _parent.startY);
return false;
}
}
function moveLeft() {
liftPiece();
blocked = false;
if (special) {
if (x[1] == 1) {
blocked = true;
} else {
if ((eval('_parent.Box' + (x[1] - 1) + '_' + y[1])).filled) {
_parent.Sounds.gotoAndPlay('Special1');
duplicateMovieClip(_parent.Explosion, 'Explosion' + depth, depth);
eval('_parent.Explosion' + depth)._x = (eval('_parent.Box' + x[1] + '_' + (y[1] + 1)))._x;
eval('_parent.Explosion' + depth)._y = (eval('_parent.Box' + x[1] + '_' + (y[1] + 1)))._y;
(eval('_parent.Explosion' + depth)).Brick.gotoAndStop((eval('_parent.Box' + x[1] + '_' + (y[1] + 1))).Brick._currentframe);
++depth;
}
}
} else {
c = 1;
while (4 >= c) {
if (x[c] == 1 or (eval('_parent.Box' + (x[c] - 1) + '_' + y[c])).filled) {
blocked = true;
}
++c;
}
}
if (!blocked) {
--x[1];
--x[2];
--x[3];
--x[4];
}
draw();
}
function moveRight() {
liftPiece();
blocked = false;
if (special) {
if (x[1] == _parent.cols) {
blocked = true;
} else {
if ((eval('_parent.Box' + (x[1] + 1) + '_' + y[1])).filled) {
_parent.Sounds.gotoAndPlay('Special1');
duplicateMovieClip(_parent.Explosion, 'Explosion' + depth, depth);
eval('_parent.Explosion' + depth)._x = (eval('_parent.Box' + x[1] + '_' + (y[1] + 1)))._x;
eval('_parent.Explosion' + depth)._y = (eval('_parent.Box' + x[1] + '_' + (y[1] + 1)))._y;
(eval('_parent.Explosion' + depth)).Brick.gotoAndStop((eval('_parent.Box' + x[1] + '_' + (y[1] + 1))).Brick._currentframe);
++depth;
}
}
} else {
c = 1;
while (4 >= c) {
if (x[c] == _parent.cols or (eval('_parent.Box' + (x[c] + 1) + '_' + y[c])).filled) {
blocked = true;
}
++c;
}
}
if (!blocked) {
++x[1];
++x[2];
++x[3];
++x[4];
}
draw();
}
function quickDrop() {
drop = true;
while (drop) {
drop = moveDown();
}
}
function rotate() {
if (currPiece == 6) {
return undefined;
}
liftPiece();
if (_parent.rotationDir eq 'ccw') {
c = 1;
while (4 >= c) {
newX[c] = x[2] - y[2] + y[c];
newY[c] = x[2] + y[2] - x[c];
++c;
}
} else {
c = 1;
while (4 >= c) {
newX[c] = x[2] + y[2] - y[c];
newY[c] = -x[2] + y[2] + x[c];
++c;
}
}
blocked = false;
c = 1;
while (4 >= c) {
if (newX[c] < 1 or _parent.cols < newX[c] or _parent.rows < newY[c] or (eval('_parent.Box' + newX[c] + '_' + newY[c])).filled) {
blocked = true;
}
++c;
}
if (!blocked) {
c = 1;
while (4 >= c) {
x[c] = newX[c];
y[c] = newY[c];
++c;
}
}
draw();
}
function liftPiece() {
c = 1;
while (4 >= c) {
(eval('_parent.Box' + x[c] + '_' + y[c])).gotoAndStop(1);
(eval('_parent.Box' + x[c] + '_' + y[c])).filled = false;
++c;
}
}
function findFull() {
if (0 < fullLines.length) {
return undefined;
}
removedLines = 0;
row = _parent.rows;
while (row >= 1) {
bricks = 0;
col = 1;
while (_parent.cols >= col) {
if ((eval('_parent.Box' + col + '_' + row)).filled) {
++bricks;
}
if (bricks == _parent.cols) {
fullLines.push(row);
col = 1;
while (_parent.cols >= col) {
(eval('_parent.Box' + col + '_' + row)).filled = false;
(eval('_parent.Box' + col + '_' + row)).gotoAndStop(3);
++col;
}
}
++col;
}
--row;
}
removedLines = fullLines.length;
if (2 < removedLines) {
_parent.BG.gotoAndPlay(_parent.BG._currentframe + 1);
}
_parent.Sounds.gotoAndPlay('Lines' add removedLines);
_parent.score += eval('_parent.points' + removedLines);
_parent.removedLines += removedLines;
linesToRemove -= removedLines;
if (0 >= linesToRemove) {
linesToRemove = _parent.linesToRemove;
++_parent.level;
if (_parent.level >= 5) {
_parent.brickType = int(Math.random() * _parent.Box1_1.Brick._totalframes) + 1;
}
_parent.Text3D.write('NEXT STAGE!', 50, 135);
_parent.BG.gotoAndPlay(_parent.BG._currentframe + 1);
_parent.Sounds.gotoAndPlay('LevelUp');
_parent.Music.gotoAndPlay(_parent.Music._currentframe + 1);
_parent.speed -= 4;
if (_parent.speed < 4) {
_parent.speed = 4;
}
}
}
function shiftLines() {
liftPiece();
while (0 < fullLines.length) {
row = fullLines.pop();
while (1 < row) {
col = 1;
while (_parent.cols >= col) {
(eval('_parent.Box' + col + '_' + row)).filled = (eval('_parent.Box' + col + '_' + (row - 1))).filled;
(eval('_parent.Box' + col + '_' + row)).gotoAndStop((eval('_parent.Box' + col + '_' + (row - 1)))._currentframe);
(eval('_parent.Box' + col + '_' + row)).Brick.gotoAndStop((eval('_parent.Box' + col + '_' + (row - 1))).Brick._currentframe);
++col;
}
--row;
}
col = 1;
while (_parent.cols >= col) {
(eval('_parent.Box' + col + '_1')).filled = false;
(eval('_parent.Box' + col + '_1')).gotoAndStop(1);
++col;
}
}
draw();
_parent.Sounds.gotoAndPlay('Whom');
if (removedLines == 3) {
_parent.Text3D.write('WELL DONE!', 65, 135);
} else {
if (3 < removedLines) {
_parent.Text3D.write('ULTRA LINE!', 80, 135);
}
}
}
function gameOver() {
stopAllSounds();
_parent.Misc.gotoAndPlay('Fill');
_parent.gameRunning = false;
_parent.gameOver = true;
_parent.Text3D.write('GAME OVER!', 65, 135);
_parent.Sounds.gotoAndPlay('GameOver');
}
linesToRemove = _parent.linesToRemove;
fullLines = new Array();
special = false;
x = new Array();
y = new Array();
newX = new Array();
newY = new Array();
coords = new Array();
coords[1] = '01230000-1';
coords[2] = '01220001-2';
coords[3] = '01200001-3';
coords[4] = '01120011-4';
coords[5] = '12010011-5';
coords[6] = '12120011-6';
coords[7] = '01210001-7';
coords[8] = '11110000-8';
coords[9] = '11220000-9';
coords[10] = '01110011-1';
coords[11] = '21110011-8';
coords[12] = '01220011-2';
coords[13] = '12000011-3';
coords[14] = '01230011-4';
coords[15] = '01231100-5';
coords[16] = '20200011-6';
coords[17] = '01231010-7';
coords[18] = '11110000';
numPieces = coords.length - 1;
currPiece = 0;
nextPiece = 0;
while (nextPiece < 1 or _parent.piece[nextPiece] == false) {
nextPiece = int(Math.random() * numPieces) + 1;
nextColor = coords[nextPiece].substr(9, 1);
}
currColor = 0;
nextColor = coords[nextPiece].substr(9, 1);
}
onClipEvent (enterFrame) {
if (0 < fullLines.length) {
shiftLines();
}
if (_parent.gameRunning and !_parent.gamePaused) {
++loopCount;
if (loopCount >= _parent.speed) {
loopCount = 0;
moveDown();
}
}
}
}
instance Text3D of movieClip 182 {
onClipEvent (load) {
function write(myText, x, y) {
this.myText = myText;
depth = 1;
_x = x;
_y = y;
xPos = 0;
charCount = 0;
animation = int(Math.random() * 5) + 1;
typing = true;
}
this.swapDepths(10000);
numOfChars = 0;
spacing = _width + 5;
delay = 3;
stayTime = 50;
typing = false;
Char._visible = 0;
}
onClipEvent (enterFrame) {
if (typing) {
++loop;
if (loop >= delay) {
loop = 0;
thisChar = myText.substr(charCount, 1);
if (thisChar eq ' ') {
loop = delay;
xPos += spacing;
} else {
duplicateMovieClip('Char', 'Char' add charCount, depth);
eval('Char' add charCount)._x = xPos;
eval('Char' add charCount)._y = Char._y;
(eval('Char' + charCount)).Char.gotoAndStop(thisChar);
(eval('Char' + charCount)).CharShadow.gotoAndStop(thisChar);
(eval('Char' + charCount)).gotoAndPlay(2);
xPos += spacing;
++depth;
}
++charCount;
if (charCount == myText.length) {
typing = false;
}
}
}
}
}
instance Options of movieClip 271 {
onClipEvent (load) {
_visible = 0;
}
}
}