JS 写的俄罗斯方块游戏


http://www.htmleaf.com/html5/html5youxi/201501201236.html


https://github.com/Aerolab/blockrain.js/blob/gh-pages/src/blockrain.jquery.src.js


<!doctype html>
<html lang="zh">
	<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
	<link rel="stylesheet" type="text/css" href="css/default.css">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link href="css/blockrain.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="game" style="width:440px; height:800px;">
</div>
<a href="javascript:;" onclick="pause()" >暂停</a> , 
<a href="javascript:;" onclick="repause()" >取消暂停</a>

<script src="http://libs.useso.com/js/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<script src="js/blockrain.jquery.min.js" type="text/javascript"></script>
<script>

$('.game').blockrain({
	speed: 12,
	playText: '准备开始游戏!',
	playButtonText: '开始',
	gameOverText: '你失败了!',
	restartButtonText: '再来一把!',
	scoreText: '得分',
	theme: 'candy'
});

function pause() {
	console.log('pause');
$('.game').blockrain('pause');
}
function repause() {
console.log('resume');
$('.game').blockrain('resume');
}
</script>
</body>
</html>


郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。