Game design with JS | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Resposta
+ 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