From b33c3b60cd00ac2918a20d9eee23d5189e178854 Mon Sep 17 00:00:00 2001 From: Boof <97455552+hexahigh@users.noreply.github.com> Date: Fri, 21 Oct 2022 11:13:58 +0200 Subject: [PATCH] added wasd controls to tetris --- Tetris/js/controller.js | 6 ++++++ index.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Tetris/js/controller.js b/Tetris/js/controller.js index 6e3fee5..136c286 100644 --- a/Tetris/js/controller.js +++ b/Tetris/js/controller.js @@ -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(); diff --git a/index.html b/index.html index 4941cfa..1775d43 100644 --- a/index.html +++ b/index.html @@ -15,4 +15,4 @@

3D Chess

Pixel dodge

Tic Tac Toe

-

Getting over it: Scratch edition

+

Getting over it: Scratch edition

\ No newline at end of file