From 0f13d5ab1c1c42fba345465f2001d33661544a84 Mon Sep 17 00:00:00 2001 From: Ivy Date: Sat, 13 Feb 2021 21:23:34 +0100 Subject: [PATCH] Fixed a bug --- src/Game.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Game.hs b/src/Game.hs index 95d7a4c..35ad76d 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -21,9 +21,9 @@ newGame :: Game newGame = Game (makeDungeon 30 10) (Player 0 0) runAction :: Action -> Game -> Maybe Game -runAction (Walk N) game = Just $ game & player . y %~ (-)1 -runAction (Walk S) game = Just $ game & player . y %~ (+)1 -runAction (Walk W) game = Just $ game & player . x %~ (-)1 -runAction (Walk E) game = Just $ game & player . x %~ (+)1 +runAction (Walk N) game = Just $ game & player . y %~ (1 `subtract`) +runAction (Walk S) game = Just $ game & player . y %~ (+1) +runAction (Walk W) game = Just $ game & player . x %~ (1 `subtract`) +runAction (Walk E) game = Just $ game & player . x %~ (+1) runAction None g = Just g runAction ExitGame _ = Nothing