Skip to content

Instantly share code, notes, and snippets.

@levjj
Created May 17, 2014 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save levjj/5ae33513d039720762e0 to your computer and use it in GitHub Desktop.
Save levjj/5ae33513d039720762e0 to your computer and use it in GitHub Desktop.
import Window
tick : Signal Float
tick = (((+) 100) . toFloat . ((flip mod) 100)) <~ count (fps 25)
shape : Float -> Form
shape i = ngon 5 20
|> filled (hsva (i / 16) 0.5 1.0 1.0)
|> rotate (64 / i)
|> scale (i / 10)
scene : Float -> [Form]
scene i = if i < 4 then []
else [shape i] ++ scene (i / 2)
main : Signal Element
main = let dims = Window.dimensions
in collage <~ (fst <~ dims) ~ (snd <~ dims) ~ (scene <~ tick)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment