Created
August 20, 2016 17:24
-
-
Save tibastral/0594315d709c775ef4a2398c54db5835 to your computer and use it in GitHub Desktop.
This file contains 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
step : Game -> Position -> Game | |
step game arrows = | |
game | |
|> handleWinning | |
|> handleLoosing | |
|> stepCharacter arrows | |
|> stepEnemies | |
isWinning : Game -> Bool | |
isWinning { character, goal } = | |
character |> Character.collision goal | |
handleWinning : Game -> Game | |
handleWinning game = | |
game | |
|> ifonly isWinning (game |> win) | |
isLoosing : Game -> Bool | |
isLoosing { character, enemies } = | |
enemies |> any (Character.collision character) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment