From 6c1f5e10631a3f66f4c85a45b6f28ffd366105c5 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 7 Mar 2015 18:46:47 +0100 Subject: Show best score in html layout --- src/Model/Game.elm | 33 ++++++++++++--------------------- src/Model/Player.elm | 10 +++++++++- 2 files changed, 21 insertions(+), 22 deletions(-) (limited to 'src/Model') diff --git a/src/Model/Game.elm b/src/Model/Game.elm index 4ef5d89..705841d 100644 --- a/src/Model/Game.elm +++ b/src/Model/Game.elm @@ -14,29 +14,20 @@ import Model.Config (..) type alias Game = { time : Float , keysDown : List KeyCode - , score : Int + , currentScore : Int , player : Player , cloud : Cloud - , bestScore : Int + , scores : List Int , seed : Seed } -initialGame : Seed -> Vec2 -> Config -> Int -> Game -initialGame seed playerPos config bestScore = - let initPlayer = - { pos = playerPos - , speed = - { x = 0 - , y = 0 - } - , config = config - } - in - { time = 0 - , keysDown = [] - , score = 0 - , player = initPlayer - , cloud = initCloud - , bestScore = bestScore - , seed = seed - } +initialGame : Seed -> Game +initialGame seed = + { time = 0 + , keysDown = [] + , currentScore = 0 + , player = initPlayer + , cloud = initCloud + , scores = [] + , seed = seed + } diff --git a/src/Model/Player.elm b/src/Model/Player.elm index c6aac21..a9f3f00 100644 --- a/src/Model/Player.elm +++ b/src/Model/Player.elm @@ -1,11 +1,12 @@ module Model.Player ( Player + , initPlayer , playerSize , playerSpeed ) where import Model.Vec2 (..) -import Model.Config (Config) +import Model.Config (..) type alias Player = { pos : Vec2 @@ -13,6 +14,13 @@ type alias Player = , config : Config } +initPlayer : Player +initPlayer = + { pos = originVec + , speed = originVec + , config = White + } + playerSize : Float playerSize = 15 -- cgit v1.2.3