aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Game.elm
blob: 876965166e5c530d9e884d5f7edb72cab42427ca (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
33
34
35
36
37
38
39
40
module Model.Game
  ( Game
  , initialGame
  ) where

import Random exposing (..)
import Keyboard exposing (KeyCode)
import Time exposing (Time)
import Set
import Set exposing (Set)

import Model.Player exposing (..)
import Model.Cloud exposing (..)
import Model.Vec2 exposing (Vec2)
import Model.Config exposing (..)
import Model.Round exposing (Round)
import Model.Board exposing (initBoardSize)

type alias Game =
  { time : Float
  , boardSize : Vec2
  , keysDown : Set KeyCode
  , currentScore : Int
  , player : Player
  , cloud : Cloud
  , rounds : List Round
  , seed : Seed
  }

initialGame : Seed -> Game
initialGame seed =
  { time = 0
  , boardSize = initBoardSize
  , keysDown = Set.empty
  , currentScore = 0
  , player = initPlayer
  , cloud = initCloud
  , rounds = []
  , seed = seed
  }