diff options
author | Joris Guyonvarch | 2014-09-02 21:35:58 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2014-09-02 21:35:58 +0200 |
commit | c4ae3b0ee4bd338995cfecf34e0aeb49f05fa70e (patch) | |
tree | 71530e9e2cfcbe888cb086593ea1e4d0bcc269a6 /src/Game.elm |
Initial commit
Diffstat (limited to 'src/Game.elm')
-rw-r--r-- | src/Game.elm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Game.elm b/src/Game.elm new file mode 100644 index 0000000..c86af26 --- /dev/null +++ b/src/Game.elm @@ -0,0 +1,25 @@ +module Game where + +import Player (..) +import Enemy (..) +import EnemyState (..) +import Vec2 (Vec2) + +type Game = + { time : Float + , player : Player + , enemyState : EnemyState + , bestTime : Float + } + +initialGame : Vec2 -> Float -> Game +initialGame playerPos bestTime = + let initPlayer = + { pos = playerPos + , speed = { x = 0, y = 0 } + } + in { time = 0 + , player = initPlayer + , enemyState = initEnemyState + , bestTime = bestTime + } |