LambdaHack-0.4.101.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.Fov.Digital

Contents

Description

DFOV (Digital Field of View) implemented according to specification at http://roguebasin.roguelikedevelopment.org/index.php?title=Digital_field_of_view_implementation. This fast version of the algorithm, based on PFOV, has AFAIK never been described nor implemented before.

Synopsis

Documentation

scan Source

Arguments

:: Distance

visiblity distance

-> (Bump -> Bool)

clear tile predicate

-> [Bump] 

Calculates the list of tiles, in Bump coordinates, visible from (0, 0), within the given sight range.

Internal operations

dline :: Bump -> Bump -> Line Source

Create a line from two points. Debug: check if well-defined.

dsteeper :: Bump -> Bump -> Bump -> Bool Source

Compare steepness of (p1, f) and (p2, f). Debug: Verify that the results of 2 independent checks are equal.

intersect :: Line -> Distance -> (Int, Int) Source

The X coordinate, represented as a fraction, of the intersection of a given line and the line of diagonals of diamonds at distance d from (0, 0).

_debugSteeper :: Bump -> Bump -> Bump -> Bool Source

Debug functions for DFOV:

Debug: calculate steeper for DFOV in another way and compare results.

_debugLine :: Line -> (Bool, String) Source

Debug: check if a view border line for DFOV is legal.