From 5af770bd99dbb57d78857236c054bc0a6dc4bdfd Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 10 May 2015 16:59:08 +0200 Subject: Updating elm version to 0.15 --- src/View/Game.elm | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src/View/Game.elm') 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 -- cgit v1.2.3