【www.gdgbn.com--php应用】

练手的时候写的,后面写得好乱,8(
比较满意的是方块的储存和旋转,是我见过同类游戏中最简洁的


俄罗斯方块
<script>
/********************************
俄罗斯方块 Version 1.0beta
2001年10月19日 By 黄砾(Stone) (bbs.online.jx.cn)
这段脚本可以免费使用于任何非商业用途。引用时请保留本段说明。
Tetris version 1.0beta
by Li Huang, October 19th 2001
*******************************/
//存储各方块的形状
var Shapes = new Array (
    new Array (2,1,0,0,1,0,2,0,1,1),
    new Array (2,1,0,0,1,0,1,1,2,1),
    new Array (2,1,1,0,2,0,0,1,1,1),
    new Array (1,1,0,0,1,0,0,1,1,1),
    new Array (2,1,0,0,1,0,2,0,0,1),
    new Array (2,1,0,0,1,0,2,0,2,1),
    new Array (3,2,0,1,1,1,2,1,3,1));
function tetris(name,width,height) {
    this.width = width;
    this.height = height;
    document.write("");
    for (var y=0;y        document.write("");
        for (var x=0;x       document.write("&nbsp;");
        document.write("");
    }
    document.write("");
    this.Box = eval(name);
    this.checkDot = function(x,y) {
        if (x<0 || y<0 || x>=this.width || y>=this.height)

本文来源:http://www.gdgbn.com/jiaocheng/8461/