Add looping sound, add sound to terminals

This commit is contained in:
2022-03-16 09:23:17 +00:00
parent 5623747b01
commit 5aeb04ba05
24 changed files with 156 additions and 133 deletions
+18 -5
View File
@@ -30,6 +30,7 @@ import Dodge.SoundLogic.LoadSound
import Control.Lens
import qualified Data.Map as M
import Data.Int (Int16)
import Data.Maybe
{-| Placeholder...-}
haltSound :: World -> World
@@ -44,7 +45,7 @@ resumeSound :: Universe -> Universe
resumeSound w = w
soundWithStatus
:: SoundStatus
:: PlayStatus
-> SoundOrigin -- ^ \"Creator\" of sound
-> Point2 -- ^ Position of sound
-> SoundID -- ^ ID of sound to be played
@@ -56,7 +57,10 @@ soundWithStatus status so pos sType mtime w = over toPlaySounds (M.insertWith f
sound = Sound
{ _soundChunkID = sType
, _soundTime = mtime
, _soundStatus = status
, _soundStatus = SoundStatus
{_playStatus = status
,_isLooping = isJust mtime
}
, _soundChannel = Nothing
, _soundAngDist = Just (a,0)
, _soundPos = pos
@@ -94,7 +98,10 @@ soundFromGeneral so fpos sType mtime w = over toPlaySounds (M.insertWith f so so
sound = Sound
{ _soundChunkID = sType
, _soundTime = mtime
, _soundStatus = ToStart
, _soundStatus = SoundStatus
{ _playStatus = ToStart
, _isLooping = isJust mtime
}
, _soundChannel = Nothing
, _soundAngDist = Just (a,0)
, _soundPos = fpos w
@@ -134,7 +141,10 @@ soundMultiFrom [so] pos sType mtime w
sound = Sound
{ _soundChunkID = sType
, _soundTime = mtime
, _soundStatus = ToStart
, _soundStatus = SoundStatus
{ _playStatus = ToStart
, _isLooping = isJust mtime
}
, _soundChannel = Nothing
, _soundAngDist = Just (a,0)
, _soundPos = pos
@@ -148,7 +158,10 @@ soundMultiFrom (so:sos) pos sType mtime w
sound = Sound
{ _soundChunkID = sType
, _soundTime = mtime
, _soundStatus = ToStart
, _soundStatus = SoundStatus
{ _playStatus = ToStart
, _isLooping = isJust mtime
}
, _soundChannel = Nothing
, _soundAngDist = Just (a,0)
, _soundPos = pos