Pandaqi / In-the-Same-Boat

Jackbox-style game where you try to sail a ship together - discovering treasures and battling your friends.
2 stars 0 forks source link

Fix the touch/mouse issue #25

Closed Pandaqi closed 5 years ago

Pandaqi commented 5 years ago

I THINK the problem is the fact that I don't get the correct clientX and clientY from touch events. (And because I use "preventDefault()", touches don't propagate towards mouse events.)

This should give me the solution: https://developer.mozilla.org/en-US/docs/Web/API/Touch/clientX

If not, here are some more links:

Pandaqi commented 5 years ago

Yes, fixed it. Had to get .touches[0] from the event object.