Further implementation of poitional sound
This commit is contained in:
+11
-2
@@ -1,6 +1,6 @@
|
||||
module Dodge.SoundLogic where
|
||||
import Dodge.Data
|
||||
import Sound.Preload (SoundStatus (..))
|
||||
import Sound.Data (SoundStatus (..))
|
||||
import Geometry.Vector
|
||||
|
||||
import Control.Lens
|
||||
@@ -16,7 +16,16 @@ resumeSound :: World -> World
|
||||
resumeSound w = w
|
||||
|
||||
soundOnce :: Int -> World -> World
|
||||
soundOnce i = over soundQueue ((:) i)
|
||||
soundOnce i = over soundQueue ((:) (i,0))
|
||||
|
||||
soundOncePos :: Int -> Point2 -> World -> World
|
||||
soundOncePos i pos w = over soundQueue ((:) (i,a)) w
|
||||
where
|
||||
a = round
|
||||
. radToDeg
|
||||
. normalizeAngle
|
||||
. (+ pi)
|
||||
$ argV (vNormal (pos -.- _cameraViewFrom w)) - _cameraRot w
|
||||
|
||||
soundOnceOrigin :: Int -> SoundOrigin -> World -> World
|
||||
soundOnceOrigin sType so = over sounds (M.insertWith (flip const) so sound)
|
||||
|
||||
Reference in New Issue
Block a user