melonJS
    Preparing search index...

    Interface BodiesOptions

    how Grid.fromBodies reads a level's collision shapes

    interface BodiesOptions {
        cellShape?: CellShape;
        cols: number;
        rows: number;
        solid?: (renderable: Renderable) => boolean;
        tileHeight: number;
        tileWidth: number;
        weight?: (col: number, row: number) => number;
        x?: number;
        y?: number;
    }
    Index
    cellShape?: CellShape

    how cells sit in the world: "isometric" for an isometric map

    "square"
    
    cols: number

    columns

    rows: number

    rows

    solid?: (renderable: Renderable) => boolean

    which renderables are walls

    those with a WORLD_SHAPE body that collides with something: the collision shapes of a Tiled map's collision layer, and any body declared as one. The live body is read before its bodyDef, so a body changed at run time counts as it is now; one whose collision mask is NO_OBJECT (a door opened with setCollisionMask) blocks nothing, and is no wall.

    tileHeight: number

    a cell's height, in world units

    tileWidth: number

    a cell's width, in world units

    weight?: (col: number, row: number) => number

    what entering a cell costs, 1 or more

    1
    
    x?: number

    where the grid's top left corner is in the world

    0
    
    y?: number
    0