From 4521cdf1bb5725c9d497e5fb0c03943ad03a052f Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 5 Oct 2014 23:10:18 +0200 Subject: Adding multiple moving points to catch --- src/Display.elm | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'src/Display.elm') 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 = -- cgit v1.2.3