free-game-1.0.4: Create games for free

MaintainerFumiaki Kinoshita <>
Safe HaskellNone







tick :: (Monad f, MonadFree f m) => m ()Source

Delimit the computation to yield a frame.

foreverTick :: (Monad f, MonadFree f m) => m a -> m anySource

Warning: In most cases, foreverFrame is good enough and fast.

An infinite loop that run tick every frame after the given action.

foreverFrame :: (Monad f, Monad m, MonadTrans t, MonadFree f (t m)) => m a -> t m anySource

foreverFrame :: Frame a -> Game any

untick :: (Monad m, FreeGame m) => IterT Frame a -> m (Either (IterT Frame a) a)Source

Extract the next frame of the action.

untickInfinite :: (Monad m, FreeGame m) => IterT Frame Void -> m (IterT Frame Void)Source

An infinite version of untick.


randomness :: (Random r, FromFinalizer m) => (r, r) -> m rSource

Get a given range of value.


degrees :: Floating a => a -> aSource

Convert radians to degrees.

radians :: Floating a => a -> aSource

Convert degrees to radians.

unitV2 :: Floating a => a -> V2 aSource

An unit vector with the specified angle.

angleV2 :: RealFloat a => V2 a -> aSource

An angle of the given vector.


loadPictureFromFile :: (Picture2D p, FromFinalizer m) => FilePath -> m (p ())Source

Create a Picture from the given file.

loadBitmaps :: FilePath -> Q [Dec]Source

Load and define all pictures in the specified directory. In GHC >= 7.6, file paths to actually load will be respect to the directory of the executable. Otherwise it will be based on the current directory.

loadBitmapsWith :: ExpQ -> FilePath -> Q [Dec]Source

The type of the given ExpQ must be FilePath -> IO FilePath


keySpecial :: Keyboard f => Key -> f BoolSource

Deprecated: use keyPress instead