aboutsummaryrefslogtreecommitdiff
path: root/src/Game.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-04 23:27:59 +0100
committerJoris Guyonvarch2015-03-05 00:27:32 +0100
commit4d007f6802246c6411a2838e68e957c2b4d56d3d (patch)
tree70519a5a2d6825bf2b64f6a8950a003b2ff4f150 /src/Game.elm
parentd37a301ed39bac823e0f2223b8d229b417e128c7 (diff)
Adapt the game to elm version 0.14.1
Diffstat (limited to 'src/Game.elm')
-rw-r--r--src/Game.elm17
1 files changed, 12 insertions, 5 deletions
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
}