diff options
author | Joris Guyonvarch | 2015-05-10 16:59:08 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-05-10 16:59:08 +0200 |
commit | 5af770bd99dbb57d78857236c054bc0a6dc4bdfd (patch) | |
tree | a15a021df539302767281296c66bb8fdf2d0bae1 /src/View/Game.elm | |
parent | d5ec91d4d01db6f4d476522d5b14e116435ebb7d (diff) |
Updating elm version to 0.15
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 |