diff options
Diffstat (limited to 'src/Physics.elm')
-rw-r--r-- | src/Physics.elm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Physics.elm b/src/Physics.elm index 2d2d627..c68ab58 100644 --- a/src/Physics.elm +++ b/src/Physics.elm @@ -22,6 +22,15 @@ getMove speed dir = , y = speed * sin angle } +getWaveMove : Float -> Vec2 -> Float -> Float -> Vec2 +getWaveMove speed dir amplitude period = + let move = getMove speed dir + perpendMove = + getMove + (amplitude * (sin ((norm move) / period))) + (clockwiseRotate90 move) + in move `add` perpendMove + getAcc : Vec2 -> Vec2 -> Vec2 getAcc move speed = (move `div` 300) `sub` (speed `div` 300) |