Space zooms to position on carte
This commit is contained in:
@@ -71,10 +71,16 @@ debugKey scancode w
|
||||
debugKey _ w = Just w
|
||||
|
||||
spaceAction :: World -> World
|
||||
spaceAction w = case listToMaybe $ _closeActiveObjects w of
|
||||
Just (Left flit) -> pickUpItem' flit w
|
||||
Just (Right but) -> _btEvent but but w
|
||||
Nothing -> w
|
||||
spaceAction w = if _carteDisplay w
|
||||
then
|
||||
w & carteCenter .~ theLoc
|
||||
else
|
||||
case listToMaybe $ _closeActiveObjects w of
|
||||
Just (Left flit) -> pickUpItem' flit w
|
||||
Just (Right but) -> _btEvent but but w
|
||||
Nothing -> w
|
||||
where
|
||||
theLoc = fst (_seenLocations w IM.! _selLocation w) w
|
||||
|
||||
pauseGame :: World -> World
|
||||
pauseGame w = w {_menuLayers = [PauseMenu]}
|
||||
|
||||
+3
-3
@@ -99,9 +99,9 @@ ppEvents w = IM.foldr' (\pp w -> _ppEvent pp pp w) w $ _pressPlates w
|
||||
updateSeenWalls :: World -> World
|
||||
updateSeenWalls w = foldr markSeen w wallsToUpdate
|
||||
where yPos = _crPos $ _creatures w IM.! 0
|
||||
wallsToUpdate = map _wlID $ IM.elems $ wallsNearPoint yPos w
|
||||
-- wallsToUpdate = concatMap (\p -> collidePointFindWalls yPos (yPos +.+p) $ wallsAlongLine yPos (yPos +.+ p) w)
|
||||
-- $ nRays 60
|
||||
-- wallsToUpdate = map _wlID $ IM.elems $ wallsNearPoint yPos w
|
||||
wallsToUpdate = concatMap (\p -> collidePointFindWalls yPos (yPos +.+p) $ wallsAlongLine yPos (yPos +.+ p) w)
|
||||
$ nRays 60
|
||||
markSeen i = set (walls . ix i . wlSeen) True
|
||||
|
||||
setTestStringIO :: IO World -> IO World
|
||||
|
||||
Reference in New Issue
Block a user