Frame 1
fscommand ("trapallkeys", true);
_global.phpurl = "http://ccgi.gdward.plus.com/cgi-bin/tetris/highscores.php";
windowarea.useHandCursor = false;
stop();
Instance of Symbol 83 MovieClip in Frame 1
onClipEvent (load) {
x = _x;
y = _y;
}
onClipEvent (enterFrame) {
_x = (x + random(3));
_y = (y + random(3));
p = Math.floor((100 * _root.getBytesLoaded()) / _root.getBytesTotal());
if (p >= 100) {
_parent.play();
}
percent.setValue(p + "%");
}
Frame 2
function alphaDecimal(str) {
var _local3 = 1;
var _local5 = 0;
var _local2 = str.length - 1;
while (_local2 >= 0) {
var _local1 = str.charCodeAt(_local2);
if ((_local1 >= 48) && (_local1 <= 57)) {
_local1 = _local1 - 48;
} else if ((_local1 >= 65) && (_local1 <= 90)) {
_local1 = _local1 - 55;
} else if ((_local1 >= 97) && (_local1 <= 122)) {
_local1 = _local1 - 87;
} else {
_local1 = 0;
}
_local5 = _local5 + (_local3 * _local1);
_local3 = _local3 * 36;
_local2--;
}
return(_local5);
}
function newBlock(id, y, x, r) {
r = r % 4;
if (r < 0) {
r = r + 4;
}
var _local1 = new Object();
_local1.id = id;
_local1.r = r;
_local1.x = x;
_local1.y = y;
_local1.colour = BlockData[id][4];
_local1.shine = 128;
_local1.bx = new Array(4);
_local1.by = new Array(4);
_local1.floorkick = 1;
i = 0;
while (i < 4) {
_local1.bx[i] = BlockData[id][r][i].x;
_local1.by[i] = BlockData[id][r][i].y;
i++;
}
return(_local1);
}
function highscores() {
var _local1 = new LoadVars();
if (death) {
_local1.death = 1;
}
if (mirror) {
_local1.mirror = 1;
}
if (flip) {
_local1.flip = 1;
}
if (!shownext) {
_local1.hidenext = 1;
}
scores.loadScores();
}
BlockData = new Array();
i = 0;
while (i < 7) {
BlockData[i] = new Array(4);
j = 0;
while (j < 4) {
BlockData[i][j] = new Array(4);
k = 0;
while (k < 4) {
BlockData[i][j][k] = new Object();
k++;
}
j++;
}
i++;
}
BlockData[0][0][0].x = 0;
BlockData[0][0][0].y = 1;
BlockData[0][0][1].x = 1;
BlockData[0][0][1].y = 1;
BlockData[0][0][2].x = 2;
BlockData[0][0][2].y = 1;
BlockData[0][0][3].x = 3;
BlockData[0][0][3].y = 1;
BlockData[0][1][0].x = 2;
BlockData[0][1][0].y = 0;
BlockData[0][1][1].x = 2;
BlockData[0][1][1].y = 1;
BlockData[0][1][2].x = 2;
BlockData[0][1][2].y = 2;
BlockData[0][1][3].x = 2;
BlockData[0][1][3].y = 3;
BlockData[0][2] = BlockData[0][0];
BlockData[0][3] = BlockData[0][1];
BlockData[0][4] = 16711680 /* 0xFF0000 */;
BlockData[1][0][0].x = 0;
BlockData[1][0][0].y = 1;
BlockData[1][0][1].x = 0;
BlockData[1][0][1].y = 2;
BlockData[1][0][2].x = 1;
BlockData[1][0][2].y = 1;
BlockData[1][0][3].x = 2;
BlockData[1][0][3].y = 1;
BlockData[1][1][0].x = 0;
BlockData[1][1][0].y = 0;
BlockData[1][1][1].x = 1;
BlockData[1][1][1].y = 0;
BlockData[1][1][2].x = 1;
BlockData[1][1][2].y = 1;
BlockData[1][1][3].x = 1;
BlockData[1][1][3].y = 2;
BlockData[1][2][0].x = 0;
BlockData[1][2][0].y = 2;
BlockData[1][2][1].x = 1;
BlockData[1][2][1].y = 2;
BlockData[1][2][2].x = 2;
BlockData[1][2][2].y = 1;
BlockData[1][2][3].x = 2;
BlockData[1][2][3].y = 2;
BlockData[1][3][0].x = 1;
BlockData[1][3][0].y = 0;
BlockData[1][3][1].x = 1;
BlockData[1][3][1].y = 1;
BlockData[1][3][2].x = 1;
BlockData[1][3][2].y = 2;
BlockData[1][3][3].x = 2;
BlockData[1][3][3].y = 2;
BlockData[1][4] = 16744448 /* 0xFF8000 */;
BlockData[2][0][0].x = 1;
BlockData[2][0][0].y = 1;
BlockData[2][0][1].x = 1;
BlockData[2][0][1].y = 2;
BlockData[2][0][2].x = 2;
BlockData[2][0][2].y = 1;
BlockData[2][0][3].x = 2;
BlockData[2][0][3].y = 2;
BlockData[2][1] = BlockData[2][0];
BlockData[2][2] = BlockData[2][0];
BlockData[2][3] = BlockData[2][0];
BlockData[2][4] = 16776960 /* 0xFFFF00 */;
BlockData[3][0][0].x = 0;
BlockData[3][0][0].y = 1;
BlockData[3][0][1].x = 1;
BlockData[3][0][1].y = 1;
BlockData[3][0][2].x = 1;
BlockData[3][0][2].y = 2;
BlockData[3][0][3].x = 2;
BlockData[3][0][3].y = 2;
BlockData[3][1][0].x = 1;
BlockData[3][1][0].y = 1;
BlockData[3][1][1].x = 1;
BlockData[3][1][1].y = 2;
BlockData[3][1][2].x = 2;
BlockData[3][1][2].y = 0;
BlockData[3][1][3].x = 2;
BlockData[3][1][3].y = 1;
BlockData[3][2] = BlockData[3][0];
BlockData[3][3] = BlockData[3][1];
BlockData[3][4] = 65280;
BlockData[4][0][0].x = 0;
BlockData[4][0][0].y = 1;
BlockData[4][0][1].x = 1;
BlockData[4][0][1].y = 1;
BlockData[4][0][2].x = 1;
BlockData[4][0][2].y = 2;
BlockData[4][0][3].x = 2;
BlockData[4][0][3].y = 1;
BlockData[4][1][0].x = 0;
BlockData[4][1][0].y = 1;
BlockData[4][1][1].x = 1;
BlockData[4][1][1].y = 0;
BlockData[4][1][2].x = 1;
BlockData[4][1][2].y = 1;
BlockData[4][1][3].x = 1;
BlockData[4][1][3].y = 2;
BlockData[4][2][0].x = 0;
BlockData[4][2][0].y = 2;
BlockData[4][2][1].x = 1;
BlockData[4][2][1].y = 1;
BlockData[4][2][2].x = 1;
BlockData[4][2][2].y = 2;
BlockData[4][2][3].x = 2;
BlockData[4][2][3].y = 2;
BlockData[4][3][0].x = 1;
BlockData[4][3][0].y = 0;
BlockData[4][3][1].x = 1;
BlockData[4][3][1].y = 1;
BlockData[4][3][2].x = 1;
BlockData[4][3][2].y = 2;
BlockData[4][3][3].x = 2;
BlockData[4][3][3].y = 1;
BlockData[4][4] = 65535;
BlockData[5][0][0].x = 0;
BlockData[5][0][0].y = 1;
BlockData[5][0][1].x = 1;
BlockData[5][0][1].y = 1;
BlockData[5][0][2].x = 2;
BlockData[5][0][2].y = 1;
BlockData[5][0][3].x = 2;
BlockData[5][0][3].y = 2;
BlockData[5][1][0].x = 0;
BlockData[5][1][0].y = 2;
BlockData[5][1][1].x = 1;
BlockData[5][1][1].y = 0;
BlockData[5][1][2].x = 1;
BlockData[5][1][2].y = 1;
BlockData[5][1][3].x = 1;
BlockData[5][1][3].y = 2;
BlockData[5][2][0].x = 0;
BlockData[5][2][0].y = 1;
BlockData[5][2][1].x = 0;
BlockData[5][2][1].y = 2;
BlockData[5][2][2].x = 1;
BlockData[5][2][2].y = 2;
BlockData[5][2][3].x = 2;
BlockData[5][2][3].y = 2;
BlockData[5][3][0].x = 1;
BlockData[5][3][0].y = 0;
BlockData[5][3][1].x = 1;
BlockData[5][3][1].y = 1;
BlockData[5][3][2].x = 1;
BlockData[5][3][2].y = 2;
BlockData[5][3][3].x = 2;
BlockData[5][3][3].y = 0;
BlockData[5][4] = 255;
BlockData[6][0][0].x = 0;
BlockData[6][0][0].y = 2;
BlockData[6][0][1].x = 1;
BlockData[6][0][1].y = 1;
BlockData[6][0][2].x = 1;
BlockData[6][0][2].y = 2;
BlockData[6][0][3].x = 2;
BlockData[6][0][3].y = 1;
BlockData[6][1][0].x = 0;
BlockData[6][1][0].y = 0;
BlockData[6][1][1].x = 0;
BlockData[6][1][1].y = 1;
BlockData[6][1][2].x = 1;
BlockData[6][1][2].y = 1;
BlockData[6][1][3].x = 1;
BlockData[6][1][3].y = 2;
BlockData[6][2] = BlockData[6][0];
BlockData[6][3] = BlockData[6][1];
BlockData[6][4] = 16711935 /* 0xFF00FF */;
kL1 = 37;
kL2 = 100;
kR1 = 39;
kR2 = 102;
kD1 = 40;
kD2 = 98;
kF1 = 38;
kF2 = 104;
kF3 = 32;
kA1 = 90;
kA2 = 83;
kC1 = 88;
kC2 = 65;
kC3 = 101;
kP1 = 80;
kP2 = 13;
guide = true;
noisy = true;
if (hidenext > 0) {
shownext = false;
} else {
shownext = true;
}
if (replayQuality == null) {
replayQuality = 1;
}
if (death != true) {
death = false;
}
if (mirror != true) {
mirror = false;
}
if (flip != true) {
flip = false;
}
if (replaydata.length > 0) {
rec = new Object();
rec.s = replaydata;
rec.playback = true;
gotoAndStop ("Replay");
} else {
gotoAndStop ("Menu");
}
Frame 3
author._y = 56;
display._y = 72;
tetris._y = 8;
qual._y = 364;
framerate._y = 8;
sound._y = 380;
stop();
Instance of Symbol 116 MovieClip "sound" in Frame 3
onClipEvent (load) {
function playMusic(mus, loop, offset) {
m.stop();
m.attachSound(mus);
loopOffest = offset;
if (loop == 1) {
m.onSoundComplete = null;
} else {
m.onSoundComplete = function () {
m.start(loopOffset, 0);
};
}
m.start(0, 0);
}
function playSound(sou) {
if (_parent.noisy) {
s.attachSound(sou);
s.start();
}
}
function stopMusic() {
m.stop();
}
function toggleSound() {
enableSound(!_parent.noisy);
}
function enableSound(bool) {
if ((_parent.noisy = bool)) {
m.setVolume(slider2._x);
s.setVolume(2 * slider1._x);
} else {
m.setVolume(0);
s.setVolume(0);
}
}
loopOffset = 0;
s = new Sound(_parent);
s.setVolume(50);
m = new Sound(this);
m.setVolume(50);
}
onClipEvent (enterFrame) {
if (_parent.noisy) {
m.setVolume(slider2._x);
s.setVolume(2 * slider1._x);
}
}
Instance of Symbol 99 MovieClip in Frame 3
onClipEvent (load) {
setting = "_parent.shownext";
}
Instance of Symbol 99 MovieClip in Frame 3
onClipEvent (load) {
setting = "_parent.mirror";
}
Instance of Symbol 99 MovieClip in Frame 3
onClipEvent (load) {
setting = "_parent.flip";
}
Instance of Symbol 99 MovieClip in Frame 3
onClipEvent (load) {
setting = "_parent.death";
}
Instance of Symbol 139 MovieClip in Frame 3
onClipEvent (load) {
if (_parent.controls > 0) {
gotoAndPlay(_parent.controls);
}
}
Instance of Symbol 99 MovieClip in Frame 3
onClipEvent (load) {
setting = "_parent.guide";
}
Instance of Symbol 143 MovieClip "scores" in Frame 3
onClipEvent (load) {
showall = -1;
loadScores();
}
Frame 4
gotoAndStop(_currentframe + 1);
Frame 5
stop();
Instance of Symbol 145 MovieClip "field" in Frame 5
onClipEvent (load) {
function pL() {
if ((Key.isDown(_parent.kL1) || (Key.isDown(_parent.kL2))) || (fkL > 1)) {
return(true);
}
return(false);
}
function pR() {
if ((Key.isDown(_parent.kR1) || (Key.isDown(_parent.kR2))) || (fkR > 1)) {
return(true);
}
return(false);
}
function pD() {
if ((Key.isDown(_parent.kD1) || (Key.isDown(_parent.kD2))) || (fkD > 1)) {
return(true);
}
return(false);
}
function pF() {
if (((Key.isDown(_parent.kF1) || (Key.isDown(_parent.kF2))) || (Key.isDown(_parent.kF3))) || (fkF > 1)) {
return(true);
}
return(false);
}
function pRC() {
if (((Key.isDown(_parent.kC1) || (Key.isDown(_parent.kC2))) || (Key.isDown(_parent.kC3))) || (fkC > 1)) {
return(true);
}
return(false);
}
function pRA() {
if ((Key.isDown(_parent.kA1) || (Key.isDown(_parent.kA2))) || (fkA > 1)) {
return(true);
}
return(false);
}
function Gen(block) {
if (block == null) {
block = _parent.newBlock(random(7), 0, 3, 0);
if (_parent.shownext) {
var i = 0;
while (i < 4) {
var mc = ("b" + (4 + i));
attachMovie("Block", mc, 1508 + i);
eval (mc).colour = block.colour;
eval (mc).shine = block.shine;
setProperty(mc, _x , 16 * (block.x + block.bx[i]));
setProperty(mc, _y , (16 * (block.y + block.by[i])) - 40);
i++;
}
}
} else {
var i = 0;
while (i < 4) {
var mc = ("b" + i);
attachMovie("Block", mc, 1504 + i);
eval (mc).colour = block.colour;
eval (mc).shine = block.shine;
setProperty(mc, _x , 16 * (block.x + block.bx[i]));
setProperty(mc, _y , 16 * (block.y + block.by[i]));
i++;
}
if (_parent.guide && (!_parent.death)) {
var i = 0;
while (i < 4) {
var mc = ("g" + i);
attachMovie("Block", mc, 1500 + i);
eval (mc).colour = block.colour;
eval (mc).shine = block.shine;
setProperty(mc, _alpha , 12.5);
i++;
}
Guide(block);
}
}
return(block);
}
function Min(block) {
var _local2 = 0;
var _local1 = 0;
while ((_local1 < 4) && (_local2 < 3)) {
if (block.by[_local1] > _local2) {
_local2 = block.by[_local1];
}
_local1++;
}
return(_local2 + block.y);
}
function Col(block) {
var _local1 = 0;
while (_local1 < 4) {
if (F[block.y + block.by[_local1]][block.x + block.bx[_local1]] != 0) {
return(true);
}
_local1++;
}
return(false);
}
function Edge(block) {
if ((block.x + block.bx[0]) < 0) {
return(true);
}
if ((block.x + block.bx[3]) > 9) {
return(true);
}
return(false);
}
function Line(id) {
if ((id < 0) || (id > 20)) {
return(false);
}
var _local1 = 0;
while (_local1 < 10) {
if (F[id][_local1] == 0) {
return(false);
}
_local1++;
}
return(true);
}
function Kill(id) {
if (id > 20) {
return(undefined);
}
var i = 0;
while (i < 10) {
F[id][i] = 0;
var mc = ((("b" + id) + "-") + i);
eval (mc).swapDepths((1000 + i) + (10 * id));
eval (mc).gotoAndPlay(2);
setProperty(mc, _name , "_" + mc);
removeMovieClip((("bg" + id) + "-") + i);
i++;
}
var i = id;
while (i > 0) {
var j = 0;
while (j < 10) {
F[i][j] = F[i - 1][j];
if (F[i][j] != 0) {
var mc = ((("b" + (i - 1)) + "-") + j);
eval (mc)._y = eval (mc)._y + 16;
eval (mc).swapDepths((500 + j) + (i * 10));
setProperty(mc, _name , (("b" + i) + "-") + j);
eval ((mc = (("bg" + (i - 1)) + "-") + j))._y = eval ((mc = (("bg" + (i - 1)) + "-") + j))._y + 16;
eval (mc).swapDepths((100 + j) + (i * 10));
setProperty(mc, _name , (("bg" + i) + "-") + j);
}
j++;
}
i--;
}
var i = 0;
while (i < 10) {
F[0][i] = 0;
i++;
}
}
function setBorder(bool) {
var _local3 = 0;
while (_local3 < 21) {
var _local1 = 0;
while (_local1 < 10) {
if (F[_local3][_local1] != 0) {
var _local2 = (("bg" + _local3) + "-") + _local1;
if (bool) {
attachMovie("borderBlock", _local2, (100 + _local1) + (_local3 * 10));
setProperty(_local2, _x , 16 * _local1);
setProperty(_local2, _y , 16 * _local3);
} else {
removeMovieClip(_local2);
}
}
_local1++;
}
_local3++;
}
}
function Guide(block) {
if (((block == null) || (!_parent.guide)) || (_parent.death)) {
return(undefined);
}
var _local5 = block.y;
while (!Col(block)) {
block.y++;
}
block.y--;
var _local2 = 0;
while (_local2 < 4) {
var _local4 = "g" + _local2;
setProperty(_local4, _x , 16 * (block.x + block.bx[_local2]));
setProperty(_local4, _y , 16 * (block.y + block.by[_local2]));
_local2++;
}
block.y = _local5;
}
function strTime(n) {
var _local1 = Math.round(((n % 60) * 5) / 3);
n = Math.floor(n / 60);
if (_local1 < 10) {
_local1 = "0" + _local1;
}
_local1 = ((n % 60) + "\"") + _local1;
n = Math.floor(n / 60);
if (_local1.length < 5) {
_local1 = "0" + _local1;
}
_local1 = ((n % 60) + "'") + _local1;
if (n >= 60) {
if (_local1.length < 8) {
_local1 = "0" + _local1;
}
_local1 = (Math.floor(n / 60) + ":") + _local1.substr(0, 5);
}
return(_local1);
}
function GameOver() {
_parent.rec.s = _parent.rec.s + ((((("Y" + curBlock.y.toString(36)) + "X") + (curBlock.x + 3).toString(36)) + "R") + curBlock.r);
gameTime++;
removeMovieClip("go");
_parent.sound.playMusic("GameOver", 1);
_alpha = 25;
tb = -1;
_parent.gotoAndStop("GameOver");
}
function doReplay() {
if ((gameTime % _parent.rec.q) == 0) {
if (curBlock.y != _parent.rec.y) {
checkF();
_parent.rec.s = _parent.rec.s + ("Y" + curBlock.y.toString(36));
_parent.rec.y = curBlock.y;
}
if (curBlock.x != _parent.rec.x) {
checkF();
_parent.rec.s = _parent.rec.s + ("X" + (curBlock.x + 3).toString(36));
_parent.rec.x = curBlock.x;
}
if (curBlock.r != _parent.rec.r) {
checkF();
_parent.rec.s = _parent.rec.s + ("R" + curBlock.r);
_parent.rec.r = curBlock.r;
}
}
_parent.rec.f++;
}
function checkF() {
if (_parent.rec.f == 1) {
_parent.rec.s = _parent.rec.s + "F";
} else if (_parent.rec.f > 2) {
_parent.rec.s = _parent.rec.s + (("P" + _parent.rec.f.toString(36)) + "-");
} else if (_parent.rec.f == 2) {
_parent.rec.s = _parent.rec.s + "FF";
}
_parent.rec.f = 0;
}
var a = 0;
var t = getTimer();
var tb = -1;
var tl = 0;
var tx = 0;
var ty = 0;
var tr = 0;
var Ft = 0;
var Fa = 0;
var Fd = 0;
var vx = 0;
var vr = 0;
var vy = 0;
var land = false;
var fps = 60;
var timeDelim = new Array("\"", "'", ":");
F = new Array(22);
var i = 0;
while (i < 21) {
F[i] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
i++;
}
F[21] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
_parent.rec = new Object();
_parent.rec.f = 0;
_parent.rec.q = _parent.replayQuality;
_parent.rec.playback = false;
score = 0;
gameTime = 0;
blockCount = 0;
lineCount = 0;
level = 0;
_parent.display.level.reset();
_parent.display.lines.reset();
_parent.display.score.reset();
_parent.display.timer.reset();
var points = 0;
var fallDelay = 124;
var affixDelay = 30;
var blockDelay = 20;
if (_parent.death) {
fallDelay = 0;
}
if (_parent.flip) {
_y = 344;
_yscale = -100;
_parent.frame._y = 344;
_parent.frame._yscale = -100;
_parent.author._y = 333;
_parent.display._y = 40;
_parent.endgame._y = 345;
_parent.tetris._y = 348;
_parent.qual._y = 25;
_parent.sound._y = 9;
_parent.framerate._y = 380;
}
if (_parent.mirror) {
_x = 168;
_xscale = -100;
_parent.frame._x = 168;
_parent.frame._xscale = -100;
}
nextBlock = Gen();
_parent.rec.s = "V04" + nextBlock.id;
_parent.sound.playMusic("Intro", 1);
attachMovie("321", "go", 2000);
go._x = 80;
go._y = 160;
go._xscale = _xscale;
go._yscale = _yscale;
go.t0 = getTimer();
go.onEnterFrame = function () {
var _local2 = getTimer() - this.t0;
if (this._currentframe < ((_local2 * 3) / 50)) {
if (this._currentframe < 271) {
this.gotoAndStop(Math.min(Math.ceil((_local2 * 3) / 50), 271));
} else {
this.gotoAndStop(Math.min(Math.ceil((_local2 * 3) / 50), 376));
}
}
};
}
onClipEvent (enterFrame) {
ct = Math.max(1, (3 * ((dt = (-t) + ((t = getTimer()))))) / 50);
_parent.framerate.framerate.setValue(Math.round((fps = ((59 * fps) + (1000 / dt)) / 60)));
if (_visible) {
Fd = Fd + dt;
Ft++;
a = a + ct;
while (a > 0) {
Fa++;
a--;
vx = 0;
if (pL()) {
if (pR()) {
if (tx < 0) {
vx = 1;
tx = -10;
} else {
vx = -1;
tx = 10;
}
} else if ((tx > 0) || (tb > 0)) {
vx = -1;
tx = -10;
} else if (tx == 0) {
tx--;
vx = -1;
} else {
tx--;
if (tx < -10) {
vx = -1;
}
}
} else if (pR()) {
if ((tx < 0) || (tb > 0)) {
vx = 1;
tx = 10;
} else if (tx == 0) {
tx++;
vx = 1;
} else {
tx++;
if (tx > 10) {
vx = 1;
}
}
} else {
tx = 0;
}
fkL = 0;
fkR = 0;
if (pRC()) {
if (pRA()) {
if (tb > 0) {
vr = 2;
tr = 2;
} else if (tr != 2) {
vr = -tr;
tr = 2;
}
} else {
if (((tr == 0) || (tr == -1)) || (tb > 0)) {
vr = 1;
}
tr = 1;
}
} else if (pRA()) {
if (((tr == 0) || (tr == 1)) || (tb > 0)) {
vr = -1;
}
tr = -1;
} else {
vr = 0;
tr = 0;
}
fkC = 0;
fkA = 0;
if (pF()) {
vy = 30;
} else if (pD()) {
vy = 1;
} else {
vy = 0;
}
fkF = 0;
fkD = 0;
if (tb > 0) {
tb--;
if (tb <= 0) {
tb = 0;
curBlock = Gen(nextBlock);
checkF();
_parent.rec.s = _parent.rec.s + ("I" + curBlock.id);
_parent.rec.y = 0;
_parent.rec.x = 3;
_parent.rec.r = 0;
nextBlock = Gen();
_parent.rec.s = _parent.rec.s + ("N" + nextBlock.id);
if (vr == 0) {
vr = 4;
}
_parent.rec.r = 0;
curBlock.y++;
if (Col(curBlock)) {
_parent.sound.playSound("Land");
checkF();
_parent.rec.s = _parent.rec.s + "L";
land = true;
}
curBlock.y--;
}
}
if (tb == 0) {
if (vx != 0) {
curBlock.x = curBlock.x + vx;
if (Edge(curBlock) || (Col(curBlock))) {
curBlock.x = curBlock.x - vx;
} else {
curBlock.y++;
if (Col(curBlock)) {
if (!land) {
_parent.sound.playSound("Land");
checkF();
_parent.rec.s = _parent.rec.s + "L";
land = true;
}
} else {
land = false;
}
curBlock.y--;
Guide(curBlock);
}
}
if (vr != 0) {
testBlock = _parent.newBlock(curBlock.id, curBlock.y, curBlock.x, curBlock.r + vr);
if (((vx < 0) && (testBlock.id == 0)) && (testBlock.r == 1)) {
testBlock.x--;
}
testBlock.floorkick = curBlock.floorkick;
if (Edge(testBlock)) {
if (testBlock.x < 4) {
testBlock.x++;
if (Edge(testBlock)) {
testBlock.x++;
}
} else {
testBlock.x--;
}
} else if (Col(testBlock)) {
if ((vx > 0) || ((vx == 0) && (tx > 0))) {
testBlock.x++;
if ((!Edge(testBlock)) && (!Col(testBlock))) {
// unexpected jump
}
if ((testBlock.id == 0) && (testBlock.r == 0)) {
testBlock.x++;
if ((!Edge(testBlock)) && (!Col(testBlock))) {
// unexpected jump
}
testBlock.x--;
}
testBlock.x--;
} else if ((vx < 0) || ((vx == 0) && (tx < 0))) {
testBlock.x--;
if ((!Edge(testBlock)) && (!Col(testBlock))) {
// unexpected jump
}
testBlock.x++;
}
if (testBlock.floorkick) {
if (testBlock.id == 0) {
if (testBlock.r == 1) {
testBlock.y--;
if (!Col(testBlock)) {
testBlock.floorkick--;
// unexpected jump
}
testBlock.y--;
if (!Col(testBlock)) {
testBlock.floorkick--;
} else {
testBlock.y = testBlock.y + 2;
// unexpected jump
if (testBlock.id == 4) {
if (testBlock.r == 2) {
testBlock.y--;
if (!Col(testBlock)) {
testBlock.floorkick--;
// unexpected jump
}
testBlock.y++;
} else if (testBlock.r != 0) {
testBlock.y++;
if (!Col(testBlock)) {
testBlock.floorkick--;
// unexpected jump
}
testBlock.y--;
}
}
var kickdir = 1;
switch (testBlock.id) {
case 0 :
if (testBlock.r == 1) {
kickdir = -1;
}
break;
case 1 :
if ((testBlock.r % 2) == 1) {
kickdir = -1;
}
break;
case 3 :
kickdir = -1;
break;
case 4 :
if (testBlock.r == 3) {
kickdir = -1;
}
break;
case 5 :
if ((testBlock.r % 2) != 0) {
break;
}
kickdir = -1;
}
testBlock.x = testBlock.x + kickdir;
if ((!Edge(testBlock)) && (!Col(testBlock))) {
} else {
testBlock.x = testBlock.x - (2 * kickdir);
if ((!Edge(testBlock)) && (!Col(testBlock))) {
} else {
testBlock.x = testBlock.x + kickdir;
if (testBlock.id == 0) {
testBlock.x = testBlock.x + (2 * kickdir);
if ((!Edge(testBlock)) && (!Col(testBlock))) {
// unexpected jump
}
testBlock.x = testBlock.x - (2 * kickdir);
}
}
}
}
}
} else if (testBlock.id == 4) {
if (testBlock.r == 2) {
testBlock.y--;
if (!Col(testBlock)) {
testBlock.floorkick--;
// unexpected jump
}
testBlock.y++;
} else if (testBlock.r != 0) {
testBlock.y++;
if (!Col(testBlock)) {
testBlock.floorkick--;
// unexpected jump
}
testBlock.y--;
}
}
}
var kickdir = 1;
switch (testBlock.id) {
case 0 :
if (testBlock.r == 1) {
kickdir = -1;
}
break;
case 1 :
if ((testBlock.r % 2) == 1) {
kickdir = -1;
}
break;
case 3 :
kickdir = -1;
break;
case 4 :
if (testBlock.r == 3) {
kickdir = -1;
}
break;
case 5 :
if ((testBlock.r % 2) != 0) {
break;
}
kickdir = -1;
}
testBlock.x = testBlock.x + kickdir;
if ((!Edge(testBlock)) && (!Col(testBlock))) {
} else {
testBlock.x = testBlock.x - (2 * kickdir);
if ((!Edge(testBlock)) && (!Col(testBlock))) {
} else {
testBlock.x = testBlock.x + kickdir;
if (testBlock.id == 0) {
testBlock.x = testBlock.x + (2 * kickdir);
if ((!Edge(testBlock)) && (!Col(testBlock))) {
// unexpected jump
}
testBlock.x = testBlock.x - (2 * kickdir);
}
}
}
}
if (!Col(testBlock)) {
_parent.sound.playSound("Rotate");
curBlock = testBlock;
curBlock.y++;
if (Col(curBlock)) {
if (!land) {
_parent.sound.playSound("Land");
checkF();
_parent.rec.s = _parent.rec.s + "L";
land = true;
}
} else {
land = false;
}
curBlock.y--;
Guide(curBlock);
vr = 0;
}
}
if (Col(curBlock)) {
curBlock = _parent.newBlock(curBlock.id, curBlock.y, curBlock.x + vx, curBlock.r + tr);
var i = 0;
while (i < 4) {
setProperty("b" + i, _x , 16 * (curBlock.x + curBlock.bx[i]));
setProperty("b" + i, _y , 16 * (curBlock.y + curBlock.by[i]));
i++;
}
doReplay();
GameOver();
break;
}
if (!land) {
ty++;
ty = ty + (vy * fallDelay);
while (ty > fallDelay) {
ty = ty - fallDelay;
tl = 0;
curBlock.y = curBlock.y + 2;
if (Col(curBlock)) {
_parent.sound.playSound("Land");
checkF();
_parent.rec.s = _parent.rec.s + "L";
ty = 0;
land = true;
} else if (vy > 0) {
points = points + Math.max((level + 1) - Math.floor(gameTime / 1800), 0);
}
curBlock.y--;
}
}
if (land) {
tl++;
tl = tl + (2 * vy);
if (tl > affixDelay) {
_parent.sound.playSound("Affix");
checkF();
if (curBlock.y != _parent.rec.y) {
_parent.rec.s = _parent.rec.s + ("Y" + curBlock.y.toString(36));
}
if (curBlock.x != _parent.rec.x) {
_parent.rec.s = _parent.rec.s + ("X" + (curBlock.x + 3).toString(36));
}
if (curBlock.r != _parent.rec.r) {
_parent.rec.s = _parent.rec.s + ("R" + curBlock.r);
}
_parent.rec.s = _parent.rec.s + "B";
i = 0;
while (i < 4) {
x = curBlock.x + curBlock.bx[i];
y = curBlock.y + curBlock.by[i];
F[y][x] = 1;
mc = "b" + i;
eval (mc)._x = 16 * x;
eval (mc)._y = 16 * y;
eval (mc).swapDepths((500 + x) + (y * 10));
eval (mc)._name = (("b" + y) + "-") + x;
mc = (("bg" + y) + "-") + x;
attachMovie("borderBlock", mc, (100 + x) + (y * 10));
setProperty(mc, _x , 16 * x);
setProperty(mc, _y , 16 * y);
removeMovieClip("g" + i);
i++;
}
blockCount++;
points = points + Math.max((level + Min(curBlock)) - Math.floor(gameTime / 1800), 0);
combo = 0;
var i = 0;
while (i < 4) {
y = ((curBlock.y + 3) - i) + combo;
if (Line(y)) {
Kill(y);
combo++;
points = points + (((level + 1) * Math.max((y + blockCount) - Math.floor(gameTime / 180), 0)) * Math.pow(2, combo));
lineCount++;
}
i++;
}
if (blockCount >= (10 * (level + 1))) {
level++;
_parent.sound.playSound("Level");
if (_parent.death) {
falldelay = 0;
blockDelay = 20 - Math.min(Math.floor(level / 5), 19);
affixDelay = 30 - Math.min(Math.floor(level / 10), 20);
} else {
fallDelay = (20 / level) + ((40 / level) / level);
blockDelay = 20 - Math.min(Math.floor(level / 10), 19);
affixDelay = 30 - Math.min(Math.floor(level / 20), 20);
}
}
if (combo > 0) {
_parent.sound.playSound("Clear" + combo);
if (_quality != "LOW") {
attachMovie("Popup", "popup", 2020);
popup._xscale = _xscale;
popup._yscale = _yscale;
popup._x = random(40) + 60;
popup._y = ((16 * curBlock.y) - (16 * combo)) + 48;
popup.value = points;
}
}
score = score + points;
_parent.rec.s = _parent.rec.s + (points.toString(36) + "-");
points = 0;
_parent.display.score.setValue(score);
land = false;
tl = 0;
ty = 0;
tb = blockDelay;
if (_quality != "LOW") {
if (_parent.nextscore >= 0) {
while (score > _parent.scores.scores[_parent.nextscore].score) {
_parent.nextscore--;
}
}
_parent.scores.container._y = -37 * (_parent.nextscore - 4);
}
}
}
var i = 0;
while (i < 4) {
setProperty("b" + i, _x , 16 * (curBlock.x + curBlock.bx[i]));
setProperty("b" + i, _y , 16 * (curBlock.y + curBlock.by[i]));
i++;
}
_parent.display.level.setValue((("" + level) + "-") + (blockCount % 10));
_parent.display.lines.setValue(lineCount);
}
if (tb >= 0) {
doReplay();
gameTime++;
}
}
_parent.display.timer.setValue(strTime(gameTime));
}
}
onClipEvent (keyUp) {
switch (Key.getCode()) {
case _parent.kL1 :
case _parent.kL2 :
fkL++;
break;
case _parent.kR1 :
case _parent.kR2 :
fkR++;
break;
case _parent.kC1 :
case _parent.kC2 :
case _parent.kC3 :
fkC++;
break;
case _parent.kA1 :
case _parent.kA2 :
fkA++;
break;
case _parent.kF1 :
case _parent.kF2 :
case _parent.kF3 :
fkF++;
break;
case _parent.kD1 :
case _parent.kD2 :
fkD++;
}
}
onClipEvent (keyDown) {
switch (Key.getCode()) {
case _parent.kL1 :
case _parent.kL2 :
fkL++;
break;
case _parent.kR1 :
case _parent.kR2 :
fkR++;
break;
case _parent.kC1 :
case _parent.kC2 :
case _parent.kC3 :
fkC++;
break;
case _parent.kA1 :
case _parent.kA2 :
fkA++;
break;
case _parent.kF1 :
case _parent.kF2 :
case _parent.kF3 :
fkF++;
break;
case _parent.kD1 :
case _parent.kD2 :
fkD++;
break;
case _parent.kP1 :
case _parent.kP2 :
if (_alpha < 100) {
break;
}
if (_visible) {
_visible = false;
} else {
_visible = true;
}
}
}
Frame 6
field.tb = -1;
rec.level = field.blockCount;
rec.lines = field.lineCount;
rec.score = field.score;
rec.timer = field.gameTime;
rec.s = rec.s + (((((("E" + field.Fa.toString(36)) + "-") + field.Ft.toString(36)) + "-") + Math.floor(field.Fd).toString(36)) + "-");
display.level.setValue((("" + field.level) + "-") + (field.blockCount % 10));
display.lines.setValue(field.lineCount);
display.score.setValue(field.score);
display.timer.setValue(field.strTime(field.gameTime));
scores.play();
stop();
Instance of Symbol 152 MovieClip in Frame 6
onClipEvent (load) {
if (_parent.rec.playback) {
submit._visible = false;
}
}
Frame 7
stop();
Instance of Symbol 83 MovieClip in Frame 7
onClipEvent (load) {
percent.defaultValue = "";
}
onClipEvent (enterFrame) {
if (_parent.rec != undefined) {
_parent.gotoAndStop(_parent._currentframe + 1);
}
}
Instance of Symbol 81 MovieClip [String] "recVer" in Frame 7
onClipEvent (load) {
defaultValue = "Ver:0.0";
size = 50;
}
Frame 8
stop();
Instance of Symbol 145 MovieClip "field" in Frame 8
onClipEvent (load) {
function pL() {
if (Key.isDown(_parent.kL1) || (Key.isDown(_parent.kL2))) {
return(true);
}
return(false);
}
function pR() {
if (Key.isDown(_parent.kR1) || (Key.isDown(_parent.kR2))) {
return(true);
}
return(false);
}
function pD() {
if (Key.isDown(_parent.kD1) || (Key.isDown(_parent.kD2))) {
return(true);
}
return(false);
}
function Gen(block, nextBlock) {
if (block == null) {
block = _parent.newBlock(random(7), 0, 3, 0);
}
if (nextBlock) {
if (_parent.shownext) {
var i = 0;
while (i < 4) {
var mc = ("b" + (4 + i));
attachMovie("Block", mc, 1508 + i);
eval (mc).colour = block.colour;
eval (mc).shine = block.shine;
setProperty(mc, _x , 16 * (block.x + block.bx[i]));
setProperty(mc, _y , (16 * (block.y + block.by[i])) - 40);
i++;
}
}
} else {
var i = 0;
while (i < 4) {
var mc = ("b" + i);
attachMovie("Block", mc, 1504 + i);
eval (mc).colour = block.colour;
eval (mc).shine = block.shine;
setProperty(mc, _x , 16 * (block.x + block.bx[i]));
setProperty(mc, _y , 16 * (block.y + block.by[i]));
mc = "g" + i;
i++;
}
if (_parent.guide && (!_parent.death)) {
var i = 0;
while (i < 4) {
var mc = ("g" + i);
attachMovie("Block", mc, 1500 + i);
eval (mc).colour = block.colour;
eval (mc).shine = block.shine;
setProperty(mc, _alpha , 12.5);
i++;
}
Guide(block);
}
}
return(block);
}
function Move(block) {
var _local1 = 0;
while (_local1 < 4) {
var _local3 = "b" + _local1;
setProperty(_local3, _x , 16 * (block.x + block.bx[_local1]));
setProperty(_local3, _y , 16 * (block.y + block.by[_local1]));
_local1++;
}
Guide(block);
}
function Line(id) {
if ((id < 0) || (id > 20)) {
return(false);
}
var _local1 = 0;
while (_local1 < 10) {
if (F[id][_local1] == 0) {
return(false);
}
_local1++;
}
return(true);
}
function Kill(id) {
if (id > 20) {
return(undefined);
}
var i = 0;
while (i < 10) {
F[id][i] = 0;
var mc = ((("b" + id) + "-") + i);
eval (mc).swapDepths((1000 + i) + (10 * id));
eval (mc).gotoAndPlay(2);
setProperty(mc, _name , "_" + mc);
removeMovieClip((("bg" + id) + "-") + i);
i++;
}
var i = id;
while (i > 0) {
var j = 0;
while (j < 10) {
F[i][j] = F[i - 1][j];
if (F[i][j] != 0) {
var mc = ((("b" + (i - 1)) + "-") + j);
eval (mc)._y = eval (mc)._y + 16;
eval (mc).swapDepths((500 + j) + (i * 10));
setProperty(mc, _name , (("b" + i) + "-") + j);
eval ((mc = (("bg" + (i - 1)) + "-") + j))._y = eval ((mc = (("bg" + (i - 1)) + "-") + j))._y + 16;
eval (mc).swapDepths((100 + j) + (i * 10));
setProperty(mc, _name , (("bg" + i) + "-") + j);
}
j++;
}
i--;
}
var i = 0;
while (i < 10) {
F[0][i] = 0;
i++;
}
}
function setBorder(bool) {
var _local3 = 0;
while (_local3 < 21) {
var _local1 = 0;
while (_local1 < 10) {
if (F[_local3][_local1] != 0) {
var _local2 = (("bg" + _local3) + "-") + _local1;
if (bool) {
attachMovie("borderBlock", _local2, (100 + _local1) + (_local3 * 10));
setProperty(_local2, _x , 16 * _local1);
setProperty(_local2, _y , 16 * _local3);
} else {
removeMovieClip(_local2);
}
}
_local1++;
}
_local3++;
}
}
function Col(block) {
var _local1 = 0;
while (_local1 < 4) {
if (F[block.y + block.by[_local1]][block.x + block.bx[_local1]] != 0) {
return(true);
}
_local1++;
}
return(false);
}
function Guide(block) {
if (((block == null) || (!_parent.guide)) || (_parent.death)) {
return(undefined);
}
var _local5 = block.y;
while (!Col(block)) {
block.y++;
}
block.y--;
var _local2 = 0;
while (_local2 < 4) {
var _local4 = "g" + _local2;
setProperty(_local4, _x , 16 * (block.x + block.bx[_local2]));
setProperty(_local4, _y , 16 * (block.y + block.by[_local2]));
_local2++;
}
block.y = _local5;
}
function strTime(n) {
var _local1 = Math.round(((n % 60) * 5) / 3);
n = Math.floor(n / 60);
if (_local1 < 10) {
_local1 = "0" + _local1;
}
_local1 = ((n % 60) + "\"") + _local1;
n = Math.floor(n / 60);
if (_local1.length < 5) {
_local1 = "0" + _local1;
}
_local1 = ((n % 60) + "'") + _local1;
if (n >= 60) {
if (_local1.length < 8) {
_local1 = "0" + _local1;
}
_local1 = (Math.floor(n / 60) + ":") + _local1.substr(0, 5);
}
return(_local1);
}
function GameOver() {
removeMovieClip("go");
_parent.sound.playMusic("GameOver", 1);
_alpha = 25;
tb = -1;
_parent.gotoAndStop("ReplayOver");
}
function nextChar() {
var _local2 = _parent.rec.s.substr(_parent.rec.offset, 1);
_parent.rec.offset++;
return(_local2);
}
function alphaDecimal(str) {
var _local3 = 1;
var _local5 = 0;
var _local2 = str.length - 1;
while (_local2 >= 0) {
var _local1 = str.charCodeAt(_local2);
if ((_local1 >= 48) && (_local1 <= 57)) {
_local1 = _local1 - 48;
} else if ((_local1 >= 65) && (_local1 <= 90)) {
_local1 = _local1 - 55;
} else if ((_local1 >= 97) && (_local1 <= 122)) {
_local1 = _local1 - 87;
} else {
_local1 = 0;
}
_local5 = _local5 + (_local3 * _local1);
_local3 = _local3 * 36;
_local2--;
}
return(_local5);
}
var tb = -1;
var a = 0;
var t = getTimer();
var fps = 60;
_parent.rec.offset = 0;
var gameAction = "";
var p = 0;
var unpaused = true;
F = new Array(22);
var i = 0;
while (i < 21) {
F[i] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
i++;
}
F[21] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
score = 0;
gameTime = 0;
blockCount = 0;
lineCount = 0;
_parent.display.level.reset();
_parent.display.lines.reset();
_parent.display.score.reset();
_parent.display.timer.reset();
if (_parent.flip) {
_y = 344;
_yscale = -100;
_parent.frame._y = 344;
_parent.frame._yscale = -100;
_parent.author._y = 333;
_parent.display._y = 40;
_parent.endgame._y = 345;
_parent.tetris._y = 348;
_parent.qual._y = 25;
_parent.sound._y = 9;
_parent.framerate._y = 380;
}
if (_parent.mirror) {
_x = 168;
_xscale = -100;
_parent.frame._x = 168;
_parent.frame._xscale = -100;
}
var c = nextChar();
if (c == "V") {
_parent.recVer.setValue((("Ver:" + nextChar()) + ".") + nextChar());
c = nextChar();
} else {
_parent.recVer.setValue("Ver:0.1");
}
if ((_parent.recVer.currentValue == "Ver:0.1") || (_parent.recVer.currentValue == "Ver:0.2")) {
_parent.BlockData[3][0][0].x = 1;
_parent.BlockData[3][0][1].x = 2;
_parent.BlockData[3][0][2].x = 2;
_parent.BlockData[3][0][3].x = 3;
}
nextBlock = Gen(_parent.newBlock(Number(c), 0, 3, 0), true);
curBlock = _parent.newBlock(nextBlock.id, 0, 3, 0);
_parent.sound.playMusic("Intro", 1);
attachMovie("321", "go", 2000);
go._x = 80;
go._y = 160;
go._xscale = _xscale;
go._yscale = _yscale;
go.t0 = getTimer();
go.onEnterFrame = function () {
var _local2 = getTimer() - this.t0;
if (this._currentframe < ((_local2 * 3) / 50)) {
if (this._currentframe < 271) {
this.gotoAndPlay(Math.min(Math.ceil((_local2 * 3) / 50), 271));
} else {
this.gotoAndPlay(Math.min(Math.ceil((_local2 * 3) / 50), 376));
}
}
};
}
onClipEvent (enterFrame) {
ct = Math.max(1, (3 * ((dt = (-t) + ((t = getTimer()))))) / 50);
_parent.framerate.framerate.setValue(Math.round((fps = ((59 * fps) + (1000 / dt)) / 60)));
if (unpaused && (tb > 0)) {
if (pR()) {
ct = ct * 8;
}
if (pD()) {
ct = ct * 2;
}
if (pL()) {
ct = ct / 2;
}
a = a + ct;
while (a > 0) {
a--;
if (p > 1) {
gameAction = "F";
p--;
} else {
gameAction = "";
}
while ((_parent.rec.offset < _parent.rec.s.length) && (gameAction != "F")) {
gameAction = nextChar();
switch (gameAction) {
case "B" :
_parent.sound.playSound("Affix");
var s = "";
c = nextChar();
while (c != "-") {
s = s + c;
c = nextChar();
}
var points = alphaDecimal(s);
var i = 0;
while (i < 4) {
x = curBlock.x + curBlock.bx[i];
y = curBlock.y + curBlock.by[i];
F[y][x] = 1;
var mc = ("b" + i);
eval (mc).swapDepths((500 + x) + (y * 10));
eval (mc)._name = (("b" + y) + "-") + x;
mc = (("bg" + y) + "-") + x;
attachMovie("borderBlock", mc, (100 + x) + (y * 10));
setProperty(mc, _x , 16 * x);
setProperty(mc, _y , 16 * y);
removeMovieClip("g" + i);
i++;
}
blockCount++;
var combo = 0;
var i = 0;
while (i < 4) {
var y = (((curBlock.y + 3) - i) + combo);
if (Line(y)) {
Kill(y);
combo++;
lineCount++;
}
i++;
}
if (combo > 0) {
_parent.sound.playSound("Clear" + combo);
if (_quality != "LOW") {
attachMovie("Popup", "popup", 2020);
popup._xscale = _xscale;
popup._yscale = _yscale;
popup._x = random(40) + 60;
popup._y = ((16 * curBlock.y) - (16 * combo)) + 48;
popup.value = points;
}
}
score = score + points;
if ((blockCount % 10) == 0) {
_parent.sound.playSound("Level");
}
_parent.display.level.setValue((Math.floor(blockCount / 10) + "-") + (blockCount % 10));
_parent.display.lines.setValue(lineCount);
_parent.display.score.setValue(score);
break;
case "N" :
nextBlock = _parent.newBlock(Number(nextChar()), 0, 3, 0);
Gen(nextBlock, true);
break;
case "I" :
curBlock = _parent.newBlock(Number(nextChar()), 0, 3, 0);
Gen(curBlock);
break;
case "X" :
curBlock.x = alphaDecimal(nextChar()) - 3;
Move(curBlock);
break;
case "Y" :
curBlock.y = alphaDecimal(nextChar());
Move(curBlock);
break;
case "R" :
_parent.sound.playSound("Rotate");
curBlock = _parent.newBlock(curBlock.id, curBlock.y, curBlock.x, Number(nextChar()));
Move(curBlock);
break;
case "L" :
_parent.sound.playSound("Land");
break;
case "P" :
var s = "";
var c = nextChar();
while (c != "-") {
s = s + c;
c = nextChar();
}
p = alphaDecimal(s);
gameAction = "F";
break;
case "E" :
_parent.rec.offset = _parent.rec.s.length;
}
}
if (_parent.rec.offset >= _parent.rec.s.length) {
GameOver();
}
gameTime++;
}
_parent.display.timer.setValue(strTime(gameTime));
}
}
onClipEvent (keyDown) {
switch (Key.getCode()) {
case _parent.kP1 :
case _parent.kP2 :
if (_alpha < 100) {
break;
}
if (unpaused) {
unpaused = false;
} else {
unpaused = true;
}
}
}
Frame 9
BlockData[3][0][0].x = 0;
BlockData[3][0][1].x = 1;
BlockData[3][0][2].x = 1;
BlockData[3][0][3].x = 2;
field.tb = -1;
if (!rec.playback) {
field.blockCount = rec.level;
field.lineCount = rec.lines;
field.score = rec.score;
field.gameTime = rec.timer;
}
display.level.setValue((("" + Math.floor(field.blockCount / 10)) + "-") + (field.blockCount % 10));
display.lines.setValue(field.lineCount);
display.score.setValue(field.score);
display.timer.setValue(field.strTime(field.gameTime));
stop();
Instance of Symbol 152 MovieClip in Frame 9
onClipEvent (load) {
if (_parent.rec.playback) {
submit._visible = false;
}
}
Symbol 76 MovieClip [Popup] Frame 1
var n = Math.min(9999999999, value);
var s = n.toString(10);
var x = (16 * (s.length - 1));
var i = 0;
while (i < s.length) {
var mc = ("n" + i);
attachMovie("Character", mc, 2010 + i);
setProperty(mc, _y , -16);
setProperty(mc, _x , x);
eval (mc).gotoAndStop((n % 10) + 48);
n = Math.floor(n / 10);
x = x - 16;
i++;
}
vx = (Math.random() * (_x - 72)) / 36;
vy = Math.random() * (((_y - 1600) / 160) + Math.abs(vx));
Symbol 76 MovieClip [Popup] Frame 2
_x = (_x + vx);
_y = (_y + vy);
if (_quality != "MEDIUM") {
_alpha = (_alpha - 3);
}
if (((_alpha <= 0) || (_quality == "LOW")) || (_y > 352)) {
this.removeMovieClip();
}
vy = vy + 0.5;
Symbol 76 MovieClip [Popup] Frame 3
gotoAndPlay (2);
Symbol 79 Button
on (press) {
if ((_parent._parent._parent._currentframe == 3) || (_parent._parent._parent.rec.playback == true)) {
_parent._parent._parent.rec = undefined;
var my_lv = new LoadVars();
my_lv.onLoad = function (success) {
if (success) {
_parent._parent._parent.rec = new Object();
_parent._parent._parent.rec.s = this.replaydata;
_parent._parent._parent.rec.playback = true;
}
};
my_lv.load((phpurl + "?action=replay&id=") + id);
_parent._parent._parent.gotoAndStop("Replay");
}
}
Symbol 81 MovieClip [String] Frame 1
function reset() {
len = 0;
var _local1 = 0;
while (_local1 < 16) {
removeMovieClip("n" + _local1);
_local1++;
}
setString(defaultValue);
}
function setValue(n) {
if (!isNaN(n)) {
n = Math.min(1E16, n);
}
s = n.toString();
s = s.substr(0, 16);
setString(s);
}
function setString(s) {
currentValue = s;
var i = 0;
while (i < Math.min(len, s.length)) {
eval ("n" + i).gotoAndStop(s.charCodeAt(i));
i++;
}
var i = len;
while (i < s.length) {
var mc = ("n" + i);
attachMovie("Character", mc, 2000 + i);
if (align == "right") {
setProperty(mc, _x , -16);
var j = 0;
while (j < i) {
eval ("n" + j)._x = eval ("n" + j)._x - 16;
j++;
}
} else if (align == "center") {
setProperty(mc, _x , (8 * i) - 8);
var j = 0;
while (j < i) {
eval ("n" + j)._x = eval ("n" + j)._x - 8;
j++;
}
} else {
setProperty(mc, _x , 16 * i);
}
setProperty(mc, _xscale , 100);
setProperty(mc, _yscale , 100);
eval (mc).gotoAndStop(s.charCodeAt(i));
i++;
}
var i = s.length;
while (i < len) {
removeMovieClip("n" + i);
i++;
}
len = s.length;
_xscale = Math.min((size * maxwidth) / len, size);
_yscale = size;
}
if (defaultValue == undefined) {
defaultValue = "0";
}
if (maxwidth == undefined) {
maxwidth = 8;
}
if (size <= 0) {
size = 100;
}
reset();
Symbol 87 MovieClip [321] Frame 271
if (_parent._parent.death) {
_parent._parent.sound.playMusic("Korobeyniki2");
}
_parent.tb = 1;
Symbol 87 MovieClip [321] Frame 376
if (!_parent._parent.death) {
_parent._parent.sound.playMusic("Korobeyniki");
}
Symbol 87 MovieClip [321] Frame 377
removeMovieClip(this);
Symbol 88 MovieClip [Block] Frame 1
if (isNaN(light)) {
light = 0;
}
if (isNaN(shine)) {
shine = 0;
}
shine = Math.min(shine + light, 255);
b = colour % 256;
g = Math.floor(colour / 256) % 256;
r = Math.floor(colour / 65536) % 256;
var c1 = (((65536 * Math.floor(((r * (255 - shine)) / 255) + shine, 255)) + (256 * Math.floor(((g * (255 - shine)) / 255) + shine, 255))) + Math.floor(((b * (255 - shine)) / 255) + shine, 255));
var c2 = (((65536 * Math.floor((r / 2) + light)) + (256 * Math.floor((g / 2) + light))) + Math.floor((b / 2) + light));
var c3 = (((65536 * Math.floor((r / 4) + light)) + (256 * Math.floor((g / 4) + light))) + Math.floor((b / 4) + light));
lineStyle();
beginGradientFill("linear", [c1, c2], [100, 100], [0, 255], {matrixType:"box", x:0, y:0, w:16, h:16, r:(Math.PI/2)});
moveTo(0, 0);
lineTo(15, 0);
lineTo(15, 15);
lineTo(0, 15);
lineTo(0, 0);
endFill();
beginFill(c3, 100);
moveTo(-1, -1);
lineTo(16, -1);
lineTo(16, 16);
lineTo(-1, 16);
lineTo(-1, -1);
lineTo(0, 0);
lineTo(0, 15);
lineTo(15, 15);
lineTo(15, 0);
lineTo(0, 0);
endFill();
stop();
Symbol 88 MovieClip [Block] Frame 2
vx = (Math.random() * (_x - 72)) / 36;
vy = Math.random() * (((_y - 1600) / 160) + Math.abs(vx));
gotoAndPlay (3);
Symbol 88 MovieClip [Block] Frame 3
_x = (_x + vx);
_y = (_y + vy);
if (_quality != "MEDIUM") {
_alpha = (_alpha - 3);
}
vy = vy + 0.5;
if (((_alpha <= 0) || (_quality == "LOW")) || (_y > 352)) {
this.removeMovieClip();
}
Symbol 88 MovieClip [Block] Frame 4
gotoAndPlay (3);
Symbol 89 MovieClip [borderBlock] Frame 1
lineStyle();
beginFill(12632256, 100);
moveTo(-2, -2);
lineTo(17, -2);
lineTo(17, 17);
lineTo(-2, 17);
lineTo(-2, -2);
endFill();
Symbol 91 Button
on (release) {
_root.sound.playSound("Rotate");
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
} else if (_quality == "LOW") {
_quality = "BEST";
} else {
_quality = "HIGH";
}
}
Symbol 92 MovieClip Frame 1
if (_quality != "HIGH") {
gotoAndPlay (3);
}
Symbol 92 MovieClip Frame 2
gotoAndPlay (1);
Symbol 92 MovieClip Frame 3
if (_quality != "MEDIUM") {
gotoAndPlay (5);
}
Symbol 92 MovieClip Frame 4
gotoAndPlay (3);
Symbol 92 MovieClip Frame 5
if (_quality != "LOW") {
gotoAndPlay (7);
}
Symbol 92 MovieClip Frame 6
gotoAndPlay (5);
Symbol 92 MovieClip Frame 7
if (((_quality != "HIGH") && (_quality != "MEDIUM")) && (_quality != "LOW")) {
_quality = "HIGH";
}
gotoAndPlay (1);
Instance of Symbol 81 MovieClip [String] "score" in Symbol 94 MovieClip Frame 1
onClipEvent (load) {
align = "center";
}
Instance of Symbol 81 MovieClip [String] "lines" in Symbol 94 MovieClip Frame 1
onClipEvent (load) {
align = "center";
}
Instance of Symbol 81 MovieClip [String] "level" in Symbol 94 MovieClip Frame 1
onClipEvent (load) {
defaultValue = "0-0";
align = "center";
}
Instance of Symbol 81 MovieClip [String] "timer" in Symbol 94 MovieClip Frame 1
onClipEvent (load) {
defaultValue = "0'00\"00";
align = "center";
}
Symbol 95 Button
on (release) {
highscores();
}
Symbol 96 Button
on (release) {
getURL ("http://www.gdward.plus.com/site/", "_blank");
}
Instance of Symbol 81 MovieClip [String] "framerate" in Symbol 97 MovieClip Frame 1
onClipEvent (load) {
defaultValue = "60";
}
Symbol 98 Button
on (release) {
toggleSound();
}
Symbol 99 MovieClip Frame 1
if (!eval (setting)) {
gotoAndPlay (3);
}
Symbol 99 MovieClip Frame 2
gotoAndPlay (1);
Symbol 99 MovieClip Frame 3
if (eval (setting)) {
gotoAndPlay (1);
}
Symbol 99 MovieClip Frame 4
gotoAndPlay (3);
Symbol 101 Button
on (press) {
slider1._x = _xmouse;
startDrag ("slider1", false, 0, slider1._y, 100, slider1._y);
}
on (release, releaseOutside) {
stopDrag();
}
Symbol 102 Button
on (press) {
startDrag ("slider1", false, 0, slider1._y, 100, slider1._y);
}
on (release, releaseOutside) {
stopDrag();
}
Symbol 103 Button
on (press) {
startDrag ("slider2", false, 0, slider2._y, 100, slider2._y);
}
on (release, releaseOutside) {
stopDrag();
}
Symbol 116 MovieClip Frame 1
stop();
Instance of Symbol 99 MovieClip in Symbol 116 MovieClip Frame 1
onClipEvent (load) {
setting = "_parent._parent.noisy";
}
Symbol 118 Button
on (release) {
death = !death;
scores.loadScores();
}
Symbol 119 Button
on (release) {
scores.gotoAndStop(2);
nextscore = scores.scores.length - 1;
if (_quality != "LOW") {
scores.container._y = -37 * (nextscore - 4);
}
gotoAndStop ("Game");
}
Symbol 120 Button
on (release) {
shownext = !shownext;
scores.loadScores();
}
Symbol 121 Button
on (release) {
mirror = !mirror;
scores.loadScores();
}
Symbol 122 Button
on (release) {
flip = !flip;
scores.loadScores();
}
Symbol 129 Button
on (press) {
play();
}
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 2
x = 8;
while (x < 256) {
if (Key.isDown(x)) {
Set("_parent." + _parent.t, x);
_parent.gotoAndStop(x);
gotoAndStop (1);
}
x++;
}
Symbol 131 MovieClip Frame 3
gotoAndPlay (2);
Symbol 138 MovieClip Frame 1
if (eval (t) > 0) {
k = eval (t);
} else {
Set(t, k);
}
gotoAndStop(k);
Symbol 139 MovieClip Frame 1
tellTarget ("_parent") {
controls = 1;
pL1 = 37;
pL2 = 100;
pR1 = 39;
pR2 = 102;
pD1 = 40;
pD2 = 98;
pF1 = 32;
pF2 = 38;
pRC1 = 65;
pRC2 = 88;
pRA1 = 83;
pRA2 = 90;
};
stop();
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kL1";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kL2";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kR1";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kR2";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kD1";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kD2";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kA1";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kA2";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kC1";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kC2";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kC3";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kF1";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kF2";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kF3";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kP1";
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
t = "_parent._parent.kP2";
}
Symbol 140 Button
on (release) {
guide = !guide;
}
Symbol 141 Button
on (press) {
_parent.scores.showall = _parent.scores.showall * -1;
_parent.scores.loadScores();
}
Symbol 142 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 1
function loadScores() {
container.removeMovieClip();
xmlScores = new XML();
xmlScores.ignoreWhite = true;
xmlScores.onLoad = function (success) {
parseXML();
};
var _local2 = "?action=getxml&showall=" + showall;
if (_parent.death) {
_local2 = _local2 + "&death=1";
}
if (_parent.mirror) {
_local2 = _local2 + "&mirror=1";
}
if (_parent.flip) {
_local2 = _local2 + "&flip=1";
}
if (!_parent.shownext) {
_local2 = _local2 + "&hidenext=1";
}
xmlScores.load(phpurl + _local2);
if (showall > 0) {
_parent.scorestitle.gotoAndStop(1);
} else {
_parent.scorestitle.gotoAndStop(2);
}
gotoAndStop (2);
}
function parseXML() {
if (xmlScores.firstChild.nodeName.toLowerCase() == "scores") {
var _local10 = xmlScores.firstChild;
scores = new Array();
var _local9 = 0;
while (_local9 < _local10.childNodes.length) {
if (_local10.childNodes[_local9].nodeName.toLowerCase() == "entry") {
n = scores.length;
scores[n] = new Object();
var _local8 = _local10.childNodes[_local9];
var _local3 = 0;
while (_local3 < _local8.childNodes.length) {
var _local5 = _local8.childNodes[_local3];
var _local2 = _local5.nodeName.toLowerCase();
var _local1 = _local5.firstChild.nodeValue;
if (_local2 == "id") {
scores[n].id = _local1;
} else if (_local2 == "name") {
scores[n].name = _local1;
} else if (_local2 == "lines") {
scores[n].lines = _local1;
} else if (_local2 == "level") {
scores[n].level = (Math.floor(_local1 / 10) + "-") + (_local1 % 10);
} else if (_local2 == "score") {
scores[n].score = _local1;
} else if (_local2 == "time") {
if (_local1 >= 216000) {
scores[n].time = Math.floor(_local1 / 216000) + ":";
}
var _local6 = Math.floor(_local1 / 3600) % 60;
var _local4 = Math.floor(_local1 / 60) % 60;
var _local7 = Math.round(((_local1 % 60) * 5) / 3);
if (_local6 < 10) {
scores[n].time = scores[n].time + "0";
}
scores[n].time = scores[n].time + (_local6 + "'");
if (_local4 < 10) {
scores[n].time = scores[n].time + "0";
}
scores[n].time = scores[n].time + (_local4 + "'");
if (_local7 < 10) {
scores[n].time = scores[n].time + "0";
}
scores[n].time = scores[n].time + _local7;
}
_local3++;
}
}
_local9++;
}
}
showScores();
}
function showScores() {
_parent.nextscore = scores.length - 1;
if ((_parent._currentframe == 5) && (_quality != "LOW")) {
container._y = -37 * (_parent.nextscore - 4);
}
container = this.createEmptyMovieClip("container", 0);
container.i = 0;
container.y = 0;
container.wait = 0;
container.onEnterFrame = function () {
switch (this.wait) {
case 0 :
this.wait = 0;
var _local2 = this.attachMovie("String", ("score" + this.i) + "pos", (10 * this.i) + 1);
_local2.size = 50;
_local2._x = 36;
_local2._y = this.y;
_local2.defaultValue = (this.i + 1) + ".";
_local2.align = "right";
_local2 = this.attachMovie("String", ("score" + this.i) + "name", (10 * this.i) + 2);
_local2.size = 50;
_local2._x = 36;
_local2._y = this.y;
_local2.defaultValue = scores[this.i].name;
_local2.maxwidth = 13;
this.wait = 1;
break;
case 1 :
_local2 = this.attachMovie("String", ("score" + this.i) + "score", (10 * this.i) + 3);
_local2.size = 50;
_local2._x = 140;
_local2._y = this.y + 15;
_local2.defaultValue = scores[this.i].score;
_local2.align = "right";
_local2.maxwidth = 16;
_local2 = this.attachMovie("ReplayButton", ("score" + this.i) + "replay", (10 * this.i) + 4);
_local2._y = this.y;
_local2.id = scores[this.i].id;
this.y = this.y + 37;
this.i++;
this.wait = 0;
if (this.i < scores.length) {
break;
}
this.onEnterFrame = null;
}
};
wait = 180;
gotoAndPlay (3);
}
var xmlScores;
loadScores();
vy = 0;
Symbol 143 MovieClip Frame 2
wait = 180;
Symbol 143 MovieClip Frame 3
if (scores.length > 10) {
if (_parent._currentframe == 5) {
gotoAndStop (2);
} else if ((((_xmouse >= 0) && (_ymouse >= 0)) && (_xmouse <= 150)) && (_ymouse <= 370)) {
wait = 180;
container._y = container._y - Math.round((((_ymouse - 185) * (_ymouse - 185)) * (_ymouse - 185)) / 316581);
if (container._y < (360 - container.y)) {
container._y = 360 - container.y;
}
if (container._y > 0) {
container._y = 0;
}
} else if (wait > 0) {
wait--;
} else {
container._y--;
if (container._y == 0) {
wait = 180;
}
if ((container._y + 10) < (-container.y)) {
container._y = container._y + (container.y + 420);
}
if (container._y > 410) {
container._y = container._y - (container.y + 420);
}
}
}
Symbol 143 MovieClip Frame 4
gotoAndPlay (3);
Symbol 146 Button
on (release) {
field.GameOver();
}
Symbol 147 Button
on (release) {
_parent.gotoAndStop("Menu");
}
Symbol 148 Button
on (release) {
_parent.gotoAndStop("Replay");
}
Symbol 149 Button
on (release) {
function pad(str, len) {
while (str.length < len) {
str = "0" + str;
}
return(str);
}
function encode(score, level, lines, timer, gamemode) {
var _local5 = new Number(37);
var _local4 = new Number(111);
var _local3 = new Number(193);
var _local2 = new Number(241);
var _local9 = 0;
while (_local9 < level) {
_local5 = (((((_local4 - score) + level) + lines) + timer) + gamemode) % 256;
if (_local5 < 0) {
_local5 = _local5 + 256;
}
_local4 = (((((_local3 + score) - level) + lines) + timer) + gamemode) % 256;
if (_local4 < 0) {
_local4 = _local4 + 256;
}
_local3 = (((((_local2 + score) + level) - lines) + timer) + gamemode) % 256;
if (_local3 < 0) {
_local3 = _local3 + 256;
}
_local2 = (((((_local5 + score) + level) + lines) - timer) + gamemode) % 256;
if (_local2 < 0) {
_local2 = _local2 + 256;
}
_local9++;
}
return(((_local5.toString(16) + _local4.toString(16)) + _local3.toString(16)) + _local2.toString(16));
}
if ((_parent.rec.playback != true) && (_parent.playerName.length > 0)) {
_visible = false;
error = "";
_parent.rec.playback = true;
submit._visible = false;
myData = new LoadVars();
myData.action = "submit";
myData.player = _parent.playerName;
myData.level = _parent.field.blockCount;
myData.lines = _parent.field.lineCount;
myData.score = _parent.field.score;
myData.timer = _parent.field.gameTime;
if (_parent.death) {
myData.death = 1;
} else {
myData.death = 0;
}
if (_parent.mirror) {
myData.mirror = 1;
} else {
myData.mirror = 0;
}
if (_parent.flip) {
myData.flip = 1;
} else {
myData.flip = 0;
}
if (_parent.shownext) {
myData.hidenext = 0;
} else {
myData.hidenext = 1;
}
myData.gamedata = encode(myData.score, myData.level, myData.lines, myData.timer, ((myData.death + (myData.mirror * 2)) + (myData.flip * 4)) + (myData.hidenext * 8));
myData.demo = _parent.rec.s;
myData.onData = function (src) {
myData.decode(src);
if (src.length > 0) {
if (myData.error != -1) {
error = myData.error + " Score not sent.";
_parent.rec.playback = false;
submit._visible = true;
} else {
error = "Score sent.";
player._visible = false;
_parent.highscores();
}
} else {
error = "Unable to connect. Score not sent.";
_parent.rec.playback = false;
submit._visible = true;
}
_visible = true;
};
myData.sendAndLoad(phpurl, myData, "POST");
}
}
Instance of Symbol 81 MovieClip [String] "player" in Symbol 152 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent.rec.playback) {
_parent.submit._visible = false;
_visible = false;
}
var t = 100;
if (_parent._parent.playerName.length > 0) {
defaultValue = _parent._parent.playerName;
} else {
_parent._parent.playerName = "";
defaultValue = "Enter Your Name.";
}
}
onClipEvent (enterFrame) {
if (t > 0) {
t--;
}
if (t >= 0) {
if (Key.isDown(8)) {
t = -15;
setValue(_parent._parent.playerName.substr(0, _parent._parent.playerName.length - 1));
_parent._parent.playerName = currentValue;
}
} else {
t++;
if (!Key.isDown(8)) {
t = 0;
}
}
}
onClipEvent (keyDown) {
if (t <= 0) {
var a = Key.getAscii();
if ((a >= 32) && (a < 127)) {
setValue(_parent._parent.playerName + String.fromCharCode(a));
_parent._parent.playerName = currentValue;
}
}
}