javascript+html5+canvse+3d俄罗斯方块
必须使用支持html5的浏览器打开,比如firefox,chrome

得分:0速度:1000
// 你的浏览器不支持 <canvas>标签,请使用 Chrome 浏览器 或者 FireFox 浏览器');
document.write('你的浏览器不支持 <canvas>标签,请使用 Chrome 浏览器 或者 FireFox 浏览器');
// ]]>
辅助横截面透视图 从上往下看:

 
从左往右看:

 
从前往后看:

 

// 0)return 1;//IE
if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0)return 2;//Firefox
if (isSafari = navigator.userAgent.indexOf("Chrome") > 0)return 3;//Chrome
if (isSafari = navigator.userAgent.indexOf("Safari") > 0)return 4;//Safari
if (isCamino = navigator.userAgent.indexOf("Camino") > 0)return 5;//Camino
if (isMozilla = navigator.userAgent.indexOf("Gecko/") > 0)return 6;//Gecko
//other...
return 0;
}
var tableHTML = function(trLen, tdLen) {
var str = "";
for (var i = 0; i ";
for (var j = 0; j

";
}
str += "

";
}
return str;
};
var isInclude = function(array, element, start) {
var alen = array.length;
for (var i = start; i =this.mainCanvas.XLen || xyz[1]>=this.mainCanvas.YLen || xyz[2]>=this.mainCanvas.ZLen)return false;
return !isInclude(this.staticBlock, xyz, 0);
};
Game.prototype.gridsAreBlank = function(array) {
for(var i=0;i= this.levelArr[i][0]) {
this.setLevel(this.levelArr[i][1]);
break;
}
}
};
Game.prototype.setScoreLabel = function(sl) {
this.scoreLabel = sl;
};
Game.prototype.setScore = function(score) {
this.score = score;
if(this.scoreLabel)this.scoreLabel.innerHTML = this.score;
};
Game.prototype.computeScore = function(n) {
for (var i = 1; i = winScore) {
// win();
// }
// }, this.flashSpeed * 6);
// }

if(toRemoves.length > 0){
this.computeScore(toRemoves.length);
this.computeLevel();
var newSB = [];
for(i=0;i= this.winScore) {
this.win();
}
else{
this.create();
}
};
Game.prototype.drop = function() {
if(this.paused)return;
if (!(this.activeBlock.length == 0)) {
if (this.hasSpaces(this.activeBlock, [0,1,0])) {
// l('activeBlock hasSpaces');
this.directOneGrid([0,1,0]);
}
else {
// l('activeBlock do not hasSpaces');
clearInterval(this.inter);
this.abToSB();
this.removeFull();
}
}
};
Game.prototype.dropToBottom = function(xyz) {
if(this.paused)return;
clearInterval(this.inter);
var _this = this;
this.inter = setInterval(function(){_this.drop();}, 20);
};
Game.prototype.autoDrop = function() {
if(this.paused)return;
clearInterval(this.inter);
var _this = this;
this.inter = setInterval(function(){_this.drop();}, _this.level);
};
//axle: "x", "y", "z", "o"
Game.prototype.transformAB = function(axle) {
var newBlock = [];
newBlock[0] = this.activeBlock[0];
for (var i = 1; i 0) {
var newBlock = this.transformAB(axle);
if(this.blockAreBlank(newBlock)){
this.clearAB();
this.setAB(newBlock);
this.fillAB();
}
}
};

Game.prototype.init = function() {
this.setScoreLabel(document.getElementById("score"));
this.setLevelLabel(document.getElementById("level"));

var table_names = ['front', 'top', 'left'];
for(var i=0;i

47 && kc.keyCode

 
       
   


//

javascript+html5+canvse+3d俄罗斯方块的更多相关文章

  1. 10个最佳 Javascript+HTML5 演示文稿框架

    JavaScript 与 HTML5 框架在创建基于现代浏览器的演示文稿时发挥了重要作用.他们把展示插入网页,为演示信息提供了一个有效方式.一般来说,手工插入花费大量事件和精力,它很复杂,以至于新手们 ...

  2. 8月7号晚7点Autodesk北京办公室,我们来聊聊HTML5/ WebGL 3D 模型浏览技术

    Autodesk 发布了一款完全无需插件的三维模型浏览器 Autodesk 360 Viewer,大家有没有兴趣,下班后过来聊聊吧!   8月7号 周四, 19:00~21:00 Autodesk北京 ...

  3. JavaScript+html5 canvas实现本地截图教程

    这篇文章主要介绍了JavaScript+html5 canvas实现本地截图教程,对截图功能感兴趣的小伙伴们可以参考一下 最近有时间了解了下html5的各API,发现新浪微博的头像设置是使用canva ...

  4. 7款外观迷人的HTML5/CSS3 3D特效按钮特效

    下面我整理了7款外观都十分迷人的HTML5/CSS3 3D按钮特效,有几个还挺实用的,分享给大家. 1.CSS3超酷3D弹性按钮 按钮实现非常简单 之前我们分享过几款不错的CSS3 3D立体按钮,比如 ...

  5. JavaScript HTML5脚本编程——“历史状态管理”的注意要点

    历史状态管理是现代Web应用开发中的一个难点.在现代Web应用中,用户的每次操作不一定会打开一个全新的页面,因此"后退"和"前进"按钮也就失去了作用,导致用户很 ...

  6. WebGL实现HTML5的3D贪吃蛇游戏

    js1k.com收集了小于1k的javascript小例子,里面有很多很炫很酷的游戏和特效,今年规则又增加了新花样,传统的classic类型基础上又增加了WebGL类型,以及允许增加到2K的++类型, ...

  7. 100行JS实现HTML5的3D贪吃蛇游戏

    js1k.com收集了小于1k的javascript小例子,里面有很多很炫很酷的游戏和特效,今年规则又增加了新花样,传统的classic类型基础上又增加了WebGL类型,以及允许增加到2K的++类型, ...

  8. HTML5拓扑3D机房,电力工控Web SCADA

    http://www.hightopo.com/cn-index.html 一套丰富的JavaScript界面类库, 提供完整的基于HTML5图形界面组件库.使用HT for Web您可以轻松构建现代 ...

  9. 分享一个WebGL开发的网站-用JavaScript + WebGL开发3D模型

    这张图每位程序员应该都深有感触. 人民心目中的程序员是这样的:坐在电脑面前噼里啪啦敲着键盘,运键如飞. 现实中程序员是这样的:编码5分钟,调试两小时. 今天我要给大家分享一个用WebGL开发的网站,感 ...

随机推荐

  1. IPC 简说

    IPC(inter-process communication)进程间通信 多进程分为两种情况 1. 同一个应用,使用android:process属性启动的四大组件 2. 多应用 通过android ...

  2. c语言,中缀表达式转后缀表达式并计算

    //c语言中缀表达式计算 #include <stdio.h> #include <stdlib.h> #include <string.h> #include & ...

  3. dubbo could not get local host ip address will use 127.0.0.1 instead 异常处理

    dubbo could not get local host ip address will use 127.0.0.1 instead 查看hostname localhost:spring wls ...

  4. python 离群点检测

    import numpy as np import pandas as pd from sklearn.cluster import KMeans import matplotlib.pyplot a ...

  5. ORACLE11G R2 RAC的进程启动流程

    简要说明ORACLE11GR2 RAC的进程启动流程: 1.启动流程概览图: 二.RAC启动流程的梳理: 第一层:OHASD 启动:(OHASD派生) 1.CSSDAGENT负责启动CSSD的AGEN ...

  6. c#图片裁剪

    c#文件裁剪 Bitmap newbm = new Bitmap(nowWidth, nowHeight); Graphics g = Graphics.FromImage(newbm); g.Int ...

  7. flask-不错的教程

    https://spacewander.github.io/explore-flask-zh/7-blueprints.html

  8. newinstance()和new有什么区别?

    在初始化一个类,生成一个实例的时候:newInstance() 和 new 有什么区别?用newInstance与用new是区别的,区别在于创建对象的方式不一样,前者是使用类加载机制,那么为什么会有两 ...

  9. CentOS 7 / RHEL 7:修改OpenSSH 默认端口

    1.备份sshd_config cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.orig.$(date +%F) 2.vi /etc/ssh/sshd_ ...

  10. 聊一聊 redux 异步流之 redux-saga

    让我惊讶的是,redux-saga 的作者竟然是一名金融出身的在一家房地产公司工作的员工(让我想到了阮老师...),但是他对写代码有着非常浓厚的热忱,喜欢学习和挑战新的事物,并探索新的想法.恩,牛逼的 ...