diff --git a/src/Dodge/Event/Keyboard.hs b/src/Dodge/Event/Keyboard.hs index 2f7ed0042..abd2b51ac 100644 --- a/src/Dodge/Event/Keyboard.hs +++ b/src/Dodge/Event/Keyboard.hs @@ -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]} diff --git a/src/Dodge/Update.hs b/src/Dodge/Update.hs index 667575b42..c42cc8688 100644 --- a/src/Dodge/Update.hs +++ b/src/Dodge/Update.hs @@ -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