js/render.js
// Handle when keys are held down
Handle when keys are held down
Handle when keys are held down
function handleKeydown(event) {
  let key = event.key;
  let action = KEY_BINDINGS[key];
  if (!action || action.type != MOVE) return;
  if (keysPressed[key]) return;
  keysPressed[key] = true;
}
function handleKeydown ( event ) { let key = event . key ; let action = KEY_BINDINGS [ key ] ; if ( ! action || action . type != MOVE ) return ; if ( keysPressed [ key ] ) return ; keysPressed [ key ] = true ; }
Handle when keys are held down
Handle when keys are held down
// Only consider keys that have movement actions bound to them.