Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
Tutorial explaining how to use the AdventureJS scorecard. tutorial, scorecard

Goals, Hints, and Scores:Scorecards

Scorecards are a system for creating and awarding points, updating a player's score, printing score update messages, and setting the score in the status bar. Points aren't managed automatically - it's up to authors to define them and determine when they're awarded. Authors can call game.scorecard.awardPoint("point") from any code block to award points. Point objects can be organized into groups, which may award additional points when all of their children are completed. The first thing an author needs to do is create a set of points via shorthand or longhand methods. A player might see something like the following in response to typing points:

Example output

> score
You've earned 4 out of 10 points.
  • You opened the window.
  • You entered the library.
  • You unlocked the desk drawer.
  • You found Raggedy Ann.

Methods

Properties

In addition to the methods listed above, scorecards have several configurable properties that authors can set with MyGame.scorecard.set({}).

Variables

Scorecards have several variable properties that can be used when customizing award_text and score_format.

Point properties

In addition to the scorecard's configurable options, individual points can be further customized to return distinct messages. At minimum, a point only needs a name and a value, but authors can customize the message that is printed when that particular point is awarded, how the point is presented in a list of completed points when a player types score, whether the point is a bonus point, and optional custom code to be called when the point is awarded. Authors can use these properties to exercise granular control over score output.