From 702fa633c30e4880243de7de0ace270608567aea Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 16 Nov 2018 07:12:27 +0100 Subject: [PATCH] fix movement --- src/MainGame/MindMap.hs | 7 ++++--- src/MainGame/WorldMap.hs | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MainGame/MindMap.hs b/src/MainGame/MindMap.hs index aee7637..8aa42e1 100644 --- a/src/MainGame/MindMap.hs +++ b/src/MainGame/MindMap.hs @@ -20,7 +20,7 @@ import Types import MainGame.WorldMap (checkBoundsCollision2, drawTile) -import Util (direction) +import Util updateMind :: Double -> Affection UserData () updateMind dt = do @@ -31,8 +31,9 @@ updateMind dt = do with xyvel with mmvel V2 rx ry <- query xyvel - let dr = (ry / sin (atan (1/2)) / 2) + rx - dc = rx - (ry / sin (atan (1/2)) / 2) + -- let dr = (ry / sin (atan (1/2)) / 2) + rx + -- dc = rx - (ry / sin (atan (1/2)) / 2) + let V2 dr dc = fmap (* 1.5) (V2 rx ry `rotVec` 45) return $ unchanged { mmvel = Set $ 2 * V2 dr dc } diff --git a/src/MainGame/WorldMap.hs b/src/MainGame/WorldMap.hs index ab8f29b..89e44b6 100644 --- a/src/MainGame/WorldMap.hs +++ b/src/MainGame/WorldMap.hs @@ -781,7 +781,8 @@ updateMap dt = do then [(floor dpc :: Int) .. 0] else [0 .. (ceiling dpc :: Int)]) colldpos = dpos * Prelude.foldl - (\acc a -> let ret = checkBoundsCollision2 pos' npos dt acc a + (\acc a -> + let ret = checkBoundsCollision2 pos' npos dt acc a in A.log A.Verbose (show ret) ret) (V2 1 1) (