Making an HTML5 game run on a desktop is easy. Making it feel good on a phone, in a mobile browser, with no install, is where most of the work hides. This is the checklist I use for the browser games on InstantGames.in, which all run on phone, tablet and desktop.
1. Touch input, done properly
Use Pointer Events where you can. They unify mouse, touch and pen, and give each finger an id, which is what makes multi-touch work.
// simplified sketch const pointers = new Map ( ) ;
canvas . addEventListener ( "pointerdown" , e => pointers . set ( e . pointerId , [ { x : e . offsetX , y : e . offsetY } ] ) ) ; canvas . addEventListener ( "pointermove" , e => pointers . get ( e . pointerId ) ? . push ( { x : e . offsetX , y : e . offsetY } ) ) ; canvas . addEventListener ( "pointerup" , e => pointers . delete ( e . pointerId ) ) ; canvas . style .…