itch.io is community of indie game creators and players

Devlogs

Xyzygy gets music and mobile support

Xyzygy
A browser game made in HTML5

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

  • xyzygy-1.0.zip 17 MB
    Jul 15, 2018
Download Xyzygy
Leave a comment