Module
Graphics.Glapple
- Package
- purescript-glappleDEPRECATED
- Repository
- yukikurage/purescript-glapple
Re-exports from Graphics.Glapple.Data.Event
Re-exports from Graphics.Glapple.Data.GameId
#renderGame Source
renderGame :: forall s i. GameId s i -> Picture s
Draw the game.
#null Source
null :: forall s i m. MonadEffect m => GameId s i -> m Boolean
Returns True if GameId is empty.
#emptyGameId Source
emptyGameId :: forall m s i. Bind m => MonadEffect m => m (GameId s i)
Empty GameId.
Re-exports from Graphics.Glapple.Data.GameSpec
#mkInitGameStateM Source
mkInitGameStateM :: forall f a. Applicative f => a -> f a
#mkHandlerM Source
mkHandlerM :: forall a sprite gameState i output. (a -> gameState -> gameState) -> a -> GlappleM sprite gameState i output Unit
#mkGameSpecM Source
mkGameSpecM :: forall gameState sprite input output. GameSpec sprite gameState input -> GameSpecM sprite gameState input output
Convert GameSpec to GameSpecM.
Re-exports from Graphics.Glapple.Data.GameSpecM
#CanvasSpec Source
type CanvasSpec = { height :: Number, width :: Number }
#defaultRender Source
defaultRender :: forall m s. Applicative m => m (Picture s)
#defaultHandler Source
defaultHandler :: forall m a. Applicative m => a -> m Unit
Re-exports from Graphics.Glapple.GameRunner
#runGame Source
runGame :: forall sprite gameState input. Ord sprite => Number -> CanvasElement -> CanvasSpec -> Array (SpriteData sprite) -> GameSpec sprite gameState input -> Effect (GameId sprite input)
A pure version of runGame.
#runChildGame Source
runChildGame :: forall s g i o childG childI. GameSpec s childG childI -> GlappleM s g i o (GameId s childI)
A pure version of runChildGame.
Re-exports from Graphics.Glapple.GameRunnerM
#runGameWithM_ Source
runGameWithM_ :: forall s g i o childG childI childO. GameId s childI -> GameSpecM s childG childI childO -> GlappleM s g i o Unit
runGameWithM without outputHandler
#runGameM_ Source
runGameM_ :: forall s g i o. Ord s => Number -> CanvasElement -> CanvasSpec -> Array (SpriteData s) -> GameSpecM s g i o -> Effect (GameId s i)
runGameM without outputHandler
#runGameM Source
runGameM :: forall s g i o. Ord s => Number -> CanvasElement -> CanvasSpec -> Array (SpriteData s) -> GameSpecM s g i o -> (o -> Effect Unit) -> Effect (GameId s i)
Making Games at the Top Level.
#runChildGameM_ Source
runChildGameM_ :: forall s g i o childG childI childO. GameSpecM s childG childI childO -> GlappleM s g i o (GameId s childI)
Re-exports from Graphics.Glapple.GlappleM
#putGameState Source
putGameState :: forall s g i o. g -> GlappleM s g i o Unit
Put game state
#modifyGameState Source
modifyGameState :: forall s g i o. (g -> g) -> GlappleM s g i o Unit
Modify function to game state
#getMousePosition Source
getMousePosition :: forall s g i o. GlappleM s g i o (Maybe { mouseX :: Number, mouseY :: Number })
Gets the current mouse position. Returns Nothing if the mouse position cannot be obtained because the user has not moved the mouse yet.
#getLocalTime Source
getLocalTime :: forall s g i o. GlappleM s g i o Number
Get the time since the current game was started.
#getKeyState Source
getKeyState :: forall s g i o. KeyCode -> GlappleM s g i o Boolean
Gets the current key press state.
#getGlobalTime Source
getGlobalTime :: forall s g i o. GlappleM s g i o Number
Get the time since the root game was started.
#getGameState Source
getGameState :: forall s g i o. GlappleM s g i o g
Get current game state.
- Modules
- Graphics.
Glapple - Graphics.
Glapple. Data. Emitter - Graphics.
Glapple. Data. Event - Graphics.
Glapple. Data. GameId - Graphics.
Glapple. Data. GameSpec - Graphics.
Glapple. Data. GameSpecM - Graphics.
Glapple. Data. InternalRegistrationIds - Graphics.
Glapple. Data. Picture - Graphics.
Glapple. Data. SpriteData - Graphics.
Glapple. GameRunner - Graphics.
Glapple. GameRunnerM - Graphics.
Glapple. GlappleM