Add laser central room, using new placement/roompos functionality
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user