diff options
Diffstat (limited to 'src/View/Game.elm')
-rw-r--r-- | src/View/Game.elm | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/View/Game.elm b/src/View/Game.elm index 25b519c..8e76b48 100644 --- a/src/View/Game.elm +++ b/src/View/Game.elm @@ -18,15 +18,15 @@ import Model.Board (boardSize) import Model.Config (..) gameView : Game -> Element -gameView {time, score, player, cloud, bestScore} = - let whitePointForms = List.map (pointForm time (configColor White)) (cloud.points White) - blackPointForms = List.map (pointForm time (configColor Black)) (cloud.points Black) - forms = boardForms - ++ playerForms player - ++ whitePointForms - ++ blackPointForms - ++ scoreForms score - ++ bestScoreForms bestScore +gameView game = + let whitePointForms = List.map (pointForm game.time (configColor White)) (game.cloud.points White) + blackPointForms = List.map (pointForm game.time (configColor Black)) (game.cloud.points Black) + forms = + boardForms + ++ playerForms game.player + ++ whitePointForms + ++ blackPointForms + ++ scoreForms game.currentScore in collage (truncate boardSize.x) (truncate boardSize.y) forms boardForms : List Form @@ -72,17 +72,6 @@ scoreForms score = scorePos = { x = 0.0, y = boardSize.y / 2 - 30 } in [textForm text scorePos centered] -bestScoreForms : Int -> List Form -bestScoreForms bestScore = - if(bestScore > 0) then - let text = "Record: " ++ (toString bestScore) - pos = - { x = -boardSize.x / 2 + 100 - , y = -boardSize.y / 2 + 30 - } - in [textForm text pos leftAligned] - else [] - textForm : String -> Vec2 -> (Text -> Element) -> Form textForm content pos alignment = let textElement = fromString content |