Add machine sounds
This commit is contained in:
@@ -2,6 +2,10 @@ module Dodge.Machine where
|
||||
import Dodge.Data
|
||||
import Dodge.Wall.Delete
|
||||
import LensHelp
|
||||
import Sound.Data
|
||||
import Dodge.SoundLogic
|
||||
import Geometry
|
||||
import Dodge.Base
|
||||
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
|
||||
@@ -15,3 +19,11 @@ machineUpdateDeathEff f mc
|
||||
where
|
||||
dams = sum $ map _dmAmount $ _mcDamage mc
|
||||
mcid = _mcID mc
|
||||
|
||||
machineAddSound :: SoundID -> (Machine -> World -> World) -> Machine -> World -> World
|
||||
machineAddSound sid f mc w
|
||||
| dist (_crPos $ you w) (_mcPos mc) < 100
|
||||
= soundContinue (MachineSound mid) (_mcPos mc) sid (Just 2) $ f mc w
|
||||
| otherwise = f mc w
|
||||
where
|
||||
mid = _mcID mc
|
||||
|
||||
Reference in New Issue
Block a user