Add laser central room, using new placement/roompos functionality

This commit is contained in:
2021-11-21 17:44:32 +00:00
parent 48cd59069c
commit 2f3896345d
12 changed files with 127 additions and 76 deletions
+4 -3
View File
@@ -14,17 +14,18 @@ import Data.Either
damageSensor
:: (DamageType -> Either Int Int) -- Left gets sensed, Right does damage
-> (Machine -> World -> World)
-> Point2 -> Float -> Placement
damageSensor damF p r = pContID (PS p r) ( PutLS theLS)
damageSensor damF upf p r = pContID (PS p r) ( PutLS theLS)
$ \lsid -> jsps p r $ PutMachine yellow (reverse $ square wdth) defaultMachine
{ _mcDraw = sensorSPic
, _mcUpdate = sensorUpdate damF
, _mcUpdate = \mc w -> upf mc $ sensorUpdate damF mc w
, _mcLSs = [lsid]
}
where
theLS = defaultLS { _lsPos = V3 0 0 30 , _lsIntensity = 0.1 }
lightSensor :: Point2 -> Float -> Placement
lightSensor :: (Machine -> World -> World) -> Point2 -> Float -> Placement
lightSensor = damageSensor senseLasering
senseLasering :: DamageType -> Either Int Int