Xyzygy gets music and mobile support

I've had a chance to pick out some awesome background music for the game (somber beauty by fwimmygoat), to set the mood for your space explorations. I've also fixed problems on mobile (especially iOS), most notably moving the viewport around as you maneuvered your ship.

For other people making mobile web apps, here are the many ways I disabled scrolling, panning, zooming, highlighting, and selecting:

  • In the HTML header, I put in this meta tag to prevent zooming:
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
  • In the CSS, I put in some properties to prevent selecting: 
    body, canvas {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
  • And in the JavaScript, I overrode a bunch of touch events (simplified here):
    document.addEventListener('touchstart', e => e.preventDefault(), { passive: false })
    document.addEventListener('touchmove', e => e.preventDefault(), { passive: false })

Hope that saves you some visits to outdated Stack Overflow pages!

Files Play in browser
Jul 15, 2018

Get Xyzygy

Download NowName your own price

Leave a comment

Log in with to leave a comment.