nyx-game-1.0.1.0: A bullet-hell game made with SDL2.

Safe HaskellNone
LanguageHaskell2010

Play.Engine.Scene

Synopsis

Documentation

data SceneF a Source #

Scene describes a generic interface for a game Scene * state: for the scene data * update: how to update the scene * render: how to render the scene

Constructors

SceneF 

Fields

data Scene Source #

Existentially Quantified Scene

Constructors

Scene (SceneF s) 

mkScene :: a -> (Input -> a -> Result (StackCommand, a)) -> (Renderer -> a -> IO ()) -> Scene Source #

Create a Scene from the interface

data StackCommand Source #

A command for the scene stack, to be returned by update

Constructors

Done

You can remove me from the stack

None

Keep me at the top of the stack

Push Scene

Push a new scene

Replace Scene

Replace me with a new scene

updateScenes :: Input -> Stack Scene -> Result ([Request], Stack Scene) Source #

Update the top state on the stack

updateScene :: Input -> Scene -> Result ([Request], (StackCommand, Scene)) Source #

Update an existentially quantified Scene

renderTopScene :: Renderer -> Stack Scene -> IO () Source #

Render the top scene on the stack