aboutsummaryrefslogtreecommitdiff
path: root/src/View/Game.elm
diff options
context:
space:
mode:
authorJoris2015-12-30 13:35:01 +0100
committerJoris2015-12-30 13:35:01 +0100
commit2258ef984fefde41711d4c883baf582b7e581155 (patch)
treea15cdae0c8a77a628ee49959037a1000687f3a2c /src/View/Game.elm
parent1cf6bc1ad9209e4f3f2fcbc129f2577e74e94c99 (diff)
Make the player bigger with each point
Diffstat (limited to 'src/View/Game.elm')
-rw-r--r--src/View/Game.elm18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/View/Game.elm b/src/View/Game.elm
index 2651f8d..2bef2ae 100644
--- a/src/View/Game.elm
+++ b/src/View/Game.elm
@@ -22,7 +22,7 @@ import View.Round exposing (roundView)
renderGame : Game -> Html
renderGame game =
- let renderPoints config = List.map (renderPoint game.boardSize game.time config) (game.cloud.points config)
+ let renderPoints config = List.map (renderPoint game.boardSize game.elapsedTime config) (game.cloud.points config)
in svg
[ width "100%"
, height "100%"
@@ -30,10 +30,10 @@ renderGame game =
, viewBox ("0 0 " ++ (toString game.boardSize.x) ++ " " ++ (toString (game.boardSize.y + headerHeight)))
]
[ renderBoard game.currentScore
- , renderPlayer game.boardSize game.player
+ , renderPlayer game.boardSize game.player (getPlayerSize game.currentScore)
, g [] (renderPoints White)
, g [] (renderPoints Black)
- , renderScore game.boardSize game.time game.rounds game.currentScore
+ , renderScore game.boardSize game.elapsedTime game.rounds game.currentScore
, hideNewPoints game.boardSize
, renderHeader game
]
@@ -107,8 +107,8 @@ renderBoard currentScore =
]
[]
-renderPlayer : Vec2 -> Player -> Svg
-renderPlayer boardSize player =
+renderPlayer : Vec2 -> Player -> Float -> Svg
+renderPlayer boardSize player playerSize =
renderCircle boardSize player.pos playerSize (playerColor player.config)
playerColor : Config -> String
@@ -118,8 +118,8 @@ playerColor config =
Black -> "#0E1121"
renderPoint : Vec2 -> Float -> Config -> Point -> Svg
-renderPoint boardSize time config point =
- let pos = pointMove point time
+renderPoint boardSize elapsedTime config point =
+ let pos = pointMove point elapsedTime
in renderCircle boardSize pos pointSize (playerColor config)
pointColor : Config -> String
@@ -139,13 +139,13 @@ renderCircle boardSize pos size color =
[]
renderScore : Vec2 -> Time -> List Round -> Int -> Svg
-renderScore boardSize currentRoundTime rounds score =
+renderScore boardSize elapsedTime rounds score =
let scorePos =
{ x = 0.0
, y = boardSize.y / 2 - 35
}
scoreText = "L" ++ (toString << currentLevelNumber <| score) ++ " - " ++ (toString score)
- in if currentRoundTime < 5000
+ in if elapsedTime < 5000
then
case List.head rounds of
Just round ->