blob: 0a12db8c3e23c649a2e92f5c4a0259113b46e68d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
module Game where
import Player (..)
import Cloud (..)
import Vec2 (Vec2)
import Config (..)
import Keyboard (KeyCode)
type Game =
{ time : Float
, keysDown : [KeyCode]
, score : Int
, player : Player
, cloud : Cloud
, bestScore : Int
}
initialGame : Vec2 -> Int -> Game
initialGame playerPos bestScore =
let initPlayer =
{ pos = playerPos
, speed = { x = 0, y = 0 }
, config = White
}
in
{ time = 0
, keysDown = []
, score = 0
, player = initPlayer
, cloud = initCloud
, bestScore = bestScore
}
|