aboutsummaryrefslogtreecommitdiff
path: root/src/View/Game.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/View/Game.elm')
-rw-r--r--src/View/Game.elm15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/View/Game.elm b/src/View/Game.elm
index 0bbea00..c9c58ff 100644
--- a/src/View/Game.elm
+++ b/src/View/Game.elm
@@ -14,7 +14,6 @@ import Model.Vec2 (Vec2)
import Model.Player (..)
import Model.Game (Game)
import Model.Point (..)
-import Model.Board (boardSize)
import Model.Config (..)
gameView : Game -> Element
@@ -22,15 +21,15 @@ 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
+ boardForms game.boardSize
++ playerForms game.player
++ whitePointForms
++ blackPointForms
- ++ scoreForms game.currentScore
- in collage (truncate boardSize.x) (truncate boardSize.y) forms
+ ++ scoreForms game.boardSize game.currentScore
+ in collage (truncate game.boardSize.x) (truncate game.boardSize.y) forms
-boardForms : List Form
-boardForms = [filled boardColor (rect boardSize.x boardSize.y)]
+boardForms : Vec2 -> List Form
+boardForms boardSize = [filled boardColor (rect boardSize.x boardSize.y)]
boardColor : Color
boardColor = rgb 103 123 244
@@ -66,8 +65,8 @@ circleForm pos size color =
outlineColor : Color
outlineColor = rgb 34 34 34
-scoreForms : Int -> List Form
-scoreForms score =
+scoreForms : Vec2 -> Int -> List Form
+scoreForms boardSize score =
let text = (toString score)
scorePos = { x = 0.0, y = boardSize.y / 2 - 35 }
in [textForm text scorePos centered]