porymap
porymap copied to clipboard
Add rawValue overload of setBlock, handle all possible collision values
- Collision is a 2 bit value, and
setBlock
/setCollision
allow users to assign any value in this range. Porymap incorrectly renders collisions of 2 or 3 as the entire collision/elevation image. The games treat any nonzero collision value as "impassable," and now so does Porymap. - Adds an overload of
setBlock
that takes the raw value given bygetBlock
oronBlockChanged
, so you could more easily for instance disable drawing by doing:
export function onBlockChanged(x, y, prevBlock, newBlock) {
if (prevBlock.rawValue != newBlock.rawValue)
map.setBlock(x, y, prevBlock.rawValue);
}