diff options
Diffstat (limited to 'src/View/Game.elm')
-rw-r--r-- | src/View/Game.elm | 37 |
1 files changed, 19 insertions, 18 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 |