brillo-1.13.3: Painless 2D vector graphics, animations, and simulations powered by GLFW
Safe HaskellSafe-Inferred
LanguageGHC2021

Brillo.Interface.IO.Game

Description

This game mode lets you manage your own input. Pressing ESC will not abort the program. You also don't get automatic pan and zoom controls like with display.

Synopsis

Documentation

playIO Source #

Arguments

:: forall world. Display

Display mode.

-> Color

Background color.

-> Int

Number of simulation steps to take for each second of real time.

-> world

The initial world.

-> (world -> IO Picture)

An action to convert the world a picture.

-> (Event -> world -> IO world)

A function to handle input events.

-> (Float -> world -> IO world)

A function to step the world one iteration. It is passed the period of time (in seconds) needing to be advanced.

-> IO () 

Play a game in a window, using IO actions to build the pictures.

data Event Source #

Possible input events.

Instances

Instances details
Show Event Source # 
Instance details

Defined in Brillo.Internals.Interface.Event

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Eq Event Source # 
Instance details

Defined in Brillo.Internals.Interface.Event

Methods

(==) :: Event -> Event -> Bool #

(/=) :: Event -> Event -> Bool #

data Key Source #

Instances

Instances details
Show Key Source # 
Instance details

Defined in Brillo.Internals.Interface.Backend.Types

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

Eq Key Source # 
Instance details

Defined in Brillo.Internals.Interface.Backend.Types

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Ord Key Source # 
Instance details

Defined in Brillo.Internals.Interface.Backend.Types

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #