Frame 1
function b2i(s) {
var _local3 = s;
var _local2 = 1;
var x = 0;
var _local1 = 0;
while (_local1 < _local3.length) {
if (_local3.charCodeAt(_local1) == 49) {
x = x | _local2;
}
_local2 = _local2 << 1;
_local1++;
}
return(x);
}
function m_identity() {
return([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
}
function m_rotate(m, r, t) {
var _local2 = m;
var x = r[0];
var y = r[1];
var z = r[2];
var s = Math.sin(t);
var c = Math.cos(t);
var c1 = (1 - c);
var t = Math.sqrt(((x * x) + (y * y)) + (z * z));
var sx = (s * ((x = x / t)));
var sy = (s * ((y = y / t)));
var sz = (s * ((z = z / t)));
var c1xy = ((c1 * x) * y);
var c1yz = ((c1 * y) * z);
var c1zx = ((c1 * z) * x);
var n0 = (((c1 * x) * x) + c);
var n4 = (c1xy - sz);
var n8 = (c1zx + sy);
var n1 = (c1xy + sz);
var n5 = (((c1 * y) * y) + c);
var n9 = (c1yz - sx);
var n2 = (c1zx - sy);
var n6 = (c1yz + sx);
var n10 = (((c1 * z) * z) + c);
var _local1;
var u;
var _local3;
var w;
_local1 = 0;
while (_local1 < 3) {
u = _local2[_local1];
_local3 = _local2[_local1 + 4];
w = _local2[_local1 + 8];
_local2[_local1] = ((u * n0) + (_local3 * n1)) + (w * n2);
_local2[_local1 + 4] = ((u * n4) + (_local3 * n5)) + (w * n6);
_local2[_local1 + 8] = ((u * n8) + (_local3 * n9)) + (w * n10);
_local1++;
}
}
function m_mul_m(m, n, r) {
var _local2 = m;
var _local3 = n;
var n0 = _local3[0];
var n1 = _local3[1];
var n2 = _local3[2];
var n4 = _local3[4];
var n5 = _local3[5];
var n6 = _local3[6];
var n8 = _local3[8];
var n9 = _local3[9];
var n10 = _local3[10];
var _local1 = 3;
var u;
var v;
var w;
do {
_local1--;
_local2[_local1] = ((((u = _local2[_local1])) * n0) + (((v = _local2[_local1 + 4])) * n1)) + (((w = _local2[_local1 + 8])) * n2);
_local2[_local1 + 4] = ((u * n4) + (v * n5)) + (w * n6);
_local2[_local1 + 8] = ((u * n8) + (v * n9)) + (w * n10);
if (r) {
_local2[_local1 + 12] = _local2[_local1 + 12] + (((u * _local3[12]) + (v * _local3[13])) + (w * _local3[14]));
}
} while (_local1);
}
function m_mul_pv(v, m, p, r) {
var i = p.length;
var _local2 = i * 3;
var m0 = m[0];
var m1 = m[1];
var m2 = m[2];
var m4 = m[4];
var m5 = m[5];
var m6 = m[6];
var m8 = m[8];
var m9 = m[9];
var m10 = m[10];
var m12 = (m[12] * r);
var m13 = (m[13] * r);
var m14 = (m[14] * r);
var _local1;
var x;
var y;
var _local3;
do {
_local1 = p[--i];
_local3 = _local1 >> 20;
v[_local2 - 1] = (((m2 * ((x = (_local1 & 1023) - 512))) + (m6 * ((y = ((_local1 >> 10) & 1023) - 512)))) + (m10 * _local3)) + m14;
v[_local2 - 2] = (((m1 * x) + (m5 * y)) + (m9 * _local3)) + m13;
_local2 = _local2 - 3;
v[_local2] = (((m0 * x) + (m4 * y)) + (m8 * _local3)) + m12;
} while (i);
}
function m_transpose3(m) {
var _local1 = m;
t = _local1[1];
_local1[1] = _local1[4];
_local1[4] = t;
t = _local1[2];
_local1[2] = _local1[8];
_local1[8] = t;
t = _local1[6];
_local1[6] = _local1[9];
_local1[9] = t;
}
function v_normalize(v) {
var _local1 = v;
var x = _local1[0];
var y = _local1[1];
var _local3 = _local1[2];
var _local2 = Math.sqrt(((x * x) + (y * y)) + (_local3 * _local3));
_local1[0] = x / _local2;
_local1[1] = y / _local2;
_local1[2] = _local3 / _local2;
}
function m_project_pv(s, m, p, z) {
var m0 = m[0];
var m1 = m[1];
var m2 = m[2];
var m4 = m[4];
var m5 = m[5];
var m6 = m[6];
var m8 = m[8];
var m9 = m[9];
var m10 = m[10];
var m12 = m[12];
var m13 = m[13];
var m14 = m[14];
var i = p.length;
var j = (i * 2);
var _local1;
var _local3;
var _local2;
var w;
do {
_local1 = p[--i];
_local3 = (_local1 & 1023) - 512;
_local2 = ((_local1 >> 10) & 1023) - 512;
_local1 = z / ((((m2 * _local3) + (m6 * _local2)) + (m10 * ((w = _local1 >> 20)))) + m14);
s[j - 1] = (-((((m1 * _local3) + (m5 * _local2)) + (m9 * w)) + m13)) * _local1;
s[(j = j - 2)] = ((((m0 * _local3) + (m4 * _local2)) + (m8 * w)) + m12) * _local1;
} while (i);
}
function D3Tris(pit_mc, score_mc, level, level_mc) {
var _local1 = this;
var _local3 = pit_mc;
_local1.screen_x = 500;
_local1.screen_y = 500;
_local1.screen_z = 450;
_local1.pitdim_x = 5;
_local1.pitdim_y = 5;
_local1.pitdim_z = 12;
var _local2 = _local1.pitdim_x * _local1.pitdim_z;
_local1.stack_bits = new Array(_local2);
do {
_local2--;
_local1.stack_bits[_local2] = 0;
} while (_local2);
_local1.pit_mc = _local3;
_local1.score_mc = score_mc;
_local3.createEmptyMovieClip("stack_mc", 2);
_local3.createEmptyMovieClip("block_mc", 3);
_local3.createEmptyMovieClip("stack_height_mc", 4);
_local1.block_mc = _local3.block_mc;
_local1.stack_mc = _local3.stack_mc;
_local1.stack_height_mc = _local3.stack_height_mc;
_local1.cur_stack_height = -1;
_local1.sound = new Sound(_local3);
_local1.score = 0;
_local1.fastdrop = false;
((_local1.level_mc = level_mc)).text = "" + ((_local1.level = level));
_local1.layers = 0;
_local1.pitRender();
_local1.blockSpawn();
_local1.blockRender();
}
function m_color_cubes(f, l) {
var i = f.length;
var j = (i * 12);
var c = new Array();
var _local2;
var _local3;
var _local1;
var x = ((l & 1023) - 512);
var y = (((l >> 10) & 1023) - 512);
var z = (l >> 20);
var t = (2.5 * Math.sqrt(((x * x) + (y * y)) + (z * z)));
var xt = (0.6 + (x / t));
var yt = (0.6 + (y / t));
var zt = (0.6 + (z / t));
x = 0.6 - (x / t);
y = 0.6 - (y / t);
z = 0.6 - (z / t);
do {
t = f[--i];
j = j - 12;
_local2 = t & 16711680;
_local3 = t & 65280;
_local1 = t & 255;
c[j + 1] = (((_local2 * x) & 16711680) + ((_local3 * x) & 65280)) + ((_local1 * x) & 255);
c[j + 2] = (((_local2 * xt) & 16711680) + ((_local3 * xt) & 65280)) + ((_local1 * xt) & 255);
c[j + 5] = (((_local2 * y) & 16711680) + ((_local3 * y) & 65280)) + ((_local1 * y) & 255);
c[j + 6] = (((_local2 * yt) & 16711680) + ((_local3 * yt) & 65280)) + ((_local1 * yt) & 255);
c[j + 9] = (((_local2 * z) & 16711680) + ((_local3 * z) & 65280)) + ((_local1 * z) & 255);
c[j + 10] = (((_local2 * zt) & 16711680) + ((_local3 * zt) & 65280)) + ((_local1 * zt) & 255);
_local2 = _local2 * 0.9;
_local3 = _local3 * 0.9;
_local1 = _local1 * 0.9;
c[j + 0] = (((_local2 * x) & 16711680) + ((_local3 * x) & 65280)) + ((_local1 * x) & 255);
c[j + 3] = (((_local2 * xt) & 16711680) + ((_local3 * xt) & 65280)) + ((_local1 * xt) & 255);
c[j + 4] = (((_local2 * y) & 16711680) + ((_local3 * y) & 65280)) + ((_local1 * y) & 255);
c[j + 7] = (((_local2 * yt) & 16711680) + ((_local3 * yt) & 65280)) + ((_local1 * yt) & 255);
c[j + 8] = (((_local2 * z) & 16711680) + ((_local3 * z) & 65280)) + ((_local1 * z) & 255);
c[j + 11] = (((_local2 * zt) & 16711680) + ((_local3 * zt) & 65280)) + ((_local1 * zt) & 255);
} while (i);
return(c);
}
conf_delta_rot = 0.261799387799149;
conf_tile_speed = 0.2;
conf_draw_playtile_faces = true;
conf_draw_playtile_wires = true;
conf_draw_pit_faces = true;
conf_draw_pit_wires = false;
level = 0;
D3Tris.copyright = "(c) 2004 Serge Victorov <viservic@mtu-net.ru>, modified and extended 2006 Andre Krause <post@andre-krause.net>";
D3Tris.prototype = new Object();
D3Tris.prototype.stackHeightRender = function () {
var _local3 = -315;
var y = 140;
var _local1 = 30;
var s2 = 5;
var _local2 = this.stack_height_mc;
_local2.clear();
var cols = D3Tris.layer_colors;
_local2.lineStyle(1, 0);
i = 0;
while ((i < cols.length) && (i < cur_stack_height)) {
_local2.beginFill(cols[11 - i]);
_local2.moveTo(_local3, y - (i * _local1));
_local2.lineTo(_local3 + _local1, y - (i * _local1));
_local2.lineTo(_local3 + _local1, (y - _local1) - (i * _local1));
_local2.lineTo(_local3, (y - _local1) - (i * _local1));
i++;
}
var pth = ((12 - Math.ceil(0.5 * this.m[14])) - 1);
_local2.beginFill(16777215, 30);
_local2.moveTo(_local3, y - (pth * _local1));
_local2.lineTo(_local3 + _local1, y - (pth * _local1));
_local2.lineTo(_local3 + _local1, (y - _local1) - (pth * _local1));
_local2.lineTo(_local3, (y - _local1) - (pth * _local1));
_local2.endFill();
_local2.lineStyle(1, 0);
_local2.moveTo(_local3, y);
_local2.lineTo(_local3 + _local1, y);
_local2.lineTo(_local3 + _local1, y - (_local1 * cols.length));
_local2.moveTo(_local3, y);
_local2.lineTo(_local3, y - (_local1 * cols.length));
i = 0;
while (i < cols.length) {
y2 = y - (i * _local1);
_local2.moveTo(_local3, y2);
_local2.lineTo(_local3 + s2, y2);
_local2.moveTo(_local3 + _local1, y2);
_local2.lineTo((_local3 + _local1) - s2, y2);
i++;
}
};
D3Tris.prototype.pitRender = function () {
var _local1 = this.pit_mc;
var j = this.pitdim_x;
var pdz = this.pitdim_z;
var m = 32800;
var t;
var _local2 = this.screen_z / (this.pitdim_z + 4.5);
var u0 = (_local2 * 2.5);
var _local3 = -u0;
var d1;
var u1;
var v1;
var w0;
var w1;
var col = 153;
if (conf_draw_pit_faces) {
_local1.beginFill(col);
} else {
_local1.beginFill(0);
}
if (conf_draw_pit_wires) {
if (conf_draw_pit_faces) {
_local1.lineStyle(1, 34816);
} else {
_local1.lineStyle(1, 65280);
}
} else {
_local1.lineStyle();
}
do {
_local3 = _local3 + _local2;
w0 = u0;
m = m ^ 1082401;
t = m;
do {
w0 = w0 - _local2;
if (t & 1) {
_local1.moveTo(w0, _local3);
_local1.lineTo(w0 + _local2, _local3);
_local1.lineTo(w0 + _local2, _local3 - _local2);
_local1.lineTo(w0, _local3 - _local2);
}
t = t >> 5;
} while (t);
j--;
} while (j);
_local3 = _local3 - (5 * _local2);
do {
u1 = u0;
v1 = _local3;
d1 = _local2;
pdz--;
_local2 = this.screen_z / (pdz + 4.5);
_local3 = -((u0 = _local2 * 2.5));
w0 = u0;
w1 = u1;
m = m ^ 1082401;
t = m;
do {
w0 = w0 - _local2;
w1 = w1 - d1;
if (t & 1) {
_local1.moveTo(w0, _local3);
_local1.lineTo(w1, v1);
_local1.lineTo(w1 + d1, v1);
_local1.lineTo(w0 + _local2, _local3);
_local1.moveTo(w0, _local3 + (5 * _local2));
_local1.lineTo(w1, v1 + (5 * d1));
_local1.lineTo(w1 + d1, v1 + (5 * d1));
_local1.lineTo(w0 + _local2, _local3 + (5 * _local2));
}
t = t >> 5;
} while (t);
j = 5;
m = m ^ 1082401;
do {
_local3 = _local3 + _local2;
v1 = v1 + d1;
m = m ^ 1082401;
t = m;
if (t & 1) {
_local1.moveTo(u0, _local3);
_local1.lineTo(u1, v1);
_local1.lineTo(u1, v1 - d1);
_local1.lineTo(u0, _local3 - _local2);
_local1.moveTo(u0 - (5 * _local2), _local3);
_local1.lineTo(u1 - (5 * d1), v1);
_local1.lineTo(u1 - (5 * d1), v1 - d1);
_local1.lineTo(u0 - (5 * _local2), _local3 - _local2);
}
} while (--j);
_local3 = _local3 - (5 * _local2);
} while (pdz);
_local1.endFill();
};
D3Tris.prototype.stackRender = function () {
var maxh = 0;
var _local1 = this.stack_mc;
var c = D3Tris.stack_face_colors;
var b = this.stack_bits;
var i = b.length;
var j;
var l = D3Tris.stack_face_colors.length;
var m = 1049601;
var _local2;
var d0 = (((this.screen_z * 6) * 2) / (l + 54));
var u0 = (d0 * 2.5);
var _local3 = -u0;
var d1;
var u1;
var v1;
var w0;
var w1;
_local1.clear();
_local1.lineStyle();
do {
u1 = u0;
v1 = _local3;
d1 = d0;
l = l - 12;
d0 = ((this.screen_z * 6) * 2) / (l + 54);
_local3 = -((u0 = d0 * 2.5));
j = 5;
do {
_local3 = _local3 + d0;
v1 = v1 + d1;
m = m ^ 1082401;
_local2 = b[--i] | m;
_local2 = _local2 & (((_local2 ^ 2164736) << 1) | -4329605);
_local2 = _local2 & (((((v1 - _local3) < 0) ? (~_local2) : (_local2)) << 2) | -8659209);
_local1.lineStyle(1, 0);
if (_local2 & 12988812) {
w0 = u0;
w1 = u1;
do {
w0 = w0 - d0;
w1 = w1 - d1;
if (_local2 & 4) {
_local1.beginFill(c[l + (_local2 & 3)]);
_local1.moveTo(w0, _local3);
_local1.lineTo(w0, _local3 - d0);
_local1.lineTo(w1, v1 - d1);
_local1.lineTo(w1, v1);
}
if (_local2 & 8) {
_local1.beginFill(c[(l + 4) + (_local2 & 3)]);
_local1.moveTo(w0, _local3);
_local1.lineTo(w1, v1);
_local1.lineTo(w1 + d1, v1);
_local1.lineTo(w0 + d0, _local3);
}
_local2 = _local2 >> 5;
} while (_local2);
}
} while (--j);
_local3 = _local3 - (5 * d0);
v1 = v1 - (5 * d1);
i = i + 5;
m = m ^ 1082401;
j = 5;
do {
_local3 = _local3 + d0;
v1 = v1 + d1;
_local2 = b[--i] | ((m = m ^ 1082401));
_local2 = _local2 & ((_local2 << 3) | -17318417);
if (_local2 & 17318416) {
maxh = l;
w0 = u0;
w1 = u1;
do {
w0 = w0 - d0;
w1 = w1 - d1;
if (_local2 & 16) {
_local1.beginFill(c[(l + 8) + (_local2 & 3)]);
_local1.moveTo(w0, _local3);
_local1.lineTo(w0 + d0, _local3);
_local1.lineTo(w0 + d0, _local3 - d0);
_local1.lineTo(w0, _local3 - d0);
}
_local2 = _local2 >> 5;
} while (_local2);
}
} while (--j);
_local3 = _local3 - (5 * d0);
} while (l);
_local1.endFill();
cur_stack_height = 12 - (maxh / 12);
};
D3Tris.prototype.blockRender = function () {
var _local3 = this;
var _local2 = _local3.block_mc;
var mv = _local3.mv;
var m = m_identity();
m[12] = -200 + ((_local3.m[12] + mv[0]) * 50);
m[13] = -200 + ((_local3.m[13] + mv[1]) * 50);
m[14] = 500 + ((_local3.m[14] + mv[2]) * 50);
var w;
w = mv[0];
mv[0] = (((w * ((w = w + _local3.md))) <= 0) ? 0 : (w));
w = mv[1];
mv[1] = (((w * ((w = w + _local3.md))) <= 0) ? 0 : (w));
w = mv[2];
mv[2] = (((w * ((w = w + _local3.md))) <= 0) ? 0 : (w));
if (_local3.rt) {
m_rotate(m, _local3.rv, _local3.rt);
_local3.rt = _local3.rt + _local3.rd;
if (_local3.rt >= 0) {
_local3.rt = 0;
}
}
m_mul_m(m, _local3.m, 0);
var _local1 = new Array();
m_project_pv(_local1, m, _local3.bl_vertices, _local3.screen_z);
m_transpose3(m);
var l = new Array();
m_mul_pv(l, m, D3Tris.ls, 0);
v_normalize(l);
_local2.clear();
if (conf_draw_playtile_faces) {
_local2.lineStyle();
var i = 0;
while (i < _local3.bl_surfaces.length) {
t = _local3.bl_normals[i];
t = ((l[0] * ((t & 1023) - 512)) + (l[1] * (((t >> 10) & 1023) - 512))) + (l[2] * (t >> 20));
_local2.beginFill(12508139, 70 - (50 * Math.abs(t)));
t = _local3.bl_surfaces[i] * 2;
j = t & 255;
_local2.moveTo(_local1[j], _local1[j + 1]);
j = (t >> 8) & 255;
_local2.lineTo(_local1[j], _local1[j + 1]);
j = (t >> 16) & 255;
_local2.lineTo(_local1[j], _local1[j + 1]);
j = t >> 24;
_local2.lineTo(_local1[j], _local1[j + 1]);
i++;
}
_local2.endFill();
}
if (conf_draw_playtile_wires) {
_local2.lineStyle(1, 16777215);
var i = 0;
while (i < _local3.bl_lines.length) {
t = _local3.bl_lines[i] * 2;
j = t & 255;
_local2.moveTo(_local1[j], _local1[j + 1]);
j = (t >> 8) & 255;
_local2.lineTo(_local1[j], _local1[j + 1]);
i++;
}
}
};
D3Tris.prototype.blockSpawn = function () {
var _local1 = this;
var _local3 = Math.floor(Math.random() * D3Tris.block_bits.length);
var _local2 = m_identity();
var bb = new Array();
_local1.bl_vertices = D3Tris.block_vertices[_local3];
_local1.bl_surfaces = D3Tris.block_surfaces[_local3];
_local1.bl_normals = D3Tris.block_normals[_local3];
_local1.bl_lines = D3Tris.block_lines[_local3];
_local1.block_bits = D3Tris.block_bits[_local3];
if (_local1.block_bits[0] & 1) {
(_local2[12] = (_local2[13] = 3));
(_local2[14] = 1);
} else {
(_local2[12] = (_local2[13] = 4));
(_local2[14] = 0);
}
_local1.m = _local2;
_local1.mv = [0, 0, 0];
_local1.rv = [1, 0, 0];
_local1.rt = 0;
_local1.down = 57 - (6 * _local1.level);
m_mul_pv(bb, _local2, _local1.block_bits, 1);
return(_local1.blockCheck(_local2, bb, false));
};
D3Tris.prototype.blockCheck = function (m, bb, r) {
var _local3 = bb;
var sb = this.stack_bits;
var _local1;
var x = 0;
var y = 0;
var z = 0;
var _local2 = _local3.length;
do {
_local1 = _local3[_local2 - 1];
if ((_local1 + z) < 0) {
z = -_local1;
} else if ((_local1 + z) > 22) {
z = 22 - _local1;
}
_local1 = _local3[_local2 - 2];
if ((_local1 + y) < 0) {
y = -_local1;
} else if ((_local1 + y) > 8) {
y = 8 - _local1;
}
_local2 = _local2 - 3;
_local1 = _local3[_local2];
if ((_local1 + x) < 0) {
x = -_local1;
} else if ((_local1 + x) > 8) {
x = 8 - _local1;
}
} while (_local2);
if ((!r) && ((x || (y)) || (z))) {
return(false);
}
_local2 = _local3.length;
do {
_local1 = (_local3[_local2 - 2] + y) + ((_local3[_local2 - 1] + z) * 5);
_local2 = _local2 - 3;
if ((2097152 >> (((_local3[_local2] + x) * 5) >> 1)) & sb[_local1 >> 1]) {
return(false);
}
} while (_local2);
m[12] = m[12] + x;
m[13] = m[13] + y;
m[14] = m[14] + z;
return(true);
};
D3Tris.prototype.blockSettle = function (bb, z) {
var _local2 = this.stack_bits;
var l = 0;
var h = 500;
var _local3 = bb.length;
var m;
var _local1;
do {
_local1 = (bb[_local3 - 2] + ((bb[_local3 - 1] + z) * 5)) >> 1;
_local3 = _local3 - 3;
m = 2097152 >> ((bb[_local3] * 5) >> 1);
if (_local1 > l) {
l = _local1;
}
if (_local1 < h) {
h = _local1;
}
_local2[_local1] = _local2[_local1] ^ ((m * 15) | (m >> 4));
if (((_local1 % 5) < 4) && (_local1 < 59)) {
_local2[_local1 + 1] = _local2[_local1 + 1] ^ (m << 2);
}
if (_local1 < 55) {
_local2[_local1 + 5] = _local2[_local1 + 5] ^ (m << 3);
}
} while (_local3);
l = l - ((l % 5) - 4);
h = h - ((h % 5) - 4);
do {
_local1 = h;
h = h + 5;
if (!((~((((_local2[_local1] & _local2[_local1 - 1]) & _local2[_local1 - 2]) & _local2[_local1 - 3]) & _local2[_local1 - 4])) & 2164802)) {
if (_local1 < 5) {
_local2[_local1 + 5] = _local2[_local1 + 5] ^ 17318416;
_local2[_local1 + 4] = _local2[_local1 + 4] ^ 17318416;
_local2[_local1 + 3] = _local2[_local1 + 3] ^ 17318416;
_local2[_local1 + 2] = _local2[_local1 + 2] ^ 17318416;
_local2[_local1 + 1] = _local2[_local1 + 1] ^ 17318416;
} else {
if (_local1 < 55) {
_local2[_local1 + 5] = _local2[_local1 + 5] ^ (((~_local2[_local1 - 5]) << 3) & 17318416);
_local2[_local1 + 4] = _local2[_local1 + 4] ^ (((~_local2[_local1 - 6]) << 3) & 17318416);
_local2[_local1 + 3] = _local2[_local1 + 3] ^ (((~_local2[_local1 - 7]) << 3) & 17318416);
_local2[_local1 + 2] = _local2[_local1 + 2] ^ (((~_local2[_local1 - 8]) << 3) & 17318416);
_local2[_local1 + 1] = _local2[_local1 + 1] ^ (((~_local2[_local1 - 9]) << 3) & 17318416);
}
do {
_local2[_local1] = _local2[_local1 - 5];
_local2[_local1 - 1] = _local2[_local1 - 6];
_local2[_local1 - 2] = _local2[_local1 - 7];
_local2[_local1 - 3] = _local2[_local1 - 8];
_local2[_local1 - 4] = _local2[_local1 - 9];
_local1 = _local1 - 5;
} while (_local1 > 4);
}
_local2[4] = (_local2[3] = (_local2[2] = (_local2[1] = (_local2[0] = 0))));
_local3++;
}
} while (l >= h);
this.sound.attachSound("schling" + _local3);
this.sound.start();
l = this.level;
this.score_mc.text = ("000000" + ((this.score = this.score + (((4 + (3 * l)) + ((z > 0) ? (12 - (this.m[14] >> 1)) : 0)) + ((((25 + (20 * l)) * (_local3 + 1)) * _local3) / 2))))).substr(-6);
if ((_local3 && (((this.layers = this.layers + _local3)) > (10 * (++l)))) && (l < 10)) {
this.level_mc.text = "" + ((this.level = l));
}
};
D3Tris.prototype.run = function () {
var _local1 = this;
var sb = _local1.stack_bits;
var _local3 = new Array();
var _local2 = m_identity();
if ((!(--_local1.down)) || (_local1.fastdrop)) {
if (_local1.fastdrop) {
_local1.down = 2;
} else {
_local1.down = 57 - (6 * _local1.level);
}
_local2[12] = _local1.m[12];
_local2[13] = _local1.m[13];
_local2[14] = _local1.m[14] + 2;
m_mul_m(_local2, _local1.m, 0);
m_mul_pv(_local3, _local2, _local1.block_bits, 1);
if (_local1.blockCheck(_local2, _local3, false)) {
_local1.m = _local2;
_local1.mv = [0, 0, -1.33];
_local1.md = 0.67;
// unexpected jump
}
_local1.fastdrop = false;
_local1.blockSettle(_local3, -2);
_local1.stackRender();
if (!_local1.blockSpawn()) {
_local1.block_mc.clear();
_local1.onGameOver();
return;
}
} else {
_local1.stackHeightRender();
_local1.blockRender();
}
};
D3Tris.prototype.onKeyDown = function () {
var _local2 = this;
var _local3 = Key.getCode();
var sb = _local2.stack_bits;
var bb = new Array();
var _local1 = m_identity();
var i;
var l;
var t;
var z;
_local1[12] = _local2.m[12];
_local1[13] = _local2.m[13];
_local1[14] = _local2.m[14];
if (_local3 < 65) {
if (_local3 == 32) {
if (!_local2.fastdrop) {
_local2.down = 2;
_local2.fastdrop = true;
} else {
_local2.fastdrop = false;
}
}
switch (_local3) {
case 37 :
_local1[12] = _local1[12] - 2;
_local2.mv = [1.33, 0, 0];
_local2.md = -0.67;
break;
case 39 :
_local1[12] = _local1[12] + 2;
_local2.mv = [-1.33, 0, 0];
_local2.md = 0.67;
break;
case 40 :
_local1[13] = _local1[13] - 2;
_local2.mv = [0, 1.33, 0];
_local2.md = -0.67;
break;
case 38 :
_local1[13] = _local1[13] + 2;
_local2.mv = [0, -1.33, 0];
_local2.md = 0.67;
break;
default :
return;
}
} else {
_local3 = _local3 + 32;
if (_local3 == D3Tris.key_rx_ccw) {
_local1[5] = (_local1[10] = 0);
_local1[6] = 1;
_local1[9] = -1;
_local2.rv = [1, 0, 0];
} else if (_local3 == D3Tris.key_rx_cw) {
_local1[5] = (_local1[10] = 0);
_local1[6] = -1;
_local1[9] = 1;
_local2.rv = [-1, 0, 0];
} else if (_local3 == D3Tris.key_ry_ccw) {
_local1[0] = (_local1[10] = 0);
_local1[2] = -1;
_local1[8] = 1;
_local2.rv = [0, 1, 0];
} else if (_local3 == D3Tris.key_ry_cw) {
_local1[0] = (_local1[10] = 0);
_local1[2] = 1;
_local1[8] = -1;
_local2.rv = [0, -1, 0];
} else if (_local3 == D3Tris.key_rz_ccw) {
_local1[0] = (_local1[5] = 0);
_local1[1] = -1;
_local1[4] = 1;
_local2.rv = [0, 0, -1];
} else if (_local3 == D3Tris.key_rz_cw) {
_local1[0] = (_local1[5] = 0);
_local1[1] = 1;
_local1[4] = -1;
_local2.rv = [0, 0, 1];
} else {
if (_local3 == 112) {
_local2.run = _local2.idle;
_local2.onKeyDown = _local2.onKeyDownPause;
_local2.onPause();
return;
}
return;
}
_local2.rt = -1.5707963267949 + conf_delta_rot;
_local2.rd = conf_delta_rot;
}
m_mul_m(_local1, _local2.m, 0);
m_mul_pv(bb, _local1, _local2.block_bits, 1);
if (_local2.blockCheck(_local1, bb, _local2.rt)) {
_local2.m = _local1;
} else {
_local2.rt = 0;
_local2.mv = [0, 0, 0];
}
};
D3Tris.prototype.idle = function () {
};
D3Tris.prototype.onKeyDownPause = function () {
var _local2 = this;
var _local1 = Key.getCode();
if (_local1 == 80) {
_local2.onUnPause();
delete _local2.run;
delete _local2.onKeyDown;
}
};
D3Tris.key_rx_cw = 113;
D3Tris.key_rx_ccw = 97;
D3Tris.key_ry_cw = 119;
D3Tris.key_ry_ccw = 115;
D3Tris.key_rz_cw = 101;
D3Tris.key_rz_ccw = 100;
D3Tris.block_vertices = [[-104435300, -104435100, -104230300, -104230500, 422300, 627100, 627300, 422500], [-52160050, -52159950, -51750350, -51750450, 52697550, 53107150, 53107250, 52697650], [-51955250, -51955050, -51852650, -51852850, -51852950, -52057750, -52057650, 52902350, 53004750, 53004950, 52902550, 52799950, 52799850, 53004650], [-51955250, -51955050, -51852650, -51852850, -51852750, -51750350, -51750550, -51852950, 53004750, 53004950, 52902550, 52902350, 53004850, 53004650, 53107050, 53107250], [-51955350, -51955050, -51852650, -51852750, -51750350, -51750450, -51852850, -51852950, 52902250, 53004650, 53004750, 53107150, 53107250, 53004850, 53004950, 52902550], [-104435200, -104435100, -104332700, -104332800, 524800, 524900, 627300, 627100, 524700, 105382400, 105382300, 105484700, 105484900, 105382500, 105280100, 105280000], [-104332900, -104332800, -104230400, -104230500, 627200, 524800, 422400, 422500, 627300, 105382400, 105382300, 105484700, 105484800, 105484900, 105280100, 105280000], [-104332800, -104332700, -104230300, -104230400, 524800, 422400, 422500, 524900, 627200, 627100, 524700, 105382400, 105280000, 105280100, 105382500, 105484900, 105484800, 105484700, 105382300]];
D3Tris.block_surfaces = [[50462976, 117835012, 67437312, 84279811, 101122306, 117702657], [50462976, 117835012, 67437312, 84279811, 101122306, 117702657], [50462976, 100992003, 168364039, 218893064, 118162944, 185337094, 202179589, 218694148, 151650562, 168230913], [50462976, 117835012, 185207048, 252579084, 185074432, 135071491, 219022855, 235865350, 252445701, 201916932, 151650562, 168493057], [117571840, 84148998, 252578056, 218893066, 134809344, 151651847, 168494342, 185336837, 202179332, 219021827, 235864322, 252182529], [50462976, 134678021, 252579081, 218893066, 252248832, 67437059, 219021570, 235864065, 151652356, 168494856, 185337351, 202179846], [50462976, 134678020, 202050057, 252579084, 168493824, 185336323, 67436802, 151650305, 202180612, 219023112, 235865607, 252249350], [50462976, 117835012, 168364036, 202182155, 252776974, 67633920, 269419011, 252576002, 117702657, 84675332, 101518341, 118361350, 185731588, 303106314, 286263305]];
D3Tris.block_normals = [[-523776, 1573376, 524799, 525824, 524801, 523776], [-523776, 1573376, 524799, 525824, 524801, 523776], [-523776, -523776, 1573376, 1573376, 524801, 523776, 524799, 525824, 524801, 523776], [-523776, -523776, 1573376, 1573376, 524799, 523776, 524799, 525824, 524801, 525824, 524801, 523776], [-523776, -523776, 1573376, 1573376, 524799, 525824, 524799, 525824, 524801, 525824, 524801, 523776], [-523776, -523776, 1573376, 1573376, 524799, 525824, 524801, 523776, 523776, 524799, 525824, 524801], [-523776, -523776, 1573376, 1573376, 524799, 525824, 524801, 523776, 525824, 524801, 523776, 524799], [-523776, -523776, -523776, 1573376, 1573376, 524799, 525824, 524801, 523776, 524799, 523776, 524801, 523776, 524799, 525824]];
D3Tris.block_lines = [[256, 513, 770, 3, 1284, 1541, 1798, 1031, 1024, 1793, 1538, 1283], [256, 513, 770, 3, 1284, 1541, 1798, 1031, 1024, 1793, 1538, 1283], [256, 513, 1026, 1284, 1541, 6, 2317, 2569, 1802, 2823, 3083, 3340, 1792, 2561, 2306, 3077, 2822, 3332], [256, 513, 1026, 1284, 1541, 1798, 775, 3, 2316, 2569, 2826, 2059, 3336, 3597, 3854, 3087, 2816, 2561, 2306, 3076, 2051, 3335, 3590, 3845], [256, 513, 770, 1027, 1284, 1541, 1798, 7, 2312, 2569, 2826, 3083, 3340, 3597, 3854, 2063, 2048, 3841, 3586, 3331, 3076, 2821, 2566, 2311], [256, 513, 770, 3, 2053, 517, 1541, 1798, 2055, 2569, 2826, 3083, 3596, 3854, 2319, 3840, 3585, 2568, 2823, 3078, 2307], [256, 513, 770, 3, 1540, 1798, 2055, 1032, 2569, 2826, 3339, 3597, 3854, 2319, 1026, 2305, 3846, 3591, 3336, 2819, 2560], [256, 513, 770, 3, 2053, 1541, 1798, 2312, 2569, 1802, 3083, 3340, 3853, 4367, 4625, 2834, 2816, 3077, 3334, 1793, 3842, 2051, 4361, 4618]];
D3Tris.block_bits = [[-524801, -522753, -522751, -524799], [520704, 522752, 524800, 526848], [522750, 524798, 524800, 524802], [526846, 526848, 524800, 524802], [524800, 524798, 524802, 526848], [-524799, 1574399, 1574401, 1572353], [-522753, 1574399, 1574401, 1572353], [-522751, 1572353, 1574399, 1574401]];
D3Tris.ls = [3669506];
D3Tris.layer_colors = [16711680, 13421619, 52377, 26316, 16737792, 16763955, 3394611, 39372, 16711782, 16750899, 10079283, 52428];
D3Tris.stack_face_colors = m_color_cubes(D3Tris.layer_colors, D3Tris.ls[0]);
stop();
Frame 2
var start_time = getTimer();
var fps_counter = 0;
var pit = new D3Tris(pit_mc, score_mc, level, level_mc);
Key.addListener(pit);
pit.onGameOver = function () {
Key.removeListener(pit);
gotoAndPlay (5);
};
pit.onPause = function () {
pause_mc.gotoAndPlay(8);
};
pit.onUnPause = function () {
pause_mc.gotoAndStop(1);
};
pause_mc.gotoAndStop(1);
Frame 3
pit.run();
Frame 4
if ((getTimer() - start_time) > 1000) {
start_time = getTimer();
fps_counter = 0;
} else {
fps_counter++;
}
gotoAndPlay(_currentframe - 1);
Frame 5
var score = pit.score;
stop();
Frame 6
stop();
Selection.setFocus("name_mc");
Frame 8
gotoAndPlay (2);
Symbol 26 Button
on (release) {
gotoAndPlay (2);
}
Symbol 31 Button
on (release) {
gotoAndPlay (3);
}
Symbol 39 Button
on (release) {
gotoAndPlay (1);
}
Symbol 43 MovieClip Frame 1
_parent.D3Tris.key_rx_cw = 113;
_parent.D3Tris.key_rx_ccw = 97;
_parent.D3Tris.key_ry_cw = 119;
_parent.D3Tris.key_ry_ccw = 115;
_parent.D3Tris.key_rz_cw = 101;
_parent.D3Tris.key_rz_ccw = 100;
stop();
Symbol 43 MovieClip Frame 2
_parent.D3Tris.key_rx_cw = 97;
_parent.D3Tris.key_rx_ccw = 113;
_parent.D3Tris.key_ry_cw = 122;
_parent.D3Tris.key_ry_ccw = 115;
_parent.D3Tris.key_rz_cw = 101;
_parent.D3Tris.key_rz_ccw = 100;
stop();
Symbol 43 MovieClip Frame 3
_parent.D3Tris.key_rx_ccw = 113;
_parent.D3Tris.key_rx_cw = 97;
_parent.D3Tris.key_ry_ccw = 119;
_parent.D3Tris.key_ry_cw = 115;
_parent.D3Tris.key_rz_cw = 101;
_parent.D3Tris.key_rz_ccw = 100;
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 1
function init() {
var _local2 = this;
var _local1 = _local2._parent;
var _local3 = _local1._parent;
_local1.x = _local1._x;
_local1.y = _local1._y;
_local2.w = _local2._width;
_local2.h = _local2._height;
if (!_local3.levels) {
_local3.levels = new Array();
}
_local2.id = _local3.levels.push(_local1) - 1;
}
function doRoll(id, dx) {
var _local3 = this._parent._parent.levels;
var _local1;
var _local2 = _local3.length;
while (_local2-- , _local2 > id) {
_local1 = _local3[_local2];
_local1._x = (_local1.x = _local1.x - dx);
}
while (_local2--) {
_local1 = _local3[_local2];
_local1._x = (_local1.x = _local1.x + dx);
}
}
function onRollOver() {
var _local3 = this;
var _local1 = _local3._parent;
var _local2 = _local3.w * 0.375;
_local1._x = (_local1.x = _local1.x - _local2);
_local1._y = (_local1.y = _local1.y - (_local3.h * 0.375));
_local1._xscale = 175;
_local1._yscale = 175;
doRoll(_local3.id, -_local2);
}
function onRollOut() {
var _local3 = this;
var _local1 = _local3._parent;
var _local2 = _local3.w * 0.375;
_local1._xscale = 100;
_local1._yscale = 100;
_local1._x = (_local1.x = _local1.x + _local2);
_local1._y = (_local1.y = _local1.y + (_local3.h * 0.375));
doRoll(_local3.id, _local2);
}
function onRelease() {
var _local1 = this._parent._parent._parent;
_local1.level = this.id;
_local1.play();
}
init();
this.onDragOver = onRollOver;
this.onDragOut = onRollOut;
stop();
Symbol 94 Button
on (release) {
play();
}
Symbol 99 Button
on (release) {
score = pit.score;
s = score.toString();
q = 0;
a = 0;
while (a < s.length) {
q = q + ((a + 1) * parseInt(s.charAt(a)));
a++;
}
l = q.toString().length;
r = ((q * q) + (3 * q)) * 1256342;
scoreenc = (("06" + l.toString()) + q.toString()) + (score + r).toString();
urlstr = (("http://www.coreloop.com/3dtris/savetetriscore_form.php?s=" + scoreenc) + "&name=") + name_mc.text;
getURL (urlstr);
score = 0;
pit.score = 0;
gotoAndPlay (1);
}
Symbol 102 Button
on (release) {
gotoAndPlay (1);
}