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.
Asked
Active
Viewed 14 times
1 Answers
0
Something like:
document.addEventListener("keydown", e => {
if (e.key === "ArrowUp") {
console.log("Up arrow key pressed");
}
});

Bqardi
- 107
- 1
- 5