aboutsummaryrefslogtreecommitdiff
path: root/src/View
diff options
context:
space:
mode:
Diffstat (limited to 'src/View')
-rw-r--r--src/View/Game.elm37
-rw-r--r--src/View/Page.elm16
-rw-r--r--src/View/Round.elm4
-rw-r--r--src/View/Time.elm2
4 files changed, 30 insertions, 29 deletions
diff --git a/src/View/Game.elm b/src/View/Game.elm
index ad0e9ea..ab9eee4 100644
--- a/src/View/Game.elm
+++ b/src/View/Game.elm
@@ -4,21 +4,21 @@ module View.Game
import List
-import Graphics.Collage (..)
-import Graphics.Element (Element)
-import Color (..)
-import Text (..)
+import Graphics.Collage exposing (..)
+import Graphics.Element exposing (Element)
+import Color exposing (..)
+import Text exposing (..)
import Text
-import Time (Time)
+import Time exposing (Time)
-import Model.Vec2 (Vec2)
-import Model.Player (..)
-import Model.Game (Game)
-import Model.Point (..)
-import Model.Config (..)
-import Model.Round (..)
+import Model.Vec2 exposing (Vec2)
+import Model.Player exposing (..)
+import Model.Game exposing (Game)
+import Model.Point exposing (..)
+import Model.Config exposing (..)
+import Model.Round exposing (..)
-import View.Round (roundView)
+import View.Round exposing (roundView)
gameView : Game -> Element
gameView game =
@@ -78,11 +78,13 @@ scoreForm boardSize currentRoundTime rounds score =
{ x = 0.0
, y = boardSize.y / 2 - 35
}
- in if currentRoundTime < 5000 && (not (List.isEmpty rounds))
+ in if currentRoundTime < 5000
then
- List.head rounds
- |> roundView
- |> textForm scorePos
+ case List.head rounds of
+ Just round ->
+ textForm scorePos (roundView round)
+ Nothing ->
+ textForm scorePos (toString score)
else
textForm scorePos (toString score)
@@ -93,9 +95,8 @@ textForm pos content =
|> typeface ["calibri", "arial"]
|> Text.color textColor
|> bold
- |> centered
in textElement
- |> toForm
+ |> text
|> move (pos.x, pos.y)
textColor : Color
diff --git a/src/View/Page.elm b/src/View/Page.elm
index 88b641e..3468019 100644
--- a/src/View/Page.elm
+++ b/src/View/Page.elm
@@ -3,18 +3,18 @@ module View.Page
) where
import List
-import String (append)
+import String exposing (append)
-import Html (..)
-import Html.Attributes (..)
+import Html exposing (..)
+import Html.Attributes exposing (..)
import Html.Attributes as A
-import Json.Encode (string)
+import Json.Encode exposing (string)
-import Model.Game (Game)
-import Model.Round (..)
+import Model.Game exposing (Game)
+import Model.Round exposing (..)
-import View.Game (gameView)
-import View.Round (roundView)
+import View.Game exposing (gameView)
+import View.Round exposing (roundView)
pageView : Game -> Html
pageView game =
diff --git a/src/View/Round.elm b/src/View/Round.elm
index 81f4f8c..2648aa8 100644
--- a/src/View/Round.elm
+++ b/src/View/Round.elm
@@ -2,9 +2,9 @@ module View.Round
( roundView
) where
-import Model.Round (..)
+import Model.Round exposing (..)
-import View.Time (timeView)
+import View.Time exposing (timeView)
roundView : Round -> String
roundView round =
diff --git a/src/View/Time.elm b/src/View/Time.elm
index 363a0b6..e6cfad6 100644
--- a/src/View/Time.elm
+++ b/src/View/Time.elm
@@ -2,7 +2,7 @@ module View.Time
( timeView
) where
-import Time (Time)
+import Time exposing (Time)
timeView : Time -> String
timeView time =