Fixed a bug
This commit is contained in:
parent
72c237b3d9
commit
0f13d5ab1c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue