+ 1
HTML Canvas event listener
I'm working on making a pong game. The code is: https://code.sololearn.com/WfuSxs2MWhJr/#html I'm wondering if you can add an event listener to the canvas and make it so when you click on say the top left it would move the left paddle up. And if you clicked the left down part of the canvas it would move the left paddle down and the same for the right paddle. So is there anyway to "split" the canvas into 4 parts each with a way to tell which part has been clicked.
2 ответов
+ 1
Thanks @ Brent Meeusen