Add wire to central laser room

This commit is contained in:
2021-11-21 19:14:17 +00:00
parent 2f3896345d
commit afeb9d2b64
9 changed files with 57 additions and 35 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ triggerSwitchSPic sdraw ps = psPtCont ps (PutTrigger (const False))
triggerSwitchSPicLight :: (Button -> SPic) -> PlacementSpot -> Placement
triggerSwitchSPicLight sdraw ps = psPtCont ps (PutTrigger (const False))
$ \tp -> Just $ pContID fstLnkOut (PutLS thels)
$ \tp -> Just $ pContID atFstLnkOut (PutLS thels)
$ \lsid -> Just
$ pContID ps (PutButton (makeSwitchSPic sdraw (oneff lsid $ trigid tp) (offeff lsid $ trigid tp)))
(const Nothing)
+4 -4
View File
@@ -15,9 +15,9 @@ import Data.Either
damageSensor
:: (DamageType -> Either Int Int) -- Left gets sensed, Right does damage
-> (Machine -> World -> World)
-> Point2 -> Float -> Placement
damageSensor damF upf p r = pContID (PS p r) ( PutLS theLS)
$ \lsid -> jsps p r $ PutMachine yellow (reverse $ square wdth) defaultMachine
-> PlacementSpot -> Placement
damageSensor damF upf ps = pContID ps ( PutLS theLS)
$ \lsid -> Just $ spNoID ps $ PutMachine yellow (reverse $ square wdth) defaultMachine
{ _mcDraw = sensorSPic
, _mcUpdate = \mc w -> upf mc $ sensorUpdate damF mc w
, _mcLSs = [lsid]
@@ -25,7 +25,7 @@ damageSensor damF upf p r = pContID (PS p r) ( PutLS theLS)
where
theLS = defaultLS { _lsPos = V3 0 0 30 , _lsIntensity = 0.1 }
lightSensor :: (Machine -> World -> World) -> Point2 -> Float -> Placement
lightSensor :: (Machine -> World -> World) -> PlacementSpot -> Placement
lightSensor = damageSensor senseLasering
senseLasering :: DamageType -> Either Int Int
+1 -2
View File
@@ -85,8 +85,7 @@ shiftPSBy (pos,rot) ps = ps
& psPos %~ shiftPointBy (pos,rot)
& psRot %~ (+ rot)
-- the Int here allows for passing parameters down to other placements:
-- button ids, etc
-- the Int here is some id that is assigned when the placement is placed
placeSpotID :: PlacementSpot -> PSType -> World -> (Int, World)
placeSpotID ps pt w = case pt of
PutTrigger cond -> placeNewInto triggers cond w