使用JS实现俄罗斯方块游戏
简单的JS俄罗斯方块游戏源码
效果图:
代码如下,复制即可使用:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>使用JS实现俄罗斯方块游戏</title> <style type="text/css"> .MainFrame { border: 1px solid burlywood; margin: 10px auto; position: relative; background-color: silver; } .MainFramediv { float: left; margin: 1px; position: absolute; /*z-index: -1;*/ } .smallDiv { margin: 1px; position: absolute; } .smallDivblack { /*float: left;*/ margin: 1px; /*margin: 1px;*/ position: absolute; /*z-index: 2;*/ } #tetris{ width: 50%; margin: 0 auto; padding: 0; /*border: 1px solid silver;*/ } #tetris:after{ content: ""; Display: block; Clear: both; } #control{ float: left; border: 1px solid silver; width: 150px; height: 578px; margin-top: 10px; margin-left: 20px; padding-top: 30px; font-size: 24px; font-weight: 400; color: blue; text-align: center; } #level,#regame{ width: 100px; height: 30px; border: 1px solid blue; font-size: 16px; color: red; font-weight: 300; } #control p{ margin-top: 200px; } #regame{ margin-top: 100px; font-weight: 600; background-color: azure; } #TFrime{ float: left; } #info{ float: left; border