0
Why can't i control the rectangle using those buttons
Game controller (buttons) https://code.sololearn.com/WKF6POXXc205/?ref=app
3 odpowiedzi
+ 1
You didn't pass a value for "direction" in the drawPaddle(). Also you try to call drawPaddle() multiple times in draw()?
0
Thks Please how control the rectangle using the buttons
0
You are not listening for button click, you need to connect javacript function with button click, so when user click for example start game you run function to start game....
Here is more how to add event listeners, there are few ways to do it:
https://www.w3schools.com/jsref/event_onclick.asp
https://www.w3schools.com/jsref/met_element_addeventlistener.asp