LambdaHack- A game engine library for roguelike dungeon crawlers

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.

scan Source


:: (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).