Add sounds, move data types out into separate folders

This commit is contained in:
2022-07-16 17:06:51 +01:00
parent f8f4766012
commit e4a4766ddf
48 changed files with 658 additions and 496 deletions
+11 -9
View File
@@ -15,28 +15,30 @@ import Shape
import qualified Data.Map.Strict as M
import Control.Lens
damageSensor
:: DamageType -- Left gets sensed, Right does damage
damageSensor
:: DamageType
-> Float
-> Maybe Int
-> PlacementSpot -> Placement
-> PlacementSpot
-> Placement
damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1)
$ \lsid -> Just $ spNoID ps $ PutUsingGenParams
$ \gw -> (,) gw $ PutMachine (reverse $ square wdth) $ defaultMachine
& mcColor .~ yellow
& mcMounts . at ObTrigger .~ mtrid
& mcMounts . at ObLightSource ?~ lsid
& mcDraw .~ sensorSPic wdth (_sensorCoding (_genParams gw) M.! dt)
& mcSensor .~ SensorToggleAmount False 0
& mcLSs .~ [lsid]
& mcSensor .~ DamageSensor False 0 dt
lightSensor :: Float -- -> (Machine -> World -> World)
lightSensor :: Float
-> Maybe Int
-> PlacementSpot -> Placement
-> PlacementSpot
-> Placement
lightSensor = damageSensor LASERING
sensorSPic :: Float -> (PaletteColor,DecorationShape) -> Machine -> SPic
sensorSPic wdth (pc,ds) mc = noPic
$ colorSH (_mcColor mc) (upperPrismPoly 25 (square wdth))
<> decorationToShape ds wdth wdth 25 col col
$ colorSH (_mcColor mc) (upperPrismPoly 25 (square wdth))
<> decorationToShape ds wdth wdth 25 col col
where
col = paletteToColor pc