Interface GridEngineConfigHeadless

Configuration object for initializing GridEngineHeadless.

interface GridEngineConfigHeadless {
    cacheTileCollisions?: boolean;
    characterCollisionStrategy?: CollisionStrategy;
    characters: CharacterDataHeadless[];
    collisionGroupRelation?: Record<string, string[]>;
    collisionTilePropertyName?: string;
    numberOfDirections?: NumberOfDirections;
}

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: CharacterDataHeadless[]

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'
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}