Add debug test
This commit is contained in:
+14
-14
@@ -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
|
||||||
return $
|
let r = dist a b
|
||||||
setLayer DebugLayer (uncurryV translate a $ color red $ circle (dist a b))
|
ps = zoneOfCirc 50 a r
|
||||||
<>
|
return $
|
||||||
setLayer DebugLayer (color green $ line [a, b])
|
setLayer DebugLayer (uncurryV translate a $ color red $ circle r)
|
||||||
-- foldMap (drawZoneCol orange 50) ps
|
<> setLayer DebugLayer (color green $ line [a, b])
|
||||||
-- where
|
<> foldMap (drawZoneCol orange 50) ps
|
||||||
-- mwp = mouseWorldPos (w ^. input) (w ^. wCam)
|
|
||||||
-- ps = [zoneOfPoint 50 mwp]
|
|
||||||
|
|
||||||
drawDDATest :: World -> Picture
|
drawDDATest :: World -> Picture
|
||||||
drawDDATest w =
|
drawDDATest w =
|
||||||
|
|||||||
Reference in New Issue
Block a user