Module
Graphics.Glapple.GlappleM
- Package
- purescript-glappleDEPRECATED
- Repository
- yukikurage/purescript-glapple
#InternalState Source
type InternalState (s :: Type) g (i :: Type) o = { eventEmitter :: EmitterId Effect Event, gameStateRef :: Ref (Maybe g), initTimeRef :: Ref (Maybe Time), internalRegistrationIdsRef :: Ref (Maybe (InternalRegistrationIds s i o)), keyStateRef :: Ref (Set KeyCode), localInitTimeRef :: Ref (Maybe Time), mousePositionRef :: Ref (Maybe { mouseX :: Number, mouseY :: Number }), outputEmitter :: EmitterId Effect o }
Instances
MonadAsk (InternalState s g i o) (GlappleM s g i o)
#GlappleM Source
newtype GlappleM s g i o a
Constructors
GlappleM (ReaderT (InternalState s g i o) (MaybeT Effect) a)
Instances
Functor (GlappleM s g i o)
Apply (GlappleM s g i o)
Applicative (GlappleM s g i o)
Bind (GlappleM s g i o)
Monad (GlappleM s g i o)
MonadAsk (InternalState s g i o) (GlappleM s g i o)
MonadEffect (GlappleM s g i o)
#runGlappleM Source
runGlappleM :: forall s g i o a. GlappleM s g i o a -> InternalState s g i o -> Effect (Maybe a)
#getGameState Source
getGameState :: forall s g i o. GlappleM s g i o g
Get current game state.
#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
#getGlobalTime Source
getGlobalTime :: forall s g i o. GlappleM s g i o Number
Get the time since the root game was started.
#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.
- 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