v2.0.0
This brings in many changes, some breaking, to clean up the code and make it easier to maintain and use. It also improves the algorithm for several edge cases.
- Geometry code extracted into a separate package at (
tiled-geometry
) - Clean up repository and npm package (no need for npm-build code to be in repo, and no need for TypeScript source to be in the package)
- Stricter linting
- Demo code is now included in this repo
- API changes (see below)
- Algorithm changes (see below)
API: Some exposed type names have changed, computeFieldOfView
is now a non-member function, and the return type is now FieldOfView
instead, with clearer method names.
Algorithm:
- FieldOfView puts the player at
0,0
, because offsets in the field do not necessarily correspond to offsets in a map - The shadowcasting now tracks sight-lines even beyond vision obstacles, so that even tiles that are in shadow can be located on some map. This is necessary to enable games to display the player's "memory", i.e. what a tile looked like last time the player could see it. Overall that looks much better on screen than a bunch of blank tiles.
- Better resolution of tiles that can be seen through multiple warps.