LambdaHack-0.2.8: A roguelike game engine in early and active development

Safe HaskellNone



A restrictive variant of Recursive Shadow Casting FOV with infinite range. It's not designed for dungeons with diagonal walls and so here they block visibility, though they don't block movement. The main advantage of the algorithm is that it's very simple and fast.



type SBump = (Progress, Distance)Source

Rotated and translated coordinates of 2D points, so that they fit in the same single octant area.

type Interval = (Rational, Rational)Source

The area left to be scanned, delimited by fractions of the original arc. Interval (0, 1) means the whole 45 degrees arc of the processed octant is to be scanned.



:: (SBump -> Bool)

clear tile predicate

-> Distance

the current distance from (0, 0)

-> Interval

the current interval to scan

-> [SBump] 

Calculates the list of tiles, in SBump coordinates, visible from (0, 0).