Optional onInput: ((dir, stopped, inputId, txnPromise) => void)Optional dispatchGameUpdate: ((delta) => void)Optional dispatchMapUpdate: ((mapId, map) => void)Optional options: GameOptionsPrivate _connectPrivate _connectedPrivate _initializedPrivate _onPrivate _timePrivate checkOptional debugPrivate disconnectOptional code: numberOptional reason: stringOptional dispatchOptional dispatchPrivate encOptional enginePrivate eventPrivate hasPrivate lastPrivate mapPrivate mapPrivate mapsPrivate playerOptional spacePrivate subscriptionsPrivate timePrivate Readonly updatePrivate cleanupOptional spawnToken: stringOptional targetId: stringplayer ID of the other
MoveDirection enum
Returns a list of all objects in the map matching a condition.
the map to be defined first - use game.waitForInit() to be sure it has been defined.
game.filterObjectsInMap("park-legacy", (obj) => obj.id.startsWith("password-door")); // finds all password doors in a map
The map you want to filter objects on. If there are no objects in the map, an empty array is returned.
A predicate that returns a truthy value if you want the object to be returned.
Returns a list of all objects in the entire space matching a condition. See filterObjectsInMap for an example
map data that is being searched to be defined first - use game.waitForInit() to get all known map data
A predicate that returns a truthy value if you want the object to be returned.
Returns a list of all players in the space based on player critera.
the players to be defined first - use game.waitForInit() to be sure it has been defined.
filterPlayersInSpace((player) => player.name === "Evelyn"); // returns the Player object for all players named Evelyn
A predicate that returns a truthy value if you want the player to be returned
Returns a list of all uids in the space for players matching a condition.
the players to be defined first - use game.waitForInit() to be sure it has been defined.
filterUidsInSpace((player) => player.name === "Evelyn"); // returns the uid for all players named Evelyn
A predicate that returns a truthy value if you want the uid to be returned
Adds a "Quake" effect to the given target. This shakes it around a little bit before settling back into position.
Optional mode: numberReturns this game instance's player if they are defined, throwing an error if the client is not connected or the client's player has not be initialized
the game engine to be connected and initialized with the server
the game client to have entered
Returns all players that are in the same map as you.
the map and players to be defined first - use game.waitForInit() to be sure it has been defined.
game.getPlayersInMap("new office")
The string mapId you want to filter on
Utility function that returns true if a player is standing inside a given private space. Requires the map to be defined first - use game.waitForInit() to be sure it has been defined. You can pass this directly into filterPlayersInSpace using a thunk.
the map to be defined first - use game.waitForInit() to be sure it has been defined.
isPlayerInPrivateSpace(player, "new office", "library") // returns if a given player is in the library
filterPlayersInSpace((player) => isPlayerInPrivateSpace(player, "new office", "library")); // finds everyone on that tile
A Partial referencing the player
the map the private tile is in
the name of the private space you put in the mapmaker
Optional targetId: stringOptional txnTimeout: numberAnimates an object moving from its current position to targetWorldPos.
Also handles setting the object's new position in the map itself.
Optional xOptional yUtility function for map developers that plays a sound file on the client, once. Use targetId if you are a space owner to play a sound on another client. If no sound is specified, it plays for the entire space. You must be a space owner to play a sound on the whole space.
HTMl5 compliant audio resource, e.g a URL to a mp3
scalar volume from 0 to 1.0
Optional targetId: stringid of another player you want to play the sound on
Optional name: stringOptional currentlyEquippedWearables: DBOutfitOptional locationType: RespondToAccessRequest_LocationTypeEnumOptional txnTimeout: numberA promise if useTxn is true, otherwise nothing.
Optional useTxn: falseOptional txnTimeout: undefinedOptional useTxn: booleanOptional txnTimeout: numberOptional txnTimeoutMs: numberA promise if useTxn is true, otherwise nothing.
This function can ONLY BE CALLED WITH AN EXPLICIT actionId !!! You don't get type safety if it's not! (see below for more)
Optional useTxn: booleanOptional txnTimeoutMs: numberOptional endOption: PlayerStatusEndOptionOptional targetId: stringOptional params: { Optional desksOptional preferredOptional targetOptional targetId: stringUtility function for map developers that stops all sound file matching the src on the client, once. Use targetId if you are a space owner to stop a sound on another client. If no sound is specified, it stops the sounds for the entire space. You must be a space owner to play a sound on the whole space.
HTMl5 compliant audio resource, e.g a URL to a mp3
Optional targetId: stringid of another player you want to play the sound on
Calls a callback whenever the given event type is received. Does not send the subscription request to the server -- you have to declare those up front (see defaultSubscriptions).
Optional filter: ((data, context) => boolean)Private subscriptionOptional targetId: stringGenerated using TypeDoc
Deprecated