Last active
August 29, 2015 14:16
-
-
Save sroccaserra/770c4e98f5e44d3b17d6 to your computer and use it in GitHub Desktop.
Simple time updated point, try it here: http://elm-lang.org/try
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Graphics.Element exposing (Element, show) | |
| import Signal exposing (Signal, map, foldp) | |
| import Time exposing (fps) | |
| type alias Point = {x: Float, y: Float} | |
| main : Signal Element | |
| main = | |
| map show <| foldp update {x=0, y=0} (fps 30) | |
| update : Float -> Point -> Point | |
| update dt g = | |
| {g | x <- g.x + dt} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment