Copyright | (C) 2013 Fumiaki Kinoshita |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
- tick :: (Monad f, MonadFree f m) => m ()
- foreverTick :: (Monad f, MonadFree f m) => m a -> m any
- foreverFrame :: (Monad f, Monad m, MonadTrans t, MonadFree f (t m)) => m a -> t m any
- untick :: (Monad m, FreeGame m) => IterT Frame a -> m (Either (IterT Frame a) a)
- untickInfinite :: (Monad m, FreeGame m) => IterT Frame Void -> m (IterT Frame Void)
- randomness :: (Random r, FromFinalizer m) => (r, r) -> m r
- degrees :: Floating a => a -> a
- radians :: Floating a => a -> a
- unitV2 :: Floating a => a -> V2 a
- angleV2 :: RealFloat a => V2 a -> a
- loadPictureFromFile :: (Picture2D p, FromFinalizer m) => FilePath -> m (p ())
- loadBitmaps :: FilePath -> Q [Dec]
- loadBitmapsWith :: ExpQ -> FilePath -> Q [Dec]
- charToKey :: Char -> Key
- keyChar :: Keyboard f => Char -> f Bool
- keySpecial :: Keyboard f => Key -> f Bool
Controlling
foreverTick :: (Monad f, MonadFree f m) => m a -> m any Source
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 any Source
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
.
Random
randomness :: (Random r, FromFinalizer m) => (r, r) -> m r Source
Get a given range of value.
Helper
Loading
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. On base >= 4.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
FIXME: This may cause name duplication if there are multiple non-alphanumeric file names.
Keyboard
keySpecial :: Keyboard f => Key -> f Bool Source
Deprecated: use keyPress instead