Improve pathing debugging, work on door pathing

This commit is contained in:
2022-07-03 00:24:25 +01:00
parent 3efd89fa34
commit 67b612fe60
9 changed files with 59 additions and 43 deletions
+3 -3
View File
@@ -33,7 +33,7 @@ putDoubleDoorThen wl cond soff a b speed cont
doorBetween :: Wall -> (World -> Bool) -> Float -> Point2 -> Point2 -> Float ->
(Placement -> Maybe Placement) -> Placement
doorBetween wl cond soff pa pb speed g = case divideLine 40 pa pb of
[x,y] -> ptCont (PutSlideDr adoor wl soff x y) g
[x,y] -> ptCont (PutSlideDr adoor wl DoorObstacle soff x y) g
(x:y:zs) -> divideDoorPane Nothing wl cond (soff - dist y pb) speed (zip (x:y:zs) (y:zs)) g
_ -> undefined
where
@@ -48,7 +48,7 @@ divideDoorPane mid wl cond soff speed ppairs g = case ppairs of
(p:ps) -> ptCont (adoor p) $ \pl -> Just $ divideDoorPane (_plMID pl) wl cond soff speed ps g
_ -> undefined
where
adoor (x,y) = PutSlideDr thedoor wl soff x y
adoor (x,y) = PutSlideDr thedoor wl DoorObstacle soff x y
thedoor = defaultDoor & drSpeed .~ speed & drTrigger .~ cond
& drPushedBy .~ maybe PushesItself PushedBy mid
@@ -67,7 +67,7 @@ switchDoor btpos btrot dra drb col = pContID (PS btpos btrot) (PutButton $ makeS
$ \btid -> jsps0J (doorbetween btid dra drc)
$ sps0 (doorbetween btid drb drc)
where
doorbetween btid a b = PutSlideDr thedoor (switchWallCol col) 1 a b
doorbetween btid a b = PutSlideDr thedoor (switchWallCol col) DoorObstacle 1 a b
where
thedoor = defaultDoor
& drTrigger .~ cond btid