I can't move "the man"[SOLVED] | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

I can't move "the man"[SOLVED]

I wanna make a game which when you click the for example right button "the man"(blue rectangle) will move in this way. Can you help me https://code.sololearn.com/WH1mn0fy3BX0/?ref=app

1st Aug 2020, 5:16 PM
_mustafa_ .carbas.
_mustafa_ .carbas. - avatar
6 Respuestas
+ 5
Oh a downvote proved I'm stupid, sorry ūüėÖ
1st Aug 2020, 5:43 PM
PresidentOfYes12 - avatar
+ 2
You are never calling the `right` function. Add this line anywhere outside the function window.onload = right This will call the right function as soon as the document loads and then you can use the "right" button. Note that when you add functionality for other buttons, add it in the right function only (probably rename it), becase only the `right` function will be called when the document loads
1st Aug 2020, 5:36 PM
XXX - avatar
1st Aug 2020, 5:42 PM
Gabriel Ilie
Gabriel Ilie - avatar
+ 1
I have done one right button for you Try for other three yourself. And first closer your div#container. https://code.sololearn.com/WBiNPXEFcXco/?ref=app
1st Aug 2020, 5:42 PM
Divya Mohan
Divya Mohan - avatar
Thanks everyone! problem solved
1st Aug 2020, 5:44 PM
_mustafa_ .carbas.
_mustafa_ .carbas. - avatar
_mustafa_ .carbas. What about accidently selecting the screen? here https://code.sololearn.com/W0VX1XT5mD5G/?ref=app
2nd Aug 2020, 12:15 AM
Sali65 - avatar