One question: could CurrentTile.hs be DRYed up? https://github.com/egonSchiele/chips/blob/master/src/Chips/C...
This repeating pattern seems ripe for DRYing:
checkCurTile (Chip _) = do liftIO $ playSound (soundDir ++ "collect_chip.wav") False tileAt Current .= (Empty def) checkCurTile (Gate _) = do liftIO $ playSound (soundDir ++ "door.wav") False tileAt Current .= (Empty def) checkCurTile (KeyYellow _) = do yellowKeyCount += 1 tileAt Current .= (Empty def) checkCurTile (KeyBlue _) = do blueKeyCount += 1 tileAt Current .= (Empty def) [...]
checkCurTile b = do case b of Chip -> liftIO $ playSound (soundDir ++ "collect_chip.wav") False Gate -> liftIO $ playSound (soundDir ++ "door.wav") False (KeyYellow _) -> yellowKeyCount += 1 (KeyBlue _) -> blueKeyCount += 1 tileAt Current .= (Empty def)
One question: could CurrentTile.hs be DRYed up? https://github.com/egonSchiele/chips/blob/master/src/Chips/C...
This repeating pattern seems ripe for DRYing: