helm-0.4: A functionally reactive game engine.

Safe HaskellNone

FRP.Helm

Contents

Description

Contains miscellaneous utility functions and the main functions for interfacing with the engine.

Synopsis

Types

type Time = DoubleSource

A type describing an amount of time in an arbitary unit. Use the time composing/converting functions to manipulate time values.

Engine

run :: SignalGen (Signal Element) -> IO ()Source

Initializes and runs the game engine. The supplied signal generator is constantly sampled for an element to render until the user quits.

 import FRP.Helm
 import qualified FRP.Helm.Window as Window

 render :: (Int, Int) -> Element
 render (w, h) = collage w h [filled red $ rect (fromIntegral w) (fromIntegral h)]

 main :: IO ()
 main = run $ fmap (fmap render) Window.dimensions

Utilities

radians :: Double -> DoubleSource

Converts radians into the standard angle measurement (radians).

degrees :: Double -> DoubleSource

Converts degrees into the standard angle measurement (radians).

turns :: Double -> DoubleSource

Converts turns into the standard angle measurement (radians). Turns are essentially full revolutions of the unit circle.

Prelude