ndleMouseUp);
      }

      const uiElem = document.querySelector('#ui');
      uiElem.addEventListener('pointerdown', handleMouseMove, {passive: false});

      uiElem.addEventListener('touchstart', (e) => {
        // prevent scrolling
        e.preventDefault();
      }, {passive: false});
    }
    update() {
      for (const keyState of Object.values(this.keys)) {
        if (keyState.justPressed) {
          keyState.justPressed = false;
        }
      }
    }
  }

  function removeArrayElement(arra