diff options
Diffstat (limited to 'src/Xanthous/App.hs')
-rw-r--r-- | src/Xanthous/App.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Xanthous/App.hs b/src/Xanthous/App.hs index 0dc24b9d4165..82c32f05a3fc 100644 --- a/src/Xanthous/App.hs +++ b/src/Xanthous/App.hs @@ -16,7 +16,6 @@ import Xanthous.Data , Dimensions , positionFromPair ) -import qualified Xanthous.Data.EntityMap as EntityMap import Xanthous.Data.EntityMap (EntityMap) import Xanthous.Game import Xanthous.Game.Draw (drawGame) @@ -74,7 +73,11 @@ handleEvent _ = continue handleCommand :: Command -> AppM (Next GameState) handleCommand Quit = halt handleCommand (Move dir) = do - characterPosition %= move dir + newPos <- uses characterPosition $ move dir + collisionAt newPos >>= \case + Nothing -> characterPosition .= newPos + Just Combat -> undefined + Just Stop -> pure () continue handleCommand PreviousMessage = do |