UNPKG

matrix-map

Version:

A class object for to aid in the creation of 2D grid games.

11 lines (9 loc) 251 B
const getSouthNeighbor = function(id){ let southNeighbor = null; if(!this.southEdge.has(id)){ let edgeSize = Math.sqrt(this.size); southNeighbor = id+edgeSize; } return southNeighbor; } export default getSouthNeighbor