aboutsummaryrefslogtreecommitdiff
path: root/src/Main.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.elm')
-rw-r--r--src/Main.elm52
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
+ }