Class: CollisionSquare

CollisionSquare

A collision settings in a texture square

new CollisionSquare ()

Properties:
Name Type Description
rect Array.<number> Percentage of the rect limitation
left boolean The left direction
right boolean The right direction
top boolean The top direction
bot boolean The bot direction

Methods

CollisionSquare.unionSquares (squares, l, w, h) static

Union of the collision squares
Name Type Description
squares Array.<Array.<number>> All the squares and their corresponding rects
l number The squares numbers
w number The number of squares width
h number The number of squares height

CollisionSquare.getBB (rect, w, h) static

Get the BB according to rect and size
Name Type Description
rect Array.<number> The rect
w number The number of squares width
h number The number of squares height

read (json)

Read the JSON associated to the collision square
Name Type Description
json Object Json object describing the collision square

hasAllDirections ()boolean

Indicate if all the direction are OK
Returns:
Type Description
boolean