aboutsummaryrefslogtreecommitdiff
path: root/src/Game.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2014-09-02 21:35:58 +0200
committerJoris Guyonvarch2014-09-02 21:35:58 +0200
commitc4ae3b0ee4bd338995cfecf34e0aeb49f05fa70e (patch)
tree71530e9e2cfcbe888cb086593ea1e4d0bcc269a6 /src/Game.elm
Initial commit
Diffstat (limited to 'src/Game.elm')
-rw-r--r--src/Game.elm25
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
+ }