WebFund 2013F: Tutorial 8

From Soma-notes
Revision as of 01:48, 24 October 2013 by Soma (talk | contribs)

This tutorial is not yet finalized

To add a quit button:

  • Add the button to the page in index.html (make it the letter Q) similar to the information and sound buttons.
  • Style the button in a fashion similar to the info button in letterscript.css (look for the #infos attributes). Note you will have to change the offset; otherwise the button will overlap with the sound button.
  • In letterpaint.js:
    • Add a quitbutton variable similar to the one for sound or info.
    • Add an event listener for the quit button, referring to a quit() callback function.
    • Define quit(), having it set the value of window.location to be the URL you wish to visit when you quit ("/").

Tasks:

  • Make the info screen be dismissed when you click anywhere on it (rather than just by clicking on the info button again).
  • Add a counter to the bottom right that tracks the score - how many letters have been traced correctly.
  • Bonus (HARD): Send scores to the server on quit. Save the highest score and have that displayed somewhere in the letterpaint game (say, in the middle of the top bar). The high score should be updated from the server at the start of every game.