Improve wall crushing
This commit is contained in:
+4
-1
@@ -38,8 +38,9 @@ doDoorMount pa w = \case
|
||||
& _2 . each . vxPos . _xy %~ shiftPointBy pa
|
||||
)
|
||||
|
||||
-- do the mounts need to be done if there is no lerping?
|
||||
doorLerp :: Float -> Door -> World -> (S.Set Int2, World)
|
||||
doorLerp speed dr w = fromMaybe (mempty, domounts (dr ^. drLerp) w) $ do
|
||||
doorLerp speed dr w = fromMaybe (mempty, domounts (dr ^. drLerp) $ setOldLerp w) $ do
|
||||
x <- newlerp
|
||||
let ps = wlposs x
|
||||
ps' = wlposs (dr ^. drLerp)
|
||||
@@ -52,8 +53,10 @@ doorLerp speed dr w = fromMaybe (mempty, domounts (dr ^. drLerp) w) $ do
|
||||
f x
|
||||
& playSound x
|
||||
& cWorld . lWorld . doors . ix drid . drLerp .~ x
|
||||
& setOldLerp
|
||||
)
|
||||
where
|
||||
setOldLerp = cWorld . lWorld . doors . ix drid . drOldLerp .~ (dr ^. drLerp)
|
||||
domounts x w' = foldl' (doDoorMount (doDoorLerp dr x)) w' (dr ^. drMounts)
|
||||
f = ifoldl' (flip . moveWallID) w . wlposs
|
||||
wlposs x = (dr ^. drFootPrint) & each . each %~ shiftPointBy (doDoorLerp dr x)
|
||||
|
||||
Reference in New Issue
Block a user