Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
Tutorial showing a list of public functions for getting $is(). tutorial, custom code, public functions, $is()

Public Functions:Asset.$is Function

asset.$is() is a broad utility function that houses shortcuts for accessing various tangible asset properties. Note that this method only works for assets in the Tangible class tree, and will return null for other asset classes.

  • MyGame.$("asset").$is("in", "asset name") {String} a preposition or property {String} an optional asset name or id Boolean Some of the methods here may be redundant to other shortcut methods. Feel free to use whichever method makes more sense to you.
    • MyGame.$("asset").$is("in", "other asset") accepts any preposition, asking, is this asset in that aspect of that asset?
    • MyGame.$("asset").$is("behind") accepts a preposition without an asset, asking, is this asset [preposition] any asset?
    • MyGame.$("asset").$is("nested in", "other asset") nested in, specific to character classes, asking, is this asset nested in that asset? For instance, is player on trapdoor?
    • MyGame.$("asset").$is("closed") asking, is this asset closed?
    • MyGame.$("asset").$is("locked") asking, is this asset locked?
    • MyGame.$("asset").$is("plugged") asking, is this asset plugged?
    • MyGame.$("asset").$is("sealed") asking, is this asset sealed?
    • MyGame.$("asset").$is("zipped") asking, is this asset zipped?
    • MyGame.$("asset").$is("open") asking, is this asset open?
    • MyGame.$("asset").$is("empty") asking, is this asset empty? This considers tangible assets and substances in all aspects.
    • MyGame.$("asset").$is("unlocked") asking, is this asset unlocked?
    • MyGame.$("asset").$is("unplugged") asking, is this asset unplugged?
    • MyGame.$("asset").$is("unsealed") asking, is this asset unsealed?
    • MyGame.$("asset").$is("held", "other asset") asking, is this asset held by that asset, as in a bannister held by player?
    • MyGame.$("asset").$is("holding", "other asset") asking, is this asset holding that asset, as in player holding a rope?
    • MyGame.$("asset").$is("worn") asking, is this asset being worn?
    • MyGame.$("asset").$is("wearing", "other asset") asking, is this asset wearing the other asset?
    • MyGame.$("asset").$is("arbitrary_property") asking, does this asset have asset.is.arbitrary_property and is that property set to true? Will return false if the asset does not have the property and will not error.