mirror of
https://github.com/hexahigh/games.git
synced 2025-12-11 20:15:38 +01:00
added wasd controls to tetris
This commit is contained in:
parent
247b0ef90b
commit
b33c3b60cd
@ -6,6 +6,12 @@ document.body.onkeydown = function( e ) {
|
||||
38: 'rotate',
|
||||
32: 'drop'
|
||||
};
|
||||
var keys = {
|
||||
68: 'left',
|
||||
65: 'right',
|
||||
83: 'down',
|
||||
87: 'rotate',
|
||||
};
|
||||
if ( typeof keys[ e.keyCode ] != 'undefined' ) {
|
||||
keyPress( keys[ e.keyCode ] );
|
||||
render();
|
||||
|
||||
@ -15,4 +15,4 @@
|
||||
<p><a href="/3D CHESS">3D Chess</a></p>
|
||||
<p><a href="/Pixel dodge">Pixel dodge</a></p>
|
||||
<p><a href="/Tic Tac Toe">Tic Tac Toe</a></p>
|
||||
<p><a href="/Getting over it only html/">Getting over it: Scratch edition</a></p>
|
||||
<p><a href="/Getting over it only html/">Getting over it: Scratch edition</a></p>
|
||||
Loading…
x
Reference in New Issue
Block a user