This variable converts from normal_angle region (floor((angle-15)/30)) to in-game rotation.
Changes the map body according to a given collision layer index.
Target collision layer.
if true, it will also sort the sprites in the map after reordering the layers.
This function checks whether is necessary to stop when colliding or change the char direction in order to adapt its movement to the collision slope.
Clears all custom bodies.
Creates npcs and interactable objects collision groups.
the current map.
Configs collisions between hero, map, npcs and interactable objects.
the current collision layer.
Configs the world physics attributes.
Creates a custom body on interactable objects collision group. It can be a box, circle or polygon.
the custom body unique label name.
the x position of the body.
the y position of the body.
some properties regarding the type of the body.
The target collision layer for the body to be.
The height of the box.
The array of polygon points.
The radius of the circle.
The width of the box.
returns the created body.
Destroys a custom body.
the unique label of the body to be destroyed.
Disables collision between hero and map.
if true, disables collision by only setting the map shapes as a sensor.
Disables collision between hero and npcs.
if given, disables only on this layer.
Enables collision between hero and map.
if true, enables collision by only setting the map shapes as not a sensor.
Enables collision between hero and npcs.
if given, enables only on this layer.
Given a surface range, loop over the tiles in this range and find the intersection polygons for each tile.
the current map object.
the min x range in px.
the max x range in px.
the min y range in px.
the max y range in px.
The polygon. The first and last positions are equivalent, and they MUST contain identical values.
Returns a JS Map where its key is a location key and its value is the list of polygons for this location key.
Generated using TypeDoc
This class manages collision between the main concepts of the engine: map, hero, npcs and interactable objects.