Class:Game
Defined in: adventure/Game.js, line 5
Constructor:
var MyGame = new adventurejs.Game( "MyGame", "MyGameDisplay" )
Description
Game is used to construct a new game instance. This instance contains the entire game and all of its methods. If you open the browser inspector window, go to the console, and type "MyGame" (or whatever game_name you have provided), you can see the properties scoped to the Game object. Every object in the game is given a reference back to the main Game object. This means that you can run multiple games in a single HTML page.
Example:
A minimal game defines at least one Room and one Player Character. If you don't provide either of these, one will be created automatically.
var MyGame = new adventurejs.Game( "MyGame", "MyGameDisplay" )
.set({
title: "Welcome Game",
author: "Ivan Cockrum",
description: "This is my great game! Thanks for playing!",
version: "0.0.1",
});
MyGame.createAsset({
class: "Room",
name: "Welcome Room",
descriptions:{ look: "You've entered the Welcome Room. " },
});
MyGame.createAsset({
class: "Player",
name: "Guest",
is: { active: true, },
place: { in: "Welcome Room" },
});
Private Constructor:
var foo = new adventurejs.Game(game_nameopt, displayElIdopt)
Parameters:
-
game_name
String <optional>
Default value: ""
A string that matches the name of the var used to store the new Game instance. Used to give the game a reference back to itself, relative to the browser window. If no name is provided, the instance name will default to "MyGame". The chief reason you might want to use a custom game_name is if you want to run multiple instance of adventure.js on a single page; give them distinct names to prevent them from colliding. You also may want to refer to your Game instance if you write any custom javascript. -
displayElId
String <optional>
Default value: ""
A string that matches the ID of an existing DOM element into which to insert the game Display. If no ID is provided, a DOM element will be created with an ID of "MyGameDisplay" and class of "ajs-display", and appended to .
- Index
- Methods
- Properties
Index
Methods:
- $directions
- $exits
- addAsset
- appendTurn
- callIntervals
- callPostScripts
- callPreScripts
- clearInput
- combineVerbs
- constructAsset
- convertTemperature
- createAsset
- createClass
- createCompass
- createDeferredAssets
- createGlobalCeilings
- createGlobalConcepts
- createGlobalExits
- createGlobalFloors
- createGlobalScenery
- createGlobalWalls
- createImageDock
- createImageLookup
- createInventoryDock
- createPostScript
- createPreScript
- createVerb
- createVerbDock
- debug
- deobfuscate
- diff
- disableAllVerbsBut
- disableVerbs
- enableVerbs
- findSubstanceBodyOrHeld
- findSubstanceContainers
- findViewModifiers
- getAsset
- getBaselineDiff
- getCustomSuccessMessage
- getDescription
- getExitFromDirection
- getExtendedExitName
- getGlobalAssetDescription
- getInput
- getLastTurn
- getLongestLookup
- getModifiedDescription
- getPlayer
- getPrintableObjectList
- getRecentAssets
- getRoom
- getRoomExits
- getRoomFloor
- getStringLookup
- getSubject
- getVar
- getVar
- getVerb
- getVerifiedSentence
- getWordCount
- hasCommonWord
- hasVerb
- idleNPCs
- initializeAssets
- isFalseOrNull
- isIdInMixedArray
- isObfuscated
- log
- mergeWorld
- obfuscate
- overrideTurn
- patchVerb
- play
- prependTurn
- printInput
- printPlayerInventory
- printRoom
- printRoomContents
- printRoomExits
- printRoomZoneEvents
- printWithInput
- propercase
- randomize
- registerInterval
- replaceVerb
- restoreWorld
- sendToInput
- sendToParser
- set
- setGlobalDescriptions
- setPlayer
- setRoom
- setStyle
- setVar
- sortLookupValues
- stringToArray
- substituteHTMLTags
- tryTravel
- unregisterInterval
- updateDisplayCompasses
- updateDisplayInventory
- updateDisplayRoom
- updateDisplayVerbs
- validateAssetPrecursor
- validateAssets
- validateClassList
- vars
Properties:
Methods Collapse all |
$directions
$directions() → {Object}
Defined in: adventure/game/$directions.js, line 8
Returns:
Object
$exits
$exits() → {Object}
Defined in: adventure/game/$exits.js, line 8
Returns:
Object
addAsset
addAsset(asset) → {Object}
Defined in: adventure/game/addAsset.js, line 7
Parameters:
-
asset
Object
A generic object with properties to copy into a new classed object.
MyGame.addAsset({ "class":"foo", "name":"bar", [...] })
addAsset() is a constructor function that can be used to dynamically create new Assets at runtime, which is to say, after the game has been initialized. This method encapsulates game.createAsset(), asset.validate() and asset.initialize(). The end result is equivalent to using createAsset() in your game file.
Returns:
Object
A new Asset of the class specified in asset.class.
appendTurn
appendTurn(msg) → {boolean}
Defined in: adventure/Game.js, line 556
Parameters:
-
msg
String
Returns:
boolean
callIntervals
callIntervals()
Defined in: adventure/Game.js, line 793
callPostScripts
callPostScripts()
Defined in: adventure/Game.js, line 865
callPreScripts
callPreScripts()
Defined in: adventure/Game.js, line 853
clearInput
clearInput()
Defined in: adventure/Game.js, line 348
combineVerbs
combineVerbs(verbs, intoVerb) → {object}
Defined in: adventure/Game.js, line 700
Parameters:
-
verbs
object -
intoVerb
object
Returns:
object
constructAsset
constructAsset(source) → {Object}
Defined in: adventure/game/constructAsset.js, line 8
Parameters:
-
source
Object
A generic object containing properties to copy to a game object.
Returns:
Object
Returns an instance of whatever class was defined.
convertTemperature
convertTemperature(temperature, context_id) → {Boolean}
Defined in: adventure/utils/convertTemperature.js, line 3
Todos: Finish writing this.
Parameters:
-
temperature
Number | String
In Celsius. -
context_id
String
The ID of the game object the temperature applies to.
Returns:
Boolean
createAsset
createAsset(asset) → {Object}
Defined in: adventure/game/createAsset.js, line 7
Parameters:
-
asset
Object
A generic object with properties to copy into a new classed object.
MyGame.createAsset({ "class":"foo", "name":"bar", [...] })
createAsset() is a constructor function available to authors, for creating all instances of Asset and its subclasses, which includes most of the objects you'd put in a game world.
The function takes one parameter: a generic object containing properties to be passed into a class instance. For most asset classes, the only required properties are 'class' and 'name'. You'd likely also want to specify 'location', though that's not a required property. Otherwise, an author only needs to define the properties they wish to revise away from default settings.
For example, to create a simple brass key with default settings and put it in a particular location:
MyGame.createAsset({
"class":"Key",
"name":"brass key",
place: { in: "desk drawer" },
});
At runtime, createAsset() returns a new instance of the given class, uses the given name to create an id, validates the object properties, initializes the new object, and then adds it to the game world. Failure to pass any of these steps will throw an error to the console.
For more examples of how to use createAsset, see About Assets and other How To docs under Get Started.
Returns:
Object
A new Asset of the class specified in asset.class.
createClass
createClass(asset) → {Boolean}
Defined in: adventure/game/createClass.js, line 7
Parameters:
-
asset
Object
A generic object with properties to copy into a new class definition.
MyGame.createClass(
class Foo extends adventurejs.Bar {
constructor(name, game_name) {
super(name, game_name);
this.class = "Foo";
}
}
)
createClass() is a constructor function available to authors for creating whole new classes of Assets. The function takes one parameter: a class declaration function. For example, to create a special class of Yggdrasil tree:
MyGame.createClass(
class Yggdrasil extends adventurejs.Tree {
constructor(name, game_name) {
super(name, game_name);
this.class = "Yggdrasil";
}
}
)
At runtime, createClass() plugs the new class constructor directly into AdventureJS, where it can be used to construct instances with the usual Game.createAsset({}) method. As of this writing, createClass is basically a passthrough without any internal error checking, so consider yourself going off road. It's recommended that you browse through the Asset Reference to see how classes are laid out.
You can also find more info under Custom Classes.
Returns:
Boolean
createCompass
createCompass(properties) → {Object}
Defined in: adventure/game/createCompass.js, line 7
Parameters:
-
properties
Object
A generic object with properties used to construct a compass.
Returns:
Object
A new compass object.
createDeferredAssets
createDeferredAssets()
Defined in: adventure/game/createDeferredAssets.js, line 8
Objects created here also need to be validated, since they were added to the deferred list during the initial validation pass and therefore missed validation.
createGlobalCeilings
createGlobalCeilings()
Defined in: adventure/game/createGlobalCeilings.js, line 8
createGlobalConcepts
createGlobalConcepts()
Defined in: adventure/game/createGlobalConcepts.js, line 8
createGlobalExits
createGlobalExits()
Defined in: adventure/game/createGlobalExits.js, line 8
createGlobalFloors
createGlobalFloors()
Defined in: adventure/game/createGlobalFloors.js, line 8
createGlobalScenery
createGlobalScenery()
Defined in: adventure/game/createGlobalScenery.js, line 8
createGlobalWalls
createGlobalWalls()
Defined in: adventure/game/createGlobalWalls.js, line 8
createImageDock
createImageDock(properties) → {Object}
Defined in: adventure/game/createImageDock.js, line 7
Parameters:
-
properties
Object
A generic object with properties used to construct an image dock.
Returns:
Object
A new image dock object.
createImageLookup
createImageLookup(asset) → {Object}
Defined in: adventure/game/createImageLookup.js, line 7
Parameters:
-
asset
Object
A generic object with properties to copy into the image library.
MyGame.createImageLookup({
images: [
{ id: "desert", image: "images/backgrounds/desert.jpg" },
{ id: "sea", image: "images/backgrounds/sea.jpg" },
{ id: "mountains", image: "images/backgrounds/mountains.jpg" },
{ id: "dungeon", image: "images/backgrounds/dungeon.jpg" },
{ id: "throneroom", image: "images/backgrounds/throneroom.jpg" },
],
});
The image library is accessible at game.image_lookup.
Returns:
Object
A reference to the image lookup.
createInventoryDock
createInventoryDock(properties) → {Object}
Defined in: adventure/game/createInventoryDock.js, line 7
Parameters:
-
properties
Object
A generic object with properties used to construct an inventory dock.
Returns:
Object
A new inventory dock object.
createPostScript
createPostScript(object) → {Object}
Defined in: adventure/game/createPostScript.js, line 7
Parameters:
-
object
Object
A generic object with properties to copy into a new classed object.
Returns:
Object
The object that was passed in.
createPreScript
createPreScript(object) → {Object}
Defined in: adventure/game/createPreScript.js, line 7
Parameters:
-
object
Object
A generic object with properties to copy into a new classed object.
Returns:
Object
The object that was passed in.
createVerb
createVerb(verb) → {object}
Defined in: adventure/Game.js, line 674
Parameters:
-
verb
object
Returns:
object
createVerbDock
createVerbDock(properties) → {Object}
Defined in: adventure/game/createVerbDock.js, line 7
Parameters:
-
properties
Object
A generic object with properties used to construct the verb dock.
Returns:
Object
A new verb dock object.
debug
debug(token)
Defined in: adventure/game/debug.js, line 7
Parameters:
-
token
String
deobfuscate
deobfuscate(text) → {String}
Defined in: adventure/utils/deobfuscate.js, line 5
Parameters:
-
text
String
Returns:
String
diff
diff(baseline_object, updated_object) → {Object}
Defined in: adventure/utils/diff.js, line 4
Parameters:
-
baseline_object
Object
Old object -
updated_object
Object
New object
Returns:
Object
disableAllVerbsBut
disableAllVerbsBut(verbs) → {object}
Defined in: adventure/Game.js, line 650
Parameters:
-
verbs
object
Returns:
object
disableVerbs
disableVerbs(verbs) → {object}
Defined in: adventure/Game.js, line 638
Parameters:
-
verbs
object
Returns:
object
enableVerbs
enableVerbs(verbs) → {object}
Defined in: adventure/Game.js, line 662
Parameters:
-
verbs
object
Returns:
object
findSubstanceBodyOrHeld
findSubstanceBodyOrHeld(substance_id) → {Array}
Defined in: adventure/game/findSubstanceBodyOrHeld.js, line 8
Parameters:
-
substance_id
String
Returns:
Array
findSubstanceContainers
findSubstanceContainers(substance_id, selects) → {Array}
Defined in: adventure/game/findSubstanceContainers.js, line 8
Parameters:
-
substance_id
String -
selects
Array
Returns:
Array
findViewModifiers
findViewModifiers() → {Array}
Defined in: adventure/game/findViewModifiers.js, line 8
Returns:
Array
getAsset
getAsset(identifier, params) → {String}
Defined in: adventure/game/getAsset.js, line 8
Parameters:
-
identifier
String
Name or ID of a game object. -
params
Object
Used to check for 'prefer_substance' in cases of looking for substances in containers.
Returns:
String
An object ID.
getBaselineDiff
getBaselineDiff(source_world) → {String}
Defined in: adventure/utils/getBaselineDiff.js, line 5
Parameters:
-
source_world
Object
Returns:
String
Returns a stringified diff.
getCustomSuccessMessage
getCustomSuccessMessage(asset, verbName) → {Boolean}
Defined in: adventure/game/getCustomSuccessMessage.js, line 8
Parameters:
-
asset
Object
A game asset. -
verbName
String
A verb name.
Returns:
Boolean
getDescription
getDescription(identifier) → {String|Boolean}
Defined in: adventure/game/getDescription.js, line 6
Parameters:
-
identifier
String
This is scoped to Game rather than Asset because there are cases that handle simple unclassed objects with description properties, notably: properties of room_scenery.
Returns:
String
|
Boolean
getExitFromDirection
getExitFromDirection(direction) → {Object}
Defined in: adventure/game/getExitFromDirection.js, line 8
Parameters:
-
direction
String
Returns:
Object
An exit.
getExtendedExitName
getExtendedExitName(exit, destination) → {String}
Defined in: adventure/game/getExtendedExitName.js, line 8
Parameters:
-
exit
Object -
destination
Object
Returns:
String
getGlobalAssetDescription
getGlobalAssetDescription(asset, identifier) → {String}
Defined in: adventure/game/getGlobalAssetDescription.js, line 8
Parameters:
-
asset
Object | String -
identifier
String
Global assets are a bit (perhaps overly) complicated. They exist as singular objects in the game world, and they can be enabled/disabled and have their descriptions overridden per room and per zone.
For example:
MyGame.world.global_air
is an assetMyGame.world.room.room_scenery.global_air
is a simple object that can be used to determine whether
a global asset is available in a given room. MyGame.world.zone.zone_scenery.global_air
is a simple object that can be used to determine whether
a global asset is available in a given zone. Returns:
String
A description of the specified asset id.
getInput
getInput() → {Object}
Defined in: adventure/game/getInput.js, line 8
Returns:
Object
getLastTurn
getLastTurn() → {Object}
Defined in: adventure/game/getLastTurn.js, line 8
Returns:
Object
getLongestLookup
getLongestLookup()
Defined in: adventure/game/getLongestLookup.js, line 8
getModifiedDescription
getModifiedDescription(options) → {String}
Defined in: adventure/game/getModifiedDescription.js, line 6
Parameters:
-
options
Object
This is scoped to Game rather than Asset because there are cases that handle simple unclassed objects with description properties, notably: properties of room_scenery.
Returns:
String
getPlayer
getPlayer() → {Object}
Defined in: adventure/game/getPlayer.js, line 8
Returns:
Object
getPrintableObjectList
getPrintableObjectList(objects, exclusions) → {String}
Defined in: adventure/game/getPrintableObjectList.js, line 8
Parameters:
-
objects
Object
An array of object ID strings. -
exclusions
Object
An array of of object ID strings to exclude.
Returns:
String
A formatted string.
getRecentAssets
getRecentAssets() → {Object}
Defined in: adventure/utils/getRecentAssets.js, line 5
Returns:
Object
getRoom
getRoom() → {Object}
Defined in: adventure/game/getRoom.js, line 8
Returns:
Object
getRoomExits
getRoomExits(room) → {String}
Defined in: adventure/game/getRoomExits.js, line 8
Parameters:
-
room
Object
A room to get exits of. Defaults to current room.
Returns:
String
A formatted list of exits.
getRoomFloor
getRoomFloor() → {Object}
Defined in: adventure/game/getRoomFloor.js, line 8
Returns:
Object
getStringLookup
getStringLookup(verbs) → {object}
Defined in: adventure/Game.js, line 600
Parameters:
-
verbs
object
Returns:
object
getSubject
getSubject() → {Object}
Defined in: adventure/game/getSubject.js, line 8
Returns:
Object
getVar
getVar()
Defined in: adventure/Game.js, line 889
getVar
getVar()
Defined in: adventure/Game.js, line 910
getVerb
getVerb(verb) → {object}
Defined in: adventure/Game.js, line 625
Parameters:
-
verb
string
Returns:
object
getVerifiedSentence
getVerifiedSentence() → {Object}
Defined in: adventure/game/getVerifiedSentence.js, line 8
Returns:
Object
getWordCount
getWordCount() → {Array}
Defined in: adventure/game/getWordCount.js, line 7
getWordCount() is a utility method to get a count of all the unique words the game "knows".
Returns:
Array
hasCommonWord
hasCommonWord(word) → {boolean}
Defined in: adventure/Game.js, line 612
Parameters:
-
word
string
Returns:
boolean
hasVerb
hasVerb(verb) → {Boolean}
Defined in: adventure/game/hasVerb.js, line 8
Parameters:
-
verb
String
Returns:
Boolean
idleNPCs
idleNPCs()
Defined in: adventure/Game.js, line 824
initializeAssets
initializeAssets()
Defined in: adventure/game/initializeAssets.js, line 8
isFalseOrNull
isFalseOrNull(value) → {Boolean}
Defined in: adventure/utils/isFalseOrNull.js, line 4
Parameters:
-
value
*
Returns:
Boolean
isIdInMixedArray
isIdInMixedArray(array) → {Array}
Defined in: adventure/utils/isIdInMixedArray.js, line 4
Parameters:
-
array
Array
- convert ' ' to '_'
- convert ' and ' to '&'
- convert '.' to '$'
Returns:
Array
isObfuscated
isObfuscated(text) → {Boolean}
Defined in: adventure/utils/isObfuscated.js, line 5
Parameters:
-
text
String
Returns:
Boolean
log
log(method, level, msg)
Defined in: adventure/game/log.js, line 7
Parameters:
-
method
String | Number
0=log, 1=warn, 2=error -
level
String | Number
0=critical, 1=high, 2=medium, 3=low -
msg
*
Message for console.
mergeWorld
mergeWorld(source, dest) → {Object}
Defined in: adventure/utils/mergeWorld.js, line 4
Parameters:
-
source
Object -
dest
Object
Returns:
Object
dest
obfuscate
obfuscate(text) → {String}
Defined in: adventure/utils/obfuscate.js, line 5
Parameters:
-
text
String
Returns:
String
overrideTurn
overrideTurn(msg) → {boolean}
Defined in: adventure/Game.js, line 570
Parameters:
-
msg
String
Returns:
boolean
patchVerb
patchVerb(patch_verb) → {object}
Defined in: adventure/Game.js, line 714
Parameters:
-
patch_verb
object
plug.phrase1
and in your game file, call patchVerb with
line visible: true
removed.
MyGame.patchVerb({
name: "plug",
phrase1:{
accepts_noun: true,
requires_noun: true,
accepts_preposition: true,
noun_must_be:
{
known: true,
tangible: true,
present: true,
visible: true,
reachable: true,
},
},
});
( game.patchVerb() actually forwards to game.dictionary.patchVerb() ).
Returns:
object
play
play()
Defined in: adventure/game/play.js, line 8
Returns:
adventurejs.GameprependTurn
prependTurn(msg) → {boolean}
Defined in: adventure/Game.js, line 584
Parameters:
-
msg
String
Returns:
boolean
print
print(msg, classes)
Defined in: adventure/game/print.js, line 7
Parameters:
-
msg
String -
classes
String
print
print(msg, classes)
Defined in: adventure/game/printInferred.js, line 7
Parameters:
-
msg
String -
classes
String
printInput
printInput(input)
Defined in: adventure/game/printInput.js, line 8
Parameters:
-
input
String
printPlayerInventory
printPlayerInventory()
Defined in: adventure/game/printPlayerInventory.js, line 8
printRoom
printRoom(params)
Defined in: adventure/game/printRoom.js, line 8
Todos: Formalize handling for description/brief/verbose descriptions
Parameters:
-
params
Object
For example:
printRoom( { verbose: true } )
printRoomContents
printRoomContents(room)
Defined in: adventure/game/printRoomContents.js, line 8
Parameters:
-
room
Object
A room to be printed. Defaults to current room.
printRoomExits
printRoomExits(room)
Defined in: adventure/game/printRoomExits.js, line 8
Parameters:
-
room
Object
A room to be printed. Defaults to current room.
printRoomZoneEvents
printRoomZoneEvents()
Defined in: adventure/game/printRoomZoneEvents.js, line 8
printWithInput
printWithInput(msg, classes)
Defined in: adventure/game/printWithInput.js, line 8
Parameters:
-
msg
String -
classes
String
propercase
propercase(string) → {String}
Defined in: adventure/utils/propercase.js, line 4
Parameters:
-
string
String
Returns:
String
randomize
randomize(string) → {String}
Defined in: adventure/utils/randomize.js, line 4
Parameters:
-
string
String
Returns:
String
registerInterval
registerInterval(id, callback, turns)
Defined in: adventure/Game.js, line 750
Parameters:
-
id
string
id of Asset which owns the function. -
callback
string
The function to call on interval. -
turns
int
An optional number of turns to repeat.
replaceVerb
replaceVerb(oldVerb, newVerb) → {object}
Defined in: adventure/Game.js, line 686
Parameters:
-
oldVerb
object -
newVerb
object
Returns:
object
restoreWorld
restoreWorld(source)
Defined in: adventure/utils/restoreWorld.js, line 5
Parameters:
-
source
Object
sendToInput
sendToInput()
Defined in: adventure/Game.js, line 339
sendToParser
sendToParser()
Defined in: adventure/Game.js, line 327
set
set(props) → {adventurejs.Game}
Defined in: adventure/game/set.js, line 8
Parameters:
-
props
Object
A generic object containing properties to copy to the Game instance.
setGlobalDescriptions
setGlobalDescriptions(globals)
Defined in: adventure/game/setGlobalDescriptions.js, line 8
Parameters:
-
globals
Object
A list of globle Scenery Assets.
setPlayer
setPlayer(new_player) → {Object}
Defined in: adventure/Game.js, line 920
Parameters:
-
new_player
*
id or object representing new player
Returns:
Object
setRoom
setRoom(newRoom, params)
Defined in: adventure/game/setRoom.js, line 8
Parameters:
-
newRoom
Object
A room object to which to move subject. -
params
Object
setStyle
setStyle(style, params)
Defined in: adventure/game/setStyle.js, line 8
Parameters:
-
style
Object
A room object to which to move subject. -
params
Object
setStyle
offers a method to add custom
stylesheets via the game definition file, as opposed
to embedding styles in HTML or loading stylesheets.
setVar
setVar()
Defined in: adventure/Game.js, line 900
sortLookupValues
sortLookupValues()
Defined in: adventure/game/sortLookupValues.js, line 8
stringToArray
stringToArray(string) → {Array}
Defined in: adventure/utils/stringToArray.js, line 4
Parameters:
-
string
String
Returns:
Array
substituteHTMLTags
substituteHTMLTags(msg) → {String}
Defined in: adventure/utils/substituteHTMLTags.js, line 4
Parameters:
-
msg
String
A string on which to perform substitutions.
For example:
MyGame.createAsset({ class: "Room", name: "Standing Room", descriptions: { brief: "The north door is
Returns:
String
tryTravel
tryTravel(direction, params)
Defined in: adventure/game/tryTravel.js, line 8
Parameters:
-
direction
String -
params
Object
unregisterInterval
unregisterInterval(id, callback)
Defined in: adventure/Game.js, line 770
Parameters:
-
id
string
id of Asset which owns the function. -
callback
string
The function to call on interval.
updateDisplayCompasses
updateDisplayCompasses()
Defined in: adventure/Game.js, line 422
updateDisplayInventory
updateDisplayInventory()
Defined in: adventure/Game.js, line 446
updateDisplayRoom
updateDisplayRoom()
Defined in: adventure/Game.js, line 390
updateDisplayVerbs
updateDisplayVerbs()
Defined in: adventure/Game.js, line 437
validateAssetPrecursor
validateAssetPrecursor(child) → {Object}
Defined in: adventure/game/validateAssetPrecursor.js, line 8
Parameters:
-
child
Object
A generic object.
Returns:
Object
A classed object.
validateAssets
validateAssets()
Defined in: adventure/game/validateAssets.js, line 8
validateClassList
validateClassList(property) → {Array}
Defined in: adventure/utils/validateClassList.js, line 4
Todos: Is this unused?
Parameters:
-
property
String | Array
Returns:
Array
vars
vars()
Defined in: adventure/Game.js, line 877
Properties |
author
author :String
baseline
baseline
Defined in: adventure/Game.js, line 196
baseline
stores a copy of the initial
game world, for comparison in save/restore and undo.
class_lookup
class_lookup
Defined in: adventure/Game.js, line 220
class_lookup
stores a lookup table
containing the ids of all assets by class.
game
game :Object
Defined in: adventure/Game.js, line 98
Default value: {}
game_name
game_name :String
Defined in: adventure/Game.js, line 107
image_lookup
image_lookup
Defined in: adventure/Game.js, line 234
image_lookup
stores a lookup table
for optional images supplied by author.
input
input :Object
Defined in: adventure/Game.js, line 526
- Use game.getInput() instead.
inventorydocks
inventorydocks :Object
Defined in: adventure/Game.js, line 309
inventorydocks
is an array that
stores references to any custom inventorydocks.
last_turn
last_turn :Object
Defined in: adventure/Game.js, line 535
- Use game.getLastTurn() instead.
player
player :Object
Defined in: adventure/Game.js, line 508
- Use game.getPlayer() instead.
room
room :Object
Defined in: adventure/Game.js, line 517
- Use game.getRoom() instead.
room_lookup
room_lookup
Defined in: adventure/Game.js, line 227
room_lookup
stores an array
containing the ids of all rooms.
score
score :String
scorecard
scorecard :Object
Defined in: adventure/Game.js, line 287
scorecard
is a singleton class
that stores all the game's score events
and functions for managing score.
settings
settings :Object
Defined in: adventure/Game.js, line 146
settings
is a singleton class
that stores all the game's global settings.
title
title :String
version
version :String
world
world
Defined in: adventure/Game.js, line 157
world
stores all the game asset
objects. It also stores a handful of variables
such as _player and _room which are used
for convenience. It also stores any global vars
created by the game's author. This last is done
to give authors a place to store vars that can
be written out with saved games.
world._vars
world._vars
Defined in: adventure/Game.js, line 169
Nested property of World
world._vars
is a namespace for
authors to store any custom vars that they
would like to be written out with saved games,
so that they can be restored along with other
saved game data in order to retain game state.
world_lookup
world_lookup
Defined in: adventure/Game.js, line 204
world_lookup
stores a lookup table
containing indexed keywords for all game assets.
world_lookup_highest_count
world_lookup_highest_count
Defined in: adventure/Game.js, line 211
world_lookup_highest_count
stores the
longest word count found in world_lookup, which is
used for iterating through world_lookup from longest
to shortest.