module Dodge.WorldEvent.Sound
  where
import Dodge.Data
import Dodge.Data.SoundOrigin
import Dodge.SoundLogic
import Dodge.SoundLogic.LoadSound
import Geometry.Data
import Dodge.RandomHelp

--import System.Random
import Control.Lens
import Control.Monad.State.Lazy


mkSoundBreakGlass :: Point2 -> World -> World
mkSoundBreakGlass p w = soundStart (GlassBreakSound 0) p soundid Nothing $ set randGen g w
  where
    (soundid,g) = _randGen w & runState (takeOne [glassShat1S,glassShat2S,glassShat3S,glassShat4S])

mkSoundSplinterGlass :: Point2 -> World -> World
mkSoundSplinterGlass p w = soundStart (GlassBreakSound 1) p soundid Nothing $ set randGen g w
  where
    (soundid,g) = _randGen w & runState (takeOne [smallGlass1S,smallGlass2S,smallGlass3S,smallGlass4S])
