Allow grenades to stick to creatures
This commit is contained in:
@@ -112,11 +112,13 @@ drawCircCollisionTest :: World -> Picture
|
||||
drawCircCollisionTest w = concat $ do
|
||||
a <- w ^. input . heldWorldPos . at ButtonLeft
|
||||
b <- w ^. input . heldWorldPos . at ButtonRight
|
||||
let col | anythingHitCirc 2 a b w = red
|
||||
let col
|
||||
| anythingHitCirc 2 a b w = red
|
||||
| otherwise = green
|
||||
return $
|
||||
setLayer DebugLayer (color col $ line [a, b])
|
||||
<> drawCoord a w <> drawCoord b w
|
||||
<> drawCoord a w
|
||||
<> drawCoord b w
|
||||
|
||||
drawWallsNearSegment :: World -> Picture
|
||||
drawWallsNearSegment w = concat $ do
|
||||
@@ -124,8 +126,10 @@ drawWallsNearSegment w = concat $ do
|
||||
b <- w ^. input . heldWorldPos . at ButtonRight
|
||||
return . foldMap f $ wlsNearSeg a b w
|
||||
where
|
||||
f wl = setLayer DebugLayer (color rose $ thickLine 3 [a, b])
|
||||
<> drawCoord a w <> drawCoord b w
|
||||
f wl =
|
||||
setLayer DebugLayer (color rose $ thickLine 3 [a, b])
|
||||
<> drawCoord a w
|
||||
<> drawCoord b w
|
||||
where
|
||||
(a, b) = _wlLine wl
|
||||
|
||||
@@ -213,8 +217,10 @@ drawWallsNearCursor :: World -> Picture
|
||||
drawWallsNearCursor w =
|
||||
foldMap f $ wlsNearPoint (mouseWorldPos (_input w) (_wCam w)) w
|
||||
where
|
||||
f wl = setLayer DebugLayer (color rose $ thickLine 3 [a, b])
|
||||
<> drawCoord a w <> drawCoord b w
|
||||
f wl =
|
||||
setLayer DebugLayer (color rose $ thickLine 3 [a, b])
|
||||
<> drawCoord a w
|
||||
<> drawCoord b w
|
||||
where
|
||||
(a, b) = _wlLine wl
|
||||
|
||||
@@ -351,7 +357,7 @@ drawMousePosition w =
|
||||
mwp = mouseWorldPos (w ^. input) (w ^. wCam)
|
||||
|
||||
drawCoord :: Point2 -> World -> Picture
|
||||
drawCoord p w =
|
||||
drawCoord p w =
|
||||
setLayer FixedCoordLayer
|
||||
. uncurryV translate (worldPosToScreen (w ^. wCam) p)
|
||||
. scale 0.1 0.1
|
||||
|
||||
Reference in New Issue
Block a user