+ 2

Game design with JS

I’m at the second last code repo called “user input”. I’m supposed to make the circle move when using the following code: document.onkeydown = function() { count += 1; y -= 25; } document.ontouchstart = function() { count += 1; y -= 25; } However, im also supposed to remove the original jump button and I’m finding it difficult to know what to remove. I don’t necessarily want to paste all the code here, but if anyone has completed the code repo, please let me know how this part works? Thank you!

1st Jan 2023, 6:17 AM
Antoinette Brits
Antoinette Brits - avatar
1 Answer
+ 5
I think one of them used for computer and another used for phone. onkeydown for computer and ontouchstart for phone.
1st Jan 2023, 7:33 AM
Saif
Saif - avatar