Giter Site home page Giter Site logo

capricorncd / tetris Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 5.0 6.22 MB

Tetris Game. (俄罗斯方块/テトリス)

Home Page: https://capricorncd.github.io/tetris/dist/

JavaScript 9.00% TypeScript 71.75% HTML 4.44% SCSS 14.82%
tetris tetris-game typescript game audiocontext

tetris's Introduction

Tetris Game / 俄罗斯方块

Tetris Game

Downloads Version License

npm i zx-tetris

Start

npm run dev

http://localhost:9000

游戏截图

Tetris 俄罗斯方块

Keyboard 键盘操作

Left: , Right: , Rotate: , Down: , OK: Space, Start/Pause: Enter, Restart: Shift

扫码体验

Tetris 俄罗斯方块

https://capricorncd.github.io/tetris/dist

初始化方法

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>Tetris - 俄罗斯方块单机版 - Capricorncd</title>
  <style>
    body {background-color: #333;}
    .game-box { float: left; margin-right: 10px; padding: 10px; width: 320px; height: 540px; border: 1px solid #999}
  </style>
</head>
<body>

<div class="game-box" id="TetrisA"></div>

<script src="./tetris.min.js"></script>
<script>
  new Tetris({
    // 可选参数,默认为body
    container: '#TetrisA',
    // 错误回调
    error: function (err) {
      console.error(err)
    },
    // 游戏DOM结构创建完成回调
    ready: function (res) {
      console.log(res)
    }
  })
</script>
</body>
</html>

Copyright and license

https://github.com/capricorncd

Code and documentation copyright 2018. Capricorncd. Code released under the MIT License.

tetris's People

Contributors

capricorncd avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.