Class: Scorecard
Defined in: adventure/Scorecard.js, line 6
Scorecard is a repository for Game score options. Scorecard is created automatically by Game. This is an internal class that authors should not need to construct. However, authors can set scoring options from their game file as shown below, and call score updates from custom scripts.
Example:
var MyGame = new adventurejs.Game( "MyGame", "GameDisplay" );
MyGame.scorecard.set({
score_events: {
"unlock door": { points: 1, complete: false, bonus: false, message: '', recorded: false },
"unlock chest": { points: 1, complete: false, bonus: false, recorded: message: '', false },
"drink potion": { points: 1, complete: false, bonus: false, recorded: message: '', false },
}
});
Private Constructor:
var foo = new adventurejs.Scorecard(game)
Parameters:
-
game
Game
A reference to the game instance.
Index
Methods:
Properties:
Methods Collapse all |
Defined in: adventure/Scorecard.js, line 121
Defined in: adventure/Scorecard.js, line 72
Parameters:
-
event
String
A string matching an event key.
Returns:
Boolean
Defined in: adventure/Scorecard.js, line 55
Returns:
String
Defined in: adventure/Scorecard.js, line 190
Parameters:
-
props
Object
A generic object containing properties to copy to the instance.
Returns:
adventurejs.Scorecard
Returns the instance the method is called on (useful for chaining calls.)
Defined in: adventure/Scorecard.js, line 180