adjust mouse to isometric

This commit is contained in:
nek0 2018-02-24 23:15:16 +01:00
parent 0c6278cd5b
commit 2c6ac33e44

View file

@ -63,8 +63,8 @@ mouseToPlayer :: V2 Int32 -> Affection UserData ()
mouseToPlayer mv2 = do mouseToPlayer mv2 = do
ud <- getAffection ud <- getAffection
rela@(V2 rx ry) <- liftIO $ relativizeMouseCoords mv2 rela@(V2 rx ry) <- liftIO $ relativizeMouseCoords mv2
let dr = ry + rx let dr = (ry / sin (atan (1/2)) / 2) + rx
dc = rx - ry / 2 dc = rx - (ry / sin (atan (1/2)) / 2)
(nws, nworld) <- yieldSystemT (worldState ud) $ do (nws, nworld) <- yieldSystemT (worldState ud) $ do
emap $ do emap $ do
with player with player