Move toward moving lights on doors

This commit is contained in:
2022-03-09 22:41:17 +00:00
parent 027b4b7d8b
commit c583d33b57
6 changed files with 31 additions and 25 deletions
+8 -4
View File
@@ -15,12 +15,16 @@ import Dodge.LevelGen.Switch
import qualified Data.IntMap.Strict as IM
putDoubleDoor :: Bool -> Color -> (World -> Bool) -> Point2 -> Point2 -> Float -> Placement
putDoubleDoor pathing col cond a b speed = putDoubleDoorThen pathing col cond a b speed Nothing
putDoubleDoor pathing col cond a b speed
= putDoubleDoorThen pathing col cond a b speed (const $ const Nothing)
putDoubleDoorThen :: Bool -> Color -> (World -> Bool)
-> Point2 -> Point2 -> Float -> Maybe Placement -> Placement
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
-> Point2 -> Point2 -> Float
-> (Placement -> Placement -> Maybe Placement)
-> Placement
putDoubleDoorThen pathing col cond a b speed cont = pt0 (PutSlideDr pathing col cond a half speed)
$ \pl1 -> Just $ Placement (PS (V2 0 0) 0) ( PutSlideDr pathing col cond b half speed) Nothing
$ \pl2 -> cont pl1 pl2
where
half = 0.5 *.* (a +.+ b)