Skip to content

Instantly share code, notes, and snippets.

@ddrone
Created February 9, 2014 14:51
Show Gist options
  • Save ddrone/8900151 to your computer and use it in GitHub Desktop.
Save ddrone/8900151 to your computer and use it in GitHub Desktop.
import Window
import Mouse
fpsCount = 35
delta = fps fpsCount
time = foldp (+) 0.0 delta
timeSeconds = (\ x -> x / 1000.0) <~ time
black = rgb 0 0 0
display (w, h) (x, y) t =
container w h middle <| collage w h
[ rect 50 50 |>
filled black |>
move (toFloat (x - w `div` 2), toFloat (-y + h `div` 2)) |>
rotate t ]
main = display <~ Window.dimensions ~ Mouse.position ~ timeSeconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment