GridCellsExitArea

Extends: ExitArea

A block of cells in a grid, e.g. a tile map's doorway. Cell [0, 0]'s low corner is at (originX, originY) and columns run along x.

Properties

  • originX (float)
  • originY (float) — z on the xz plane
  • cellSize (float)
  • col (integer)
  • row (integer)
  • cols (integer)
  • rows (integer)

Constructor

new GridCellsExitArea( originX: float, originY: float, cellSize: float, col: integer, row: integer, cols?: integer, rows?: integer, plane?: BGE.SeparationPlane, ): GridCellsExitArea

Parameters

  • originX (float) — x of cell [0, 0]'s low corner
  • originY (float) — y (z on the xz plane) of cell [0, 0]'s low corner
  • cellSize (float)
  • col (integer) — the block's first column
  • row (integer) — the block's first row
  • cols (integer, optional, default: 1)
  • rows (integer, optional, default: 1)
  • plane (BGE.SeparationPlane, optional, default: "BGE.SeparationPlane.xz")

Instance Methods

cellAt(position: BGE.Math.Vector): Array.<integer>

The cell a position is in, as [col, row].

Parameters

  • position (BGE.Math.Vector)

Returns

  • Array.<integer>

contains(position: BGE.Math.Vector): boolean

Parameters

  • position (BGE.Math.Vector)

Returns

  • boolean