Liquorice-0.0.1: Algorithmic Doom map generation

Copyright© Jonathan Dowland 2020
LicenseGPL-3
Maintainerjon+hackage@dow.land
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell98

Liquorice.Pure

Description

These Pure functions are the basic Liquorice primitives for constructing Liquorice programs that evaluate to Doom maps. Monadic equivalents are defined in Monad. Most people may find those more convenient.

Synopsis

Documentation

draw :: Int -> Int -> Context -> Context Source #

Define a line from the current location to a new one reached by moving forwards and sideways by the supplied amounts.

rightsector :: Int -> Int -> Int -> Context -> Context Source #

Define a new Sector on the right-hand side of the pen.

step :: Int -> Int -> Context -> Context Source #

Move the pen forwards and sideways by the supplied amounts.

turnright :: Context -> Context Source #

Rotate the pen to the right.

turnleft :: Context -> Context Source #

Rotate the pen to the left.

turnaround :: Context -> Context Source #

Rotate the pen 180°.

innerrightsector :: Int -> Int -> Int -> Context -> Context Source #

Define a new inner-Sector on the right-hand side of the pen.

innerleftsector :: Int -> Int -> Int -> Context -> Context Source #

Define a new inner-Sector on the left-hand side of the pen.

leftsector :: Int -> Int -> Int -> Context -> Context Source #

Define a new Sector on the left-hand side of the pen.

popsector :: Context -> Context Source #

Pop the last-defined Sector from the stack of defined Sectors and re-insert it at the bottom. It remains defined, but the second-last-defined Sector is promoted for subsequent operations that use the last-defined Sector.

thing :: Context -> Context Source #

Define a new Thing at the current pen location.

mid :: String -> Context -> Context Source #

Set the mid-texture value for future lines.

upper :: String -> Context -> Context Source #

Set the upper-texture value for future lines.

lower :: String -> Context -> Context Source #

Set the lower-texture value for future lines.

xoff :: Int -> Context -> Context Source #

Set the texture x-offset value for future lines.

yoff :: Int -> Context -> Context Source #

Set the texture y-offset value for future lines.

floorflat :: String -> Context -> Context Source #

Set the Sector floor texture for future Sectors.

ceil :: String -> Context -> Context Source #

Set the Sector ceiling texture for future Sectors.

linetype :: Int -> Int -> Context -> Context Source #

Set the type and tag values for future defined Lines.

sectortype :: Int -> Int -> Context -> Context Source #

Set the type and tag values for future defined Sectors.

setthing :: Int -> Context -> Context Source #

Set the type of future-defined Things.

mapname :: String -> Context -> Context Source #

Set the name of the current map.

box :: Int -> Int -> Int -> Int -> Int -> Context -> Context Source #

Define a rectangular Sector of the supplied size and properties.

ibox :: Int -> Int -> Int -> Int -> Int -> Context -> Context Source #

Define a rectangular inner-Sector of the supplied size and properties, parented to the last-drawn Sector.

pushpop :: (Context -> Context) -> Context -> Context Source #

Evaluate fn and then re-define the location to the value it was prior to evaluation.

place :: Int -> Int -> (Context -> Context) -> Context -> Context Source #

Evaluate fn at a location offset of (x,y) from the current pen location and then move the pen location back by the same relative amount.

addLine :: Line -> Context -> Context Source #

Check intersections against all existing lines