From 4d007f6802246c6411a2838e68e957c2b4d56d3d Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Wed, 4 Mar 2015 23:27:59 +0100 Subject: Adapt the game to elm version 0.14.1 --- src/Game.elm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/Game.elm') diff --git a/src/Game.elm b/src/Game.elm index 0a12db8..4d68219 100644 --- a/src/Game.elm +++ b/src/Game.elm @@ -1,25 +1,31 @@ module Game where +import Random (..) + import Player (..) import Cloud (..) import Vec2 (Vec2) import Config (..) import Keyboard (KeyCode) -type Game = +type alias Game = { time : Float - , keysDown : [KeyCode] + , keysDown : List KeyCode , score : Int , player : Player , cloud : Cloud , bestScore : Int + , seed : Seed } -initialGame : Vec2 -> Int -> Game -initialGame playerPos bestScore = +initialGame : Seed -> Vec2 -> Int -> Game +initialGame seed playerPos bestScore = let initPlayer = { pos = playerPos - , speed = { x = 0, y = 0 } + , speed = + { x = 0 + , y = 0 + } , config = White } in @@ -29,4 +35,5 @@ initialGame playerPos bestScore = , player = initPlayer , cloud = initCloud , bestScore = bestScore + , seed = seed } -- cgit v1.2.3