diff options
author | Joris | 2016-09-04 15:52:17 +0200 |
---|---|---|
committer | Joris | 2016-09-04 15:53:32 +0200 |
commit | 8714c3befcf3f9923cf72e8d992ba6d963c0e6e7 (patch) | |
tree | e5ab35a918a95cbfee2f90dc34f3fe57fac42593 /src/Main.elm | |
parent | cda08750ac7cdd83e73c1110800bea39928ffed9 (diff) |
Upgrade to elm 0.17.1
Diffstat (limited to 'src/Main.elm')
-rw-r--r-- | src/Main.elm | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/src/Main.elm b/src/Main.elm index d257b81..c1bebf5 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -1,24 +1,28 @@ -module Main where - -import Random -import Html exposing (Html) - -import Model.Game exposing (Game, initialGame) - -import Update.Update exposing (update) - -import Input exposing (getInput) - -import View.Game exposing (renderGame) - -main : Signal Html -main = Signal.map renderGame game - -game : Signal Game -game = - Signal.foldp - update - (initialGame (Random.initialSeed initialTime)) - getInput - -port initialTime : Int +module Main exposing + ( main + ) + +import Html.App exposing (programWithFlags) +import Time +import Keyboard +import Keyboard.Extra as Keyboard + +import Model exposing (init) +import Msg +import Update exposing (update) +import View exposing (view) + +main : Program Float +main = + programWithFlags + { init = init + , update = update + , subscriptions = (\model -> + Sub.batch + [ Time.every 40 Msg.Time + , Sub.map Msg.Keyboard Keyboard.subscriptions + , Keyboard.downs (\keycode -> if keycode == 69 then Msg.Transform else Msg.NoOp) + ] + ) + , view = view + } |