FunGEn-0.3: FUNctional Game ENgine

Graphics.UI.Fungen.Game

Description

This FunGEn module contains some important game routines.

Synopsis

Documentation

data Game t s u v Source

A game has the type Game t s u v, where

  • t is the type of the game special attributes
  • s is the type of the object special attributes
  • u is the type of the game levels (state)
  • v is the type of the map tile special attribute, in case we use a Tile Map as the background of our game

A game consists of:

data IOGame t s u v a Source

A game action has the type IOGame t s u v a, where t, s, u and v are as for Game and a is the type returned by each action of the game (such as the Int for IO Int). The name IOGame was chosen to remind that each action deals with a Game, but an IO operation can also be performed between game actions (such as the reading of a file or printing something in the prompt).

Instances

Monad (IOGame t s u v) 

runIOGame :: IOGame t s u v a -> Game t s u v -> IO (Game t s u v, a)Source

runIOGameM :: IOGame t s u v a -> Game t s u v -> IO ()Source

liftIOtoIOGame :: IO a -> IOGame t s u v aSource

liftIOtoIOGame' :: (a -> IO ()) -> a -> IOGame t s u v ()Source

setGameState :: u -> IOGame t s u v ()Source

getGameFlags :: IOGame t s u v GameFlagsSource

setGameFlags :: GameFlags -> IOGame t s u v ()Source

createGame :: GameMap v -> [ObjectManager s] -> WindowConfig -> u -> t -> FilePictureList -> IO (Game t s u v)Source

printOnPrompt :: Show a => a -> IOGame t s u v ()Source

randomInt :: (Int, Int) -> IOGame t s u v IntSource

wait :: Int -> IOGame t s u v ()Source