From 12b154c34084ec3d79e21502767fa086f22c4be4 Mon Sep 17 00:00:00 2001 From: mellomuffin <78819366+notDaylight@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:23:36 -0700 Subject: [PATCH] Update app.js Added WASD --- js/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index dad7367547..e27fd14912 100644 --- a/js/app.js +++ b/js/app.js @@ -34,12 +34,17 @@ Enemy.prototype.render = function() { // This listens for key presses and sends the keys to your // Player.handleInput() method. You don't need to modify this. +// Just adding WASD so that players can play with the two most popular keybinds document.addEventListener('keyup', function(e) { var allowedKeys = { 37: 'left', + 65: 'left', 38: 'up', + 87: 'up', 39: 'right', - 40: 'down' + 68: 'right', + 40: 'down', + 83: 'down', }; player.handleInput(allowedKeys[e.keyCode]);