Your browser does not support HTML5 canvas. Fork me on GitHub

Available Packages:

TerrainUtils

Source

int TILES_COUNT

Source

int TILES_X

Source

int TILES_Y

Source

function tile.addHeight(real val) returns terraindeformation

Source

function vec2.addTerrainHeight(real val) returns terraindeformation

Source

Applies a single terrain deformation to closest tile. Is not immediate. Reports shows that this may cause desync with Mac players.

function tile.getHeight() returns real

Source

function vec2.getTerrainNormal(real sampleRadius) returns vec3

Source

Returns the (not normalised) terrain-normal at the given point

function vec2.getTerrainType() returns int

Source

function vec2.getTerrainVariance() returns int

Source

function vec2.getTile() returns tile

Source

Returns the tile which given vec2 belongs to.

function tile.getType() returns int

Source

function tile.getVariance() returns int

Source

function tile.getX() returns real

Source

function tile.getY() returns real

Source

function vec2.isTerrainDeepWater() returns boolean

Source

function vec2.isTerrainLand() returns boolean

Source

function vec2.isTerrainPathable(pathingtype ttype) returns boolean

Source

Returns if a specific pathingtype is set at the location. Note: Returns true if the pathingtype is *not* set, false if it *is* set.

function vec2.isTerrainPlatform() returns boolean

Source

function vec2.isTerrainShallowWater() returns boolean

Source

function vec2.isTerrainWalkable() returns boolean

Source

function tile.setPathing(pathingtype ttype, boolean flag)

Source

Fills the entire tile (128x128 rect around tile pos) with given type

function vec2.setTerrainPathable(pathingtype ttype, boolean flag)

Source

Fills 32x32 rect around vec2 with given pathing type

function vec2.setTerrainType(int ttype, int variation, int area, int shape)

Source

function tile.setType(int ttype, int variation)

Source

function tile.setType(int ttype)

Source

function setWaterBaseColor(colorA color)

Source

function tile(int id) returns tile

Source

represents a single terrain tile can also be used as vec2 <-> int conversion

function tile(int x, int y) returns tile

Source

function tile(real x, real y) returns tile

Source

function vec2.toTileCenter() returns vec2

Source

Returns center of the Tile which given vec2 belongs to.

function tile.toVec2() returns vec2

Source