From 744850d3f04c6f49e58b7ec2598d7441e7364ba7 Mon Sep 17 00:00:00 2001 From: nek0 Date: Wed, 25 Jul 2018 01:10:21 +0200 Subject: [PATCH] move this out --- src/MainGame/WorldMap.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MainGame/WorldMap.hs b/src/MainGame/WorldMap.hs index 47af5b6..8b9a717 100644 --- a/src/MainGame/WorldMap.hs +++ b/src/MainGame/WorldMap.hs @@ -210,15 +210,15 @@ movePlayer _ = return () playerInteract :: MouseMessage -> Affection UserData () playerInteract (MsgMouseButton _ _ SDL.Pressed _ SDL.ButtonRight _ m) = do ud <- getAffection + (V2 rx ry) <- liftIO $ relativizeMouseCoords m + let dr = (ry / sin (atan 0.5) / 2) + rx + dc = rx - (ry / sin (atan 0.5) / 2) (nws, relEnts) <- liftIO $ yieldSystemT (worldState ud) $ do emap allEnts $ do with player with rot rot' <- query rot - (V2 rx ry) <- liftIO $ relativizeMouseCoords m - let dr = (ry / sin (atan 0.5) / 2) + rx - dc = rx - (ry / sin (atan 0.5) / 2) - ndir = direction (V2 dr dc) + let ndir = direction (V2 dr dc) return $ unchanged { rot = Set $ fromMaybe rot' ndir }