This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(( | |
$Document, | |
_str_createElement, | |
_str_addEventListener, | |
_str_preventDefault, | |
_str_input, | |
_str_drawTools, | |
_str_strokeStyle, | |
_str_color, | |
_str_range, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hover mouse over canvas to allow keyboard input. | |
Use arrow keys to play. | |
Someone else can add touch controls (see window.Tetris). | |
<canvas id="tetris" style="border: solid 1px #000; background: #eee" width="200" height="400"></canvas> | |
<script> | |
(($Window, $Document, _m_addEventListener, _m_preventDefault, _m_forEach, _prop_$canvas, _prop_score, _prop_board, _prop_piece, _const_COLS, _const_ROWS, _const_SHAPES, _const_COLORS, _const_ROW_SCORE) => { | |
class Tetris { | |
static I = {}; | |
constructor(selector) { | |
if (Tetris.I[selector]) |
OlderNewer