From 4710e5ac30c44ca8b48a0b2b60ea74b1573b084b Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 15 Nov 2015 19:20:42 +0100 Subject: Add levels which only change the board color every 20 points --- src/View/Game.elm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/View/Game.elm') diff --git a/src/View/Game.elm b/src/View/Game.elm index af7c8de..f99369d 100644 --- a/src/View/Game.elm +++ b/src/View/Game.elm @@ -15,6 +15,8 @@ import Model.Game exposing (Game) import Model.Point exposing (..) import Model.Config exposing (..) import Model.Round exposing (..) +import Model.Level exposing (..) +import Model.Color exposing (htmlOutput) import View.Round exposing (roundView) @@ -27,7 +29,7 @@ renderGame game = , Svg.Attributes.style ("background-color: " ++ backgroundColor ++ ";") , viewBox ("0 0 " ++ (toString game.boardSize.x) ++ " " ++ (toString (game.boardSize.y + headerHeight))) ] - [ renderBoard + [ renderBoard game.currentScore , renderPlayer game.boardSize game.player , g [] (renderPoints White) , g [] (renderPoints Black) @@ -95,13 +97,13 @@ renderHeader game = backgroundColor : String backgroundColor = "#1B203F" -renderBoard : Svg -renderBoard = +renderBoard : Int -> Svg +renderBoard currentScore = rect [ y (toString headerHeight) , width "100%" , height "100%" - , fill "#677BF4" + , fill (htmlOutput (progressiveColor currentScore)) ] [] @@ -170,7 +172,7 @@ renderText boardSize pos content = hideNewPoints : Vec2 -> Svg hideNewPoints boardSize = let size = - (pointSpawnDist boardSize) + pointSize - (Basics.max boardSize.x boardSize.y) / 2 + (pointAwayDist boardSize) + pointSize - (Basics.max boardSize.x boardSize.y) / 2 |> toString in g [] -- cgit v1.2.3