gloss-1.7.8.3: Painless 2D vector graphics, animations and simulations.

Safe HaskellNone

Graphics.Gloss.Interface.Pure.Game

Description

This game mode lets you manage your own input. Pressing ESC will still abort the program, but you don't get automatic pan and zoom controls like with displayInWindow.

Synopsis

Documentation

playSource

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 -> Picture)

A function to convert the world a picture.

-> (Event -> world -> world)

A function to handle input events.

-> (Float -> world -> 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.

data Event Source

Possible input events.

Instances

data KeyState Source

Constructors

Down 
Up