aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Point.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-07 15:12:02 +0100
committerJoris Guyonvarch2015-03-07 15:12:02 +0100
commit17a58e0c4c67f27d87635bf1b2ca50fb11795ad3 (patch)
tree8de99cdf0b4021ca6db6920537e7d0fa250e90bc /src/Model/Point.elm
parent336816d2e8ab4afff1562123dfde61bf3a68e61c (diff)
Organizing source code with subdirectories
Diffstat (limited to 'src/Model/Point.elm')
-rw-r--r--src/Model/Point.elm34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Model/Point.elm b/src/Model/Point.elm
new file mode 100644
index 0000000..41967b6
--- /dev/null
+++ b/src/Model/Point.elm
@@ -0,0 +1,34 @@
+module Model.Point
+ ( Point
+ , pointMove
+ , pointSize
+ , pointSpeed
+ , pointSpawnDist
+ , pointAwayDist
+ ) where
+
+import Model.Vec2 (..)
+import Model.Board (boardDiagonal)
+
+type alias Point =
+ { initTime : Float
+ , initPos : Vec2
+ , initDest : Vec2
+ , move : Float -> Vec2 -> Vec2 -> Float -> Vec2
+ }
+
+pointMove : Point -> Float -> Vec2
+pointMove {initTime, initPos, initDest, move} time =
+ move initTime initPos initDest time
+
+pointSize : Float
+pointSize = 10
+
+pointSpeed : Float -> Float
+pointSpeed dt = dt / 20
+
+pointSpawnDist : Float
+pointSpawnDist = boardDiagonal * 3 / 5
+
+pointAwayDist : Float
+pointAwayDist = boardDiagonal * 3 / 4