helm-0.5.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

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.

data EngineConfig Source

A data structure describing miscellaneous initial configurations of the game window and engine.

Engine

run :: EngineConfig -> 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 [rect (fromIntegral w) (fromIntegral h) |> filled red]

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

defaultConfig :: EngineConfigSource

Creates the default configuration for the engine. You should change the fields where necessary before passing it to run.

Prelude