Skip to content

nightblade9/themis-games-template

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

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.html file 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 scaleGamecontainer method, make sure you change the width and height of authoredWidth and authoredheight so that the game scales correctly.
  • Make the same change in the CSS: Specify #gamecontainer.width and #gameContainer.height. Also update the offsets (left and top) to half those values respsectively. This will make your game center on-screen.
  • Update sfxFiles to 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.

About

Blind-accessible HTML/Javascript game template, developed and maintained by Themis Games.

Topics

Resources

Stars

Watchers

Forks

Languages