de-ecstasy for now
This commit is contained in:
parent
2be7479f51
commit
b509fe501f
2 changed files with 11 additions and 11 deletions
18
src/Test.hs
18
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue