rs2048 icon indicating copy to clipboard operation
rs2048 copied to clipboard

Enable input from mobile devices

Open Journeycorner opened this issue 6 years ago • 2 comments

Good job, unfortiunately I can't try it out, since I am using my tablet. As a modern web APP, consider using a mobile first approach, i.e. enabling mobile input and using it as the primary target device.

Journeycorner avatar Jan 04 '19 09:01 Journeycorner

Swipe gestures are, imo, the best way to implement this. So, if someone decides to take this on, I'd recommend using Hammer.js.

KappaDistributive avatar Jan 04 '19 10:01 KappaDistributive

Update: I tried implementing this feature today and, to my surprise, disovered that stdweb doesn't yet support touch events (see Issue 305 at /koute/stdweb) which complicates this issue.

What I have done is to implement mouse input. This caused all sorts of ownership issues which I have handled by reorganizing the refresh/redraw cycle of the game.

As a result, once touch events are supported by stdweb (which, btw, would make for an awesome contribution over there and most of the work has already been done...), adding this feature amounts to a few trivial changes.

KappaDistributive avatar Jan 05 '19 02:01 KappaDistributive