-1

I am trying to make a platformer, but, I don't know how to ad key controls. How Do I do this? Javascript is not for making games I know, but my IDE cant run c, c++, c#, python, and more. it can only run javascript, typescript, and vue.

Coder
  • 1
  • 1

1 Answers1

0

Something like:

document.addEventListener("keydown", e => {
  if (e.key === "ArrowUp") {
    console.log("Up arrow key pressed");
  }
});
Bqardi
  • 107
  • 1
  • 5