Add debug test
This commit is contained in:
+14
-14
@@ -105,11 +105,13 @@ drawCollisionTest w = concat $ do
|
||||
b <- w ^. input . heldWorldPos . at ButtonRight
|
||||
return $
|
||||
setLayer DebugLayer (color orange $ line [a, b])
|
||||
<> foldMap (drawCrossCol red
|
||||
-- . xyV3
|
||||
. fst)
|
||||
-- (collide3 (v2z a 0) (v2z b 0) w)
|
||||
-- (collide3Floors (v2z a 10) (v2z b (-10)) $ w ^. cWorld . chasms)
|
||||
<> foldMap
|
||||
( drawCrossCol red
|
||||
-- . xyV3
|
||||
. fst
|
||||
)
|
||||
-- (collide3 (v2z a 0) (v2z b 0) w)
|
||||
-- (collide3Floors (v2z a 10) (v2z b (-10)) $ w ^. cWorld . chasms)
|
||||
(thingHit a b w)
|
||||
|
||||
drawCircCollisionTest :: World -> Picture
|
||||
@@ -157,7 +159,7 @@ showEnabledDebugs cfig
|
||||
setLayer FixedCoordLayer (toTopLeft cfig (translate (0.5 * halfWidth cfig) 0 $ drawList $ map text ts))
|
||||
| otherwise = mempty
|
||||
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)
|
||||
|
||||
--debugDraw' :: Config -> World -> DebugBool -> Picture
|
||||
@@ -290,14 +292,12 @@ drawZoneCirc :: World -> Picture
|
||||
drawZoneCirc w = concat $ do
|
||||
a <- w ^. input . clickWorldPos . at ButtonLeft
|
||||
b <- w ^. input . heldWorldPos . at ButtonLeft
|
||||
return $
|
||||
setLayer DebugLayer (uncurryV translate a $ color red $ circle (dist a b))
|
||||
<>
|
||||
setLayer DebugLayer (color green $ line [a, b])
|
||||
-- foldMap (drawZoneCol orange 50) ps
|
||||
-- where
|
||||
-- mwp = mouseWorldPos (w ^. input) (w ^. wCam)
|
||||
-- ps = [zoneOfPoint 50 mwp]
|
||||
let r = dist a b
|
||||
ps = zoneOfCirc 50 a r
|
||||
return $
|
||||
setLayer DebugLayer (uncurryV translate a $ color red $ circle r)
|
||||
<> setLayer DebugLayer (color green $ line [a, b])
|
||||
<> foldMap (drawZoneCol orange 50) ps
|
||||
|
||||
drawDDATest :: World -> Picture
|
||||
drawDDATest w =
|
||||
|
||||
Reference in New Issue
Block a user