3D Game Programming

(C. Jardin) #1

The project home page is https://github.com/eee-c/scoreboard.js.


The Scoreboard.js library supports messages, help text, scoring, an elapsed
timer, and a countdown timer.

Scoreboard Messages


Use messages to provide in-game messages to the game player. If you create
a scoreboard with var scoreboard = new Scoreboard(), the following methods are
available:


  • scoreboard.message('your message here')—sets the current scoreboard message.
    This will replace any existing messages. If the message section of the
    scoreboard is not shown already, this will show it.

  • scoreboard.addMessage('your message here')—adds more messages to the current
    scoreboard message.

  • scoreboard.addMessage('your message here')—adds more messages to the current
    scoreboard message.

  • scoreboard.showMessage()—shows the message section of the scoreboard.

  • scoreboard.hideMessage()—hides the message section of the scoreboard.

  • scoreboard.clearMessage()—erases the message section of the scoreboard.


Help


Scoreboard help provides a way to give instructions to the player without
cluttering up the message section of the scoreboard. Players need to type a
question mark to see the help on the scoreboard.

If you create a scoreboard with var scoreboard = new Scoreboard(), the following
methods are available:


  • scoreboard.help('your help instructions here')—sets the scoreboard help. This will
    replace any existing help. If the help section of the scoreboard is not shown
    already, this will show it.

  • scoreboard.showHelp()—shows the help section of the scoreboard.

  • scoreboard.hideHelp()—hides the help section of the scoreboard.


Scoring


This feature of the scoreboard keeps track of the number of points the player
has earned in the game.

report erratum • discuss

Scoreboard.js • 275


Prepared exclusively for Michael Powell

Free download pdf