周末手撸的 JS 俄罗斯方块

87 天前
 setimouse

周末闲着无聊,想起初中时总想自己做一个俄罗斯方块但终没有做成,不能留遗憾,于是动手开撸了。 不到 300 行代码,几个小时写出来了。 年少时觉得难以翻越的山丘,如今早已没有什么难度了。

点击看成果: https://setimouse.github.io/js-tetris/

github 地址: https://github.com/setimouse/js-tetris

  1. Clone this project
  2. Open index.html in your browser.
  3. Follow me: https://x.com/pekingmuge

1645 次点击
所在节点    分享创造
8 条回复
dianso
87 天前
我觉得还是这个 UI 好看

https://chvin.github.io/react-tetris
body007
87 天前
@dianso 这个项目也不错,总结了很多经验啊。
LavaC
86 天前
失算了啊
LavaC
86 天前

不知道为啥不让我直接发
duan602728596
86 天前
有个 bug ,如果在边缘变形的时候,可能会出现一部分在边缘外的情况
setimouse
86 天前
@LavaC 左边缘溢出已经修改了。DAS,ARR,SRS 学习了,zan!
NNNNzs
85 天前
既然你放在全局作用域,就别怪我不客气了

function newTetromino() {
return new Tetromino(tetrominos[6]);
}
setimouse
85 天前
@NNNNzs 哈哈哈

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1059237

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX