Add debug test

This commit is contained in:
2025-09-01 17:27:58 +01:00
parent 01228ed2f1
commit 85591424fd
+9 -9
View File
@@ -105,9 +105,11 @@ drawCollisionTest w = concat $ do
b <- w ^. input . heldWorldPos . at ButtonRight b <- w ^. input . heldWorldPos . at ButtonRight
return $ return $
setLayer DebugLayer (color orange $ line [a, b]) setLayer DebugLayer (color orange $ line [a, b])
<> foldMap (drawCrossCol red <> foldMap
( drawCrossCol red
-- . xyV3 -- . xyV3
. fst) . fst
)
-- (collide3 (v2z a 0) (v2z b 0) w) -- (collide3 (v2z a 0) (v2z b 0) w)
-- (collide3Floors (v2z a 10) (v2z b (-10)) $ w ^. cWorld . chasms) -- (collide3Floors (v2z a 10) (v2z b (-10)) $ w ^. cWorld . chasms)
(thingHit a b w) (thingHit a b w)
@@ -290,14 +292,12 @@ drawZoneCirc :: World -> Picture
drawZoneCirc w = concat $ do drawZoneCirc w = concat $ do
a <- w ^. input . clickWorldPos . at ButtonLeft a <- w ^. input . clickWorldPos . at ButtonLeft
b <- w ^. input . heldWorldPos . at ButtonLeft b <- w ^. input . heldWorldPos . at ButtonLeft
let r = dist a b
ps = zoneOfCirc 50 a r
return $ return $
setLayer DebugLayer (uncurryV translate a $ color red $ circle (dist a b)) setLayer DebugLayer (uncurryV translate a $ color red $ circle r)
<> <> setLayer DebugLayer (color green $ line [a, b])
setLayer DebugLayer (color green $ line [a, b]) <> foldMap (drawZoneCol orange 50) ps
-- foldMap (drawZoneCol orange 50) ps
-- where
-- mwp = mouseWorldPos (w ^. input) (w ^. wCam)
-- ps = [zoneOfPoint 50 mwp]
drawDDATest :: World -> Picture drawDDATest :: World -> Picture
drawDDATest w = drawDDATest w =