Add debug test

This commit is contained in:
2025-09-01 17:27:58 +01:00
parent 01228ed2f1
commit 85591424fd
+13 -13
View File
@@ -105,11 +105,13 @@ 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
-- . xyV3 ( drawCrossCol red
. fst) -- . xyV3
-- (collide3 (v2z a 0) (v2z b 0) w) . fst
-- (collide3Floors (v2z a 10) (v2z b (-10)) $ w ^. cWorld . chasms) )
-- (collide3 (v2z a 0) (v2z b 0) w)
-- (collide3Floors (v2z a 10) (v2z b (-10)) $ w ^. cWorld . chasms)
(thingHit a b w) (thingHit a b w)
drawCircCollisionTest :: World -> Picture drawCircCollisionTest :: World -> Picture
@@ -157,7 +159,7 @@ showEnabledDebugs cfig
setLayer FixedCoordLayer (toTopLeft cfig (translate (0.5 * halfWidth cfig) 0 $ drawList $ map text ts)) setLayer FixedCoordLayer (toTopLeft cfig (translate (0.5 * halfWidth cfig) 0 $ drawList $ map text ts))
| otherwise = mempty | otherwise = mempty
where where
-- pic = foldMap (debugDraw' cfig w) (_debug_booleans cfig) -- pic = foldMap (debugDraw' cfig w) (_debug_booleans cfig)
ts = map show (S.toList $ _debug_booleans cfig) ts = map show (S.toList $ _debug_booleans cfig)
--debugDraw' :: Config -> World -> DebugBool -> Picture --debugDraw' :: Config -> World -> DebugBool -> Picture
@@ -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 =