aboutsummaryrefslogtreecommitdiff
path: root/src/Display.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2014-10-05 23:10:18 +0200
committerJoris Guyonvarch2014-10-05 23:10:32 +0200
commit4521cdf1bb5725c9d497e5fb0c03943ad03a052f (patch)
tree8b7247e9b1b2c950c7bec39548bfe860965c5126 /src/Display.elm
parentc2583cf7ff8684d1194c61ab132e23d7ccebcd51 (diff)
Adding multiple moving points to catch
Diffstat (limited to 'src/Display.elm')
-rw-r--r--src/Display.elm33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/Display.elm b/src/Display.elm
index b586129..aa4ed51 100644
--- a/src/Display.elm
+++ b/src/Display.elm
@@ -3,18 +3,18 @@ module Display where
import Vec2 (..)
import Player (..)
import Game (Game)
-import Enemy (..)
+import Point (..)
import Board (boardSize)
-import Target (..)
display : Game -> Element
-display {time, player, target, enemyState, bestScore} =
- let enemyForms = map (enemyForm time) enemyState.enemies
+display {time, score, player, cloud, bestScore} =
+ let greenPointForms = map (pointForm time greenPointColor) cloud.greenPoints
+ redPointForms = map (pointForm time redPointColor) cloud.redPoints
forms = boardForms
++ playerForms player
- ++ targetForms target.pos
- ++ enemyForms
- ++ scoreForms target.score
+ ++ greenPointForms
+ ++ redPointForms
+ ++ scoreForms score
++ bestScoreForms bestScore
in collage (truncate boardSize.x) (truncate boardSize.y) forms
@@ -30,19 +30,16 @@ playerForms player = [circleForm player.pos playerSize playerColor]
playerColor : Color
playerColor = rgb 224 224 224
-targetForms : Vec2 -> [Form]
-targetForms pos = [circleForm pos targetSize targetColor]
+pointForm : Float -> Color -> Point -> Form
+pointForm time color point =
+ let pos = pointMove point time
+ in circleForm pos pointSize color
-targetColor : Color
-targetColor = rgb 34 85 34
+greenPointColor : Color
+greenPointColor = rgb 34 85 34
-enemyForm : Float -> Enemy -> Form
-enemyForm time enemy =
- let pos = enemyMove enemy time
- in circleForm pos enemySize enemyColor
-
-enemyColor : Color
-enemyColor = rgb 170 0 0
+redPointColor : Color
+redPointColor = rgb 170 0 0
circleForm : Vec2 -> Float -> Color -> Form
circleForm pos size color =