So im just starting out learning Javascript, and I'm following the game tutorial in https://www.w3schools.com/graphics/game_obstacles.asp This is the point i've gotten stuck at. If you check out the code in the example, they've added a working obstacle, but the game won't work with the keyboard. (only with buttons added to the site) I want to be able to steer the character with my keyboard, and have a working obstacle, that will stop the game when the two touch.
I would appreciate any help i could get from this. (the code i use is in the example in the link above)