de-ecstasy for now

This commit is contained in:
nek0 2018-02-23 13:07:24 +01:00
parent 2be7479f51
commit b509fe501f
2 changed files with 11 additions and 11 deletions

View File

@ -42,8 +42,8 @@ loadMap = do
{ world = nworld { world = nworld
, stateData = MenuData , stateData = MenuData
{ mapMat = matrix { mapMat = matrix
-- , initCoords = (0, 500) , initCoords = (0, 500)
-- , playerCoords = (20, 20) , playerCoords = (20, 20)
} }
, uuid = [uu] , uuid = [uu]
} }
@ -65,7 +65,7 @@ mouseToPlayer mv2 = do
rela@(V2 rx ry) <- liftIO $ relativizeMouseCoords mv2 rela@(V2 rx ry) <- liftIO $ relativizeMouseCoords mv2
let dr = (- ry) + (- rx) let dr = (- ry) + (- rx)
dc = (- rx) - (- ry) / 2 dc = (- rx) - (- ry) / 2
-- (pr, pc) = playerCoords $ stateData ud (pr, pc) = playerCoords $ stateData ud
nworld <- runSystemT (world ud) $ do nworld <- runSystemT (world ud) $ do
emap $ do emap $ do
with player with player
@ -75,9 +75,9 @@ mouseToPlayer mv2 = do
getWorld getWorld
putAffection ud putAffection ud
{ world = nworld { world = nworld
-- stateData = (stateData ud) , stateData = (stateData ud)
-- { playerCoords = (pr - dr, pc - dc) { playerCoords = (pr - dr, pc - dc)
-- } }
} }
movePlayer :: MouseMessage -> Affection UserData () movePlayer :: MouseMessage -> Affection UserData ()
@ -129,10 +129,10 @@ drawTile row col tile = do
with player with player
pos' <- E.get pos pos' <- E.get pos
pure pos' pure pos'
let V2 pr pc = head playerPos let -- V2 pr pc = head playerPos
ctx = nano ud ctx = nano ud
-- (xinit, yinit) = initCoords $ stateData ud (xinit, yinit) = initCoords $ stateData ud
-- (pr, pc) = playerCoords $ stateData ud (pr, pc) = playerCoords $ stateData ud
tileWidth = 20 :: Double tileWidth = 20 :: Double
tileHeight = 10 :: Double tileHeight = 10 :: Double
liftIO $ do liftIO $ do

View File

@ -33,8 +33,8 @@ data StateData
= None = None
| MenuData | MenuData
{ mapMat :: Matrix TileState { mapMat :: Matrix TileState
-- , initCoords :: (Int, Int) , initCoords :: (Int, Int)
-- , playerCoords :: (Double, Double) , playerCoords :: (Double, Double)
} }
data ImgId data ImgId