Fix no damage to walls bug

This commit is contained in:
2022-07-28 18:57:53 +01:00
parent ec4ff84c46
commit c8ad3e1294
19 changed files with 177 additions and 158 deletions
+12 -9
View File
@@ -2,6 +2,7 @@ module Dodge.Render.ShapePicture (
worldSPic,
) where
import Dodge.Zoning.Base
import Control.Lens
import Data.Foldable
import qualified Data.Graph.Inductive as FGL
@@ -49,7 +50,7 @@ import Dodge.Zone
import Dodge.Zoning
import Geometry
import Geometry.ConvexPoly
import Geometry.Zone
--import Geometry.Zone
import qualified IntMapHelp as IM
import Padding
import Picture
@@ -285,18 +286,20 @@ drawFarWallDetect w =
drawDDATest :: World -> Picture
drawDDATest w =
runIdentity (S.foldMap_ (drawZoneCol orange 50) ps)
<> runIdentity (S.foldMap_ (drawZoneCol green 50) ps')
<> runIdentity (S.foldMap_ drawCross qs)
<> color blue (runIdentity (S.foldMap_ drawCross qs'))
foldMap (drawZoneCol orange 50) ps
-- runIdentity (S.foldMap_ (drawZoneCol orange 50) ps)
-- <> runIdentity (S.foldMap_ (drawZoneCol green 50) ps')
-- <> runIdentity (S.foldMap_ drawCross qs)
-- <> color blue (runIdentity (S.foldMap_ drawCross qs'))
<> setLayer DebugLayer (color yellow (line [cvf, mwp]))
where
cvf = _cameraViewFrom (_cWorld w)
mwp = mouseWorldPos w
ps = ddaStreamX 50 cvf mwp
ps' = ddaStreamY 50 (_cameraViewFrom (_cWorld w)) (mouseWorldPos w)
qs = xIntercepts 50 (_cameraViewFrom (_cWorld w)) (mouseWorldPos w)
qs' = yIntercepts 50 (_cameraViewFrom (_cWorld w)) (mouseWorldPos w)
--ps = ddaStreamX 50 cvf mwp
ps = zoneOfSeg' 50 cvf mwp
--ps' = ddaStreamY 50 (_cameraViewFrom (_cWorld w)) (mouseWorldPos w)
--qs = xIntercepts 50 (_cameraViewFrom (_cWorld w)) (mouseWorldPos w)
--qs' = yIntercepts 50 (_cameraViewFrom (_cWorld w)) (mouseWorldPos w)
drawCross :: Point2 -> Picture
drawCross p = setLayer DebugLayer . color red . uncurryV translate p $ crossPic 5