Pause and resume sounds when pausing game
This commit is contained in:
@@ -13,9 +13,15 @@ loadSound (i,s) = do
|
||||
chnk <- Mix.load $ "./data/sound/" ++ s
|
||||
return (i,chnk)
|
||||
|
||||
-- current thinking is to use group 0 for game sounds, group 1 for menu sounds
|
||||
loadSounds :: IO (IM.IntMap Mix.Chunk)
|
||||
loadSounds = do
|
||||
Mix.openAudio Mix.defaultAudio 128
|
||||
Mix.setChannels 32
|
||||
x <- Mix.groupSpan 0 0 29
|
||||
putStrLn $ show x <> " channels assigned to group 0"
|
||||
y <- Mix.groupSpan 1 30 31
|
||||
putStrLn $ show y <> " channels assigned to group 1"
|
||||
fmap IM.fromList $ mapM loadSound $ zip [0..] soundPathList
|
||||
|
||||
loadMusic :: IO (IM.IntMap Mix.Music)
|
||||
|
||||
Reference in New Issue
Block a user