https://github.com/capricorncd/tetris
Tetris Game. (俄罗斯方块/テトリス)
https://github.com/capricorncd/tetris
audiocontext game tetris tetris-game typescript
Last synced: about 1 year ago
JSON representation
Tetris Game. (俄罗斯方块/テトリス)
- Host: GitHub
- URL: https://github.com/capricorncd/tetris
- Owner: capricorncd
- Created: 2017-10-20T01:28:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-05-11T12:26:18.000Z (about 1 year ago)
- Last Synced: 2025-05-12T20:24:23.392Z (about 1 year ago)
- Topics: audiocontext, game, tetris, tetris-game, typescript
- Language: TypeScript
- Homepage: https://capricorncd.github.io/tetris/dist/
- Size: 7.36 MB
- Stars: 14
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tetris Game / 俄罗斯方块
Tetris Game
```shell script
npm i zx-tetris
```
## Start
```bash
npm run dev
```
http://localhost:9000
## 游戏截图

### Keyboard 键盘操作
Left: `←`, Right: `→`, Rotate: `↑`, Down: `↓`, OK: `Space`, Start/Pause: `Enter`, Restart: `Shift`
## 扫码体验

https://capricorncd.github.io/tetris/dist
## 初始化方法
```html
Tetris - 俄罗斯方块单机版 - Capricorncd
body {background-color: #333;}
.game-box { float: left; margin-right: 10px; padding: 10px; width: 320px; height: 540px; border: 1px solid #999}
new Tetris({
// 可选参数,默认为body
container: '#TetrisA',
// 错误回调
error: function (err) {
console.error(err)
},
// 游戏DOM结构创建完成回调
ready: function (res) {
console.log(res)
}
})
```
## Copyright and license
https://github.com/capricorncd
Code and documentation copyright 2018. Capricorncd. Code released under the MIT License.