A JavaScript script written by Tetris (2) russia.js
Source: Internet
Author: User
var Cols = +, Rows = Sqlen = 16;
var Color = new Array (8);
var delline = new Array ();
var CLoc = new Array ();
var rloc = new Array ();
var cursq,nextsq;
var Type=-1,oldtype;
var delay = new Array (600,500,400,300,200,100,90,80,70);
var Timerid;
var pos = 0,end,level=0,score=0,lines=0;
var Isover=false,ispause=false;
Color[0] = "#d0d0d0";
COLOR[1] = "red";
COLOR[2] = "green"
COLOR[3] = "cyan";
COLOR[4] = "yellow";
COLOR[5] = "orange";
COLOR[6] = "Pink";
COLOR[7] = "Blue";
function Gamearea (row,col,name) {
var s = "<table border=1 cellspacing=0 cellpadding=1 bgcolor=" + color[0] + ">";
for (var i=0; i<row; i++) {
s = s + "<tr height=" + Sqlen + ">";
for (Var j=0 j<col; J + +) {
var id = name + i + "#" + J;
s = s + "<td width=" + Sqlen + "Class=btnup id=" + ID;
s = s + "style=" background: "+ color[0] +" "> </TD>"
}
s = s + "</TR>";
}
s = s + "</TABLE>";
return s;
}
function Init () {
gamebody.innerhtml = Gamearea (rows,cols, ' Main ');
gameforecast.innerhtml = Gamearea (4,4, ' Forecast ');
}
function Square (cols,rows,color) {
This.rows = rows;
This.cols = cols;
This.color = color;
}
function Choosesquare (type,x,y) {
var sq = new Array (4);
Switch (type) {
Case 0:
Sq[0] = new Square (x-1,y,1);
SQ[1] = new Square (x,y,1);
SQ[2] = new Square (x+1,y,1);
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.