diff options
author | Joris Guyonvarch | 2014-10-05 23:10:18 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2014-10-05 23:10:32 +0200 |
commit | 4521cdf1bb5725c9d497e5fb0c03943ad03a052f (patch) | |
tree | 8b7247e9b1b2c950c7bec39548bfe860965c5126 /src/Point.elm | |
parent | c2583cf7ff8684d1194c61ab132e23d7ccebcd51 (diff) |
Adding multiple moving points to catch
Diffstat (limited to 'src/Point.elm')
-rw-r--r-- | src/Point.elm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Point.elm b/src/Point.elm new file mode 100644 index 0000000..90c61c3 --- /dev/null +++ b/src/Point.elm @@ -0,0 +1,27 @@ +module Point where + +import Vec2 (..) +import Board (boardDiagonal) + +type 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 = 5 + +pointSpeed : Float -> Float +pointSpeed dt = dt / 25 + +pointSpawnDist : Float +pointSpawnDist = boardDiagonal * 3 / 5 + +pointAwayDist : Float +pointAwayDist = boardDiagonal * 3 / 4 |