Allow for random choice between placements in different rooms
This commit is contained in:
@@ -15,8 +15,8 @@ putDoubleDoor pathing col cond a b speed = putDoubleDoorThen pathing col cond a
|
||||
|
||||
putDoubleDoorThen :: Bool -> Color -> (World -> Bool)
|
||||
-> Point2 -> Point2 -> Float -> Maybe Placement -> Placement
|
||||
putDoubleDoorThen pathing col cond a b speed mayp = ps0j (PutSlideDoor pathing col cond a half speed)
|
||||
$ Placement (PS (V2 0 0) 0) ( PutSlideDoor pathing col cond b half speed) Nothing $ const mayp
|
||||
putDoubleDoorThen pathing col cond a b speed mayp = ps0j (PutSlideDr pathing col cond a half speed)
|
||||
$ Placement (PS (V2 0 0) 0) ( PutSlideDr pathing col cond b half speed) Nothing $ const mayp
|
||||
where
|
||||
half = 0.5 *.* (a +.+ b)
|
||||
|
||||
@@ -33,8 +33,8 @@ putAutoDoor a b = PlacementUsingPos (addZ 0 a)
|
||||
|
||||
switchDoor :: Point2 -> Float -> Point2 -> Point2 -> Color -> Placement
|
||||
switchDoor btpos btrot dra drb col = pContID (PS btpos btrot) (PutButton $ makeSwitch col red id id)
|
||||
$ \btid -> jsps0J (PutSlideDoor False col (cond btid) dra drc 2)
|
||||
$ sps0 (PutSlideDoor False col (cond btid) drb drc 2)
|
||||
$ \btid -> jsps0J (PutSlideDr False col (cond btid) dra drc 2)
|
||||
$ sps0 (PutSlideDr False col (cond btid) drb drc 2)
|
||||
where
|
||||
drc = 0.5 *.* (dra +.+ drb)
|
||||
cond btid w' = _btState (_buttons w' IM.! btid) == BtOn
|
||||
|
||||
Reference in New Issue
Block a user