Created
April 11, 2013 05:58
-
-
Save scan/5361070 to your computer and use it in GitHub Desktop.
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
let player = proc j -> do | |
sx <- keySpeed GLFW.LEFT GLFW.RIGHT 500 -< () | |
let gravity = (0, 9.8) | |
jump <- pure (0, (-100)) . holdFor 0.1 (keyPressed ' ') <|> pure (0, 0) -< sx | |
v <- integral_ (0,0) -< gravity ^+^ jump | |
(dx, dy) <- integralLim_ collision (0,0) -< (v ^+^ (sx, 0), ()) | |
returnA -< renderSprites [Sprite img (realToFrac dx, realToFrac dy) 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment