Interface GridEngineConfig

Configuration object for initializing GridEngine.

interface GridEngineConfig {
    cacheTileCollisions?: boolean;
    characterCollisionStrategy?: CollisionStrategy;
    characters: CharacterData[];
    collisionGroupRelation?: Record<string, string[]>;
    collisionTilePropertyName?: string;
    layerOverlay?: boolean;
    numberOfDirections?: NumberOfDirections;
    tiledProject?: TiledProject;
}

Hierarchy (view full)

Properties

cacheTileCollisions?: boolean

Specifies, whether a tile collision cache should be used. It can make pathfinding significantly faster. However, if you change something on the tilemap (adding layers, changing tiles, etc.) you need to call GridEngineHeadless.rebuildTileCollisionCache. For more information on pathfinding performance check out pathfinding performance.

Default Value

false
characterCollisionStrategy?: CollisionStrategy

The character collision strategy.

Default Value

{@link CollisionStrategy.BLOCK_TWO_TILES}
characters: CharacterData[]

An array of character data. Each describing a character on the map.

collisionGroupRelation?: Record<string, string[]>

Specifies a custom collision group relation. You can define which group collides with which other groups.

Example: {'group1': ['group2', 'group3']} This means that group1 collides with group2 and group3 (but not with itself!). Also neither group2 nor group3 collide with group1, so the relation can be non-symmetric.

If this property is omitted, the default relation is that each group only collides with itself.

collisionTilePropertyName?: string

A custom name for the collision tile property of your tilemap.

Default Value

'ge_collide'
layerOverlay?: boolean

Enables experimental layer overlay feature.

Default Value

false

numberOfDirections?: NumberOfDirections

The possible number of directions for moving a character. Default is 4 (up, down, left, right). If set to 8 it additionaly enables diagonal movement (up-left, up-right, down-left, down-right).

Default Value

{@link NumberOfDirections.FOUR}
tiledProject?: TiledProject

Object, parsed from Tiled project file. This is used to provide Tiled project features like tile classes.