State is a special class used
for storing general state variables. For example,
is used to store states such as
This is done chiefly for organizational purposes. With hundreds of
properties per asset, it seemed cleaner
to group similar types of properties into clusters and access them
through dot notation, rather than leave hundreds of properties
floating around the top level of each object. The reason to make it a
classed object rather than a generic object (as we do for some collections)
is so we can add prototype methods and properties that have access to scope
this (meaning the parent asset) and
(the top level game object).
State containers and their values are passed down the inheritance chain. For example: Tangible inherits from Asset, and asset.is.global is available on tangible.is.global. It's also possible to override inherited nested properties. For example: Exit inherits tangible.is.closed and tangible.is.locked, but overrides them with new definitions in order to account for Exit's relationship to the linked class Aperture.
var foo = new adventurejs.State(game_name, name)
Name of top level game instance that is scoped to window.