Add variable door speed, still buggy

This commit is contained in:
2021-09-10 13:41:46 +01:00
parent 87a9745d37
commit c695767fb0
11 changed files with 99 additions and 78 deletions
+5 -2
View File
@@ -24,9 +24,12 @@ mvPs :: (Point2,Point2) -> (Point2,Point2) -> (Point2,Point2)
{-# INLINE mvPs #-}
mvPs (!ex,!ey) (!sx,!sy) = (mvP ex sx,mvP ey sy)
moveDoorToward :: (Point2,Point2) -> Wall -> Wall
moveDoorToward :: Float -> (Point2,Point2) -> Wall -> Wall
{-# INLINE moveDoorToward #-}
moveDoorToward (ex,ey) wls = wls & wlLine %~ mvPs (ex,ey)
--moveDoorToward speed (ex,ey) wls = wls & wlLine %~ mvPs (ex,ey)
moveDoorToward speed (ex,ey) wls = wls & wlLine %~ bimap (f ex) (f ey)
where
f !p = mvPointTowardAtSpeed speed p
zoneps :: (Point2, Point2) -> [(Int,Int)]
{-# INLINE zoneps #-}