Git Product home page Git Product logo

tetrisjs-a's Introduction

Tetris JS

Build status

This is the classic game of Tetris written in pure HTML (No Canvas 2D Controls). It uses HTML Tables and jQuery for rendering, and is surprisingly pretty fast. I know there's a lot of these out on the web but I wanted to create something that looked minimalistic yet elegant with excellent controls and compatibility.

Wide browser support on both desktop and mobile devices. Includes keyboard, touch, and even Xbox Gamepad Support! It is fully responsive and on larger screens it displays more information like the next piece. I spent quite a bit of time tweaking the touch controls to make it feel smooth and responsive on any smartphone.

See demo here: https://www.neilb.net/tetrisjs/

Architecture

The code references a few external libraries:

jQuery for DOM manipulation and rendering

Bootstrap for button styles and grid layout for desktop/mobile

Rivets for binding of data labels likes score, lines, etc..

RequireJS as the AMD module loader of the compiled TypeScript JS files

Font Awesome for directional icons

I used the following styles to extend the touch surface to the entire screen:

body, html {
    height: 100%;
}

The code is written in TypeScript, to run and compile it locally use the following commands:

npm install

tsc

Please send me any feedback or bugs you may find.

Thanks!

Online Multiplayer

The multiplayer version of this repo is here

https://github.com/nbarkhina/TetrisNET

tetrisjs-a's People

Contributors

nbarkhina avatar paulcapron 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.