Blind-Accessible HTML + Javascript Game Template
Blind-accessible HTML/Javascript game template, originally developed and maintained by Themis Games. You can read more about how it works, and the different considerations for web accessible games, in this excellent write-up.
Games That Use This
Usage
- Use the
index.htmlfile a a starting point. If you wish, you can extract the CSS and JS into separate files - Make sure you include the Javascript code in the
<body>tag, because it needs to access the DOM. - In the
scaleGamecontainermethod, make sure you change the width and height ofauthoredWidthandauthoredheightso that the game scales correctly. - Make the same change in the CSS: Specify
#gamecontainer.widthand#gameContainer.height. Also update the offsets (leftandtop) to half those values respsectively. This will make your game center on-screen. - Update
sfxFilesto list any sound files you want to preload. - Call
setupAudio()on the first user gesture. This is a security feature (in Chrome), where this is no longer allowed to be called outside of user gestures. This also causes the audio files to preload.