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
+10 -1
View File
@@ -2,11 +2,20 @@ module Picture.Composite where
import Picture.Data
import Picture.Base
import Geometry
--import Color
import Data.Foldable
arrowPath :: [Point2] -> Picture
arrowPath xs = mconcat $ zipWith arrow xs $ tail xs
multiArrow :: Foldable t => Point2 -> Point2 -> Color -> t Color -> Picture
multiArrow sp ep col' cols
| null cols = color col' (arrow sp ep)
| otherwise = foldl' f mempty cols
where
f pic col = uncurryV translate offset pic <> color col (arrow sp ep)
offset = normalizeV (vNormal (ep -.- sp))
arrow :: Point2 -> Point2 -> Picture
arrow a b = line [a,b]
<> line [b +.+ n -.- v,b]