From b509fe501fd208d0acedb122e519f35d6983d4b8 Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 23 Feb 2018 13:07:24 +0100 Subject: [PATCH] de-ecstasy for now --- src/Test.hs | 18 +++++++++--------- src/Types/UserData.hs | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Test.hs b/src/Test.hs index f4ed03c..1b02997 100644 --- a/src/Test.hs +++ b/src/Test.hs @@ -42,8 +42,8 @@ loadMap = do { world = nworld , stateData = MenuData { mapMat = matrix - -- , initCoords = (0, 500) - -- , playerCoords = (20, 20) + , initCoords = (0, 500) + , playerCoords = (20, 20) } , uuid = [uu] } @@ -65,7 +65,7 @@ mouseToPlayer mv2 = do rela@(V2 rx ry) <- liftIO $ relativizeMouseCoords mv2 let dr = (- ry) + (- rx) dc = (- rx) - (- ry) / 2 - -- (pr, pc) = playerCoords $ stateData ud + (pr, pc) = playerCoords $ stateData ud nworld <- runSystemT (world ud) $ do emap $ do with player @@ -75,9 +75,9 @@ mouseToPlayer mv2 = do getWorld putAffection ud { world = nworld - -- stateData = (stateData ud) - -- { playerCoords = (pr - dr, pc - dc) - -- } + , stateData = (stateData ud) + { playerCoords = (pr - dr, pc - dc) + } } movePlayer :: MouseMessage -> Affection UserData () @@ -129,10 +129,10 @@ drawTile row col tile = do with player pos' <- E.get pos pure pos' - let V2 pr pc = head playerPos + let -- V2 pr pc = head playerPos ctx = nano ud - -- (xinit, yinit) = initCoords $ stateData ud - -- (pr, pc) = playerCoords $ stateData ud + (xinit, yinit) = initCoords $ stateData ud + (pr, pc) = playerCoords $ stateData ud tileWidth = 20 :: Double tileHeight = 10 :: Double liftIO $ do diff --git a/src/Types/UserData.hs b/src/Types/UserData.hs index 9513633..1d45007 100644 --- a/src/Types/UserData.hs +++ b/src/Types/UserData.hs @@ -33,8 +33,8 @@ data StateData = None | MenuData { mapMat :: Matrix TileState - -- , initCoords :: (Int, Int) - -- , playerCoords :: (Double, Double) + , initCoords :: (Int, Int) + , playerCoords :: (Double, Double) } data ImgId