diff options
Diffstat (limited to 'src/Update/Update.elm')
-rw-r--r-- | src/Update/Update.elm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Update/Update.elm b/src/Update/Update.elm index ab68d2e..2183d97 100644 --- a/src/Update/Update.elm +++ b/src/Update/Update.elm @@ -8,7 +8,6 @@ import Char (fromCode, toCode) import Maybe import Model.Player (..) -import Model.Point (pointSpeed, pointMove, pointAwayDist) import Model.Vec2 (..) import Model.Config (otherConfig) import Model.Cloud (..) @@ -35,8 +34,8 @@ update input game = } else let newTime = game.time + input.delta - newPlayer = playerStep input.delta input.dir (newKeyCode game.keysDown input.inputKeysDown) game.player - (newCloud, addScore, newSeed) = cloudUpdate game.time game.seed newPlayer game.cloud + newPlayer = playerStep input.delta game.boardSize input.dir (newKeyCode game.keysDown input.inputKeysDown) game.player + (newCloud, addScore, newSeed) = cloudUpdate game.time game.boardSize game.seed newPlayer game.cloud in { game | time <- newTime @@ -47,11 +46,11 @@ update input game = , seed <- newSeed } -playerStep : Float -> Vec2 -> (KeyCode -> Bool) -> Player -> Player -playerStep dt dir newKey player = +playerStep : Float -> Vec2 -> Vec2 -> (KeyCode -> Bool) -> Player -> Player +playerStep dt boardSize dir newKey player = let (pos, speed) = getNewPosAndSpeed dt dir playerSpeed (player.pos, player.speed) newConfig = if (newKey 69) then otherConfig player.config else player.config - in { pos = inBoard playerSize pos + in { pos = inBoard boardSize playerSize pos , speed = speed , config = newConfig } |