used for state() and returnState(), builds states that are returnable. Stacking two states is destructive.
List of objects that block this object
List of objects that this object blocks
reference to the physics body (matter.js). Empty if physics is not enabled
how the object is bounded in the scene (set with scene.setBoundaries())
are the bounds active on this object?
true if the object is convex, false otherwise
coordinates of the sprite, or the top left most point of the sprite
Game object options of the game object (for serialization and recreation)
height of the sprite
Hitbox of the object, if the object is a square
unique ID for each object
url of the image to use for the sprite
True if the object is the local player, false otherwise
The GameObject that "listens" to the sound. Sound volume will be determined by distance to this game object
Meta data of the object
boolean if physics is enabled on the object
options for the physics engine
Reference point to pin the object to (only applies if the object is pinned)
does nothing!
points of the object (used for collision detection)
The Sound instance that the SoundEmitterPolygon plays
the image element to use for the sprite
true if the sprite is loaded, false otherwise
True if the object is a square, false otherwise
type of the object, either "gameObject", "sprite", or "polygon"
width of the sprite
Applies a force to the object (only works if physics enabled)
The force vector to apply to the object
Checks for a collision with another object
The object to check for a collision with
Boolean, true of the object is colliding with the other object, false otherwise
Checks for a collision with a polygon
The polygon (lower case, not type Polygon) to check for a collision with
Boolean, true of the object is colliding with the other object, false otherwise
Draws the sprite onto the provided drawing context. This is handled automatically with scene and scene managers
The DrawOptions for the object
Draws the object's label on top of the object The label is the objects meta label (eg: object.meta.label = "...")
The DrawOptions for the object
Top level move function (works with both physics enabled and disabled)... needs helper functions getWidth(), getHeight() to be defined. Recommended to re-write based on your use case (if extending)
Vector to move the object by
If set to false, the object will not move if physics are not enabled. If true, the object will move if physics are not enabled. True by defualt
Boolean, true if the move was successful, false if it was not (if it was out of bounds, it will not move)
Moves an object that has physics enabled by a vector (no forces pr boundaries involved)
The vector to move the object by
Whether the object was moved or not (if it was out of bounds, it will not move)
Modifies pin to a game object
The game object to pin to
The reference point to pin to (either "center" or "coordinates")
Returns the object as a JSON object
The object as a JSON object
Static
FromGenerated using TypeDoc
Classdesc
SoundEmitterSprite class, used for emitting sounds from a Sprite. This treats the Sprite as a sort of speaker
Example