diff --git a/src/Dodge/SoundLogic.hs b/src/Dodge/SoundLogic.hs index f6069cf7c..427c54c42 100644 --- a/src/Dodge/SoundLogic.hs +++ b/src/Dodge/SoundLogic.hs @@ -65,7 +65,7 @@ resumeSound :: World -> World resumeSound w = w {-| Add a sound to the queue for playback. -Consider replacing with 'soundOncePos'. +Consider replacing instances with 'soundOncePos'. -} soundOnce :: Int -> World -> World soundOnce i = over soundQueue ((:) (i,0)) diff --git a/src/Sound.hs b/src/Sound.hs index d22d67254..1e23ac03a 100644 --- a/src/Sound.hs +++ b/src/Sound.hs @@ -32,17 +32,18 @@ then sounds in the merged Map are updated. The Map of updated sound specifications is returned. New sounds with the same keys as -already playing sounds are merged in the following manner: +already playing sounds are merged as follows: - * the '_soundChannel' is set to the old value - * if the old '_soundStatus' was 'FadingOut', it is replaced with the new status (allowing playback to be restarted using 'ToStart') - * all other fields are set to the new value. + * '_soundChannel' is set to the old value + * if the old '_soundStatus' was 'FadingOut', it set to the new value (can restart playback with 'ToStart') + * other fields are set to the new value. In the update: - 1. sounds with a value 'ToStart' commence playing - 2. timers are decremented and any fading status is set - 3. sounds that have stopped playing are removed from the map. + 1. commence playing sounds with 'ToStart' status + 2. decrement timers, set any fading status + 3. apply 'Just' sound position effects, set value to 'Nothing' + 4. remove sounds that have stopped playing from the map. -} playAndUpdate :: Ord a => SoundData a -> M.Map a Sound -> IO (M.Map a Sound) playAndUpdate sData newSounds