Add sound on spawn, allow for filtering of to play sounds
This commit is contained in:
@@ -39,6 +39,7 @@ data SoundOrigin
|
||||
| EBSound Int
|
||||
| DamageHitSound Int
|
||||
| PBSound Int
|
||||
| SpawnSound
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ module Dodge.Data.Universe (
|
||||
import Control.Lens
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import qualified Data.Map.Strict as M
|
||||
--import qualified Data.Map.Strict as M
|
||||
import Data.Preload
|
||||
import Data.Sequence (Seq (..))
|
||||
import Dodge.Data.Config
|
||||
@@ -26,8 +25,6 @@ import Loop.Data
|
||||
import Picture.Data
|
||||
import Sound.Data
|
||||
|
||||
--import SDL (Scancode)
|
||||
|
||||
data Universe = Universe
|
||||
{ _uvWorld :: World
|
||||
, _preloadData :: PreloadData
|
||||
|
||||
@@ -39,6 +39,7 @@ data World = World
|
||||
, _randGen :: StdGen
|
||||
, _toPlaySounds :: M.Map SoundOrigin Sound
|
||||
, _playingSounds :: M.Map SoundOrigin Sound
|
||||
, _wSoundFilter :: SoundFilter
|
||||
, _input :: Input
|
||||
, _testFloat :: Float
|
||||
, _rbState :: RightButtonState
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
module Dodge.Data.WorldEffect where
|
||||
|
||||
import qualified Data.Set as S
|
||||
import Dodge.Data.Item.Location
|
||||
import NewInt
|
||||
import Dodge.Data.LightSource
|
||||
@@ -17,6 +18,10 @@ data ItCrWdWd = ItCrWdItemHeldEffect
|
||||
| ItCrWdItemHeldEffectNoHammer
|
||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data SoundFilter
|
||||
= FilterBySoundOrigin (S.Set SoundOrigin)
|
||||
| NoSoundFilter
|
||||
|
||||
data WdWd
|
||||
= NoWorldEffect
|
||||
| SetTrigger Bool Int
|
||||
@@ -33,6 +38,7 @@ data WdWd
|
||||
| MakeTempLightFade Float LSParam Int
|
||||
| UseInvItem Int Int -- invid presstime
|
||||
| WdWdBurstFireRepetition Int (NewInt InvInt)
|
||||
| WdWdSetSoundFilter SoundFilter
|
||||
--deriving (Eq, Show, Read) --, Generic)
|
||||
--h--deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
@@ -61,6 +67,7 @@ data WdP2f
|
||||
= WdP2f0
|
||||
| WdP2fDoorPosition Int
|
||||
|
||||
deriveJSON defaultOptions ''SoundFilter
|
||||
deriveJSON defaultOptions ''ItCrWdWd
|
||||
deriveJSON defaultOptions ''WdWd
|
||||
deriveJSON defaultOptions ''WdP2
|
||||
|
||||
Reference in New Issue
Block a user