helm-0.2.0: 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

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 $ do
   dims <- Window.dimensions

   return $ fmap render dims

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