helm-0.5.0: A functionally reactive game engine.

Safe HaskellNone

FRP.Helm.Time

Contents

Description

Contains functions for composing units of time and signals that sample from the game clock.

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.

Composing

millisecond :: TimeSource

A time value representing one millisecond.

second :: TimeSource

A time value representing one second.

minute :: TimeSource

A time value representing one minute.

hour :: TimeSource

A time value representing one hour.

inMilliseconds :: Time -> DoubleSource

Converts a time value to a fractional value, in milliseconds.

inSeconds :: Time -> DoubleSource

Converts a time value to a fractional value, in seconds.

inMinutes :: Time -> DoubleSource

Converts a time value to a fractional value, in minutes.

inHours :: Time -> DoubleSource

Converts a time value to a fractional value, in hours.

fps :: Int -> TimeSource

Converts a frames-per-second value into a time value.

Clock State

running :: SignalGen (Signal Time)Source

A signal that returns the time that the game has been running for when sampled.

delta :: SignalGen (Signal Time)Source

A signal that returns the time since it was last sampled when sampled.

delay :: Time -> SignalGen (Signal Time)Source

A signal that blocks the game thread for a certain amount of time when sampled and then returns the amount of time it blocked for. Please note that delaying by values smaller than 1 millisecond can have platform-specific results.