Redo collision changes

This commit is contained in:
2022-07-01 16:05:39 +01:00
parent 1f4f1f6ab1
commit 207d52a719
2 changed files with 67 additions and 183 deletions
+3 -2
View File
@@ -28,6 +28,7 @@ import qualified IntMapHelp as IM
import ShapePicture
import Shape
import qualified Streaming.Prelude as S
--import qualified Data.Set as S
import qualified Data.Map.Strict as M
import qualified SDL
@@ -332,9 +333,9 @@ moveRemoteShell cid itid pj w
doExplosion = explodeRemoteRocket itid i $ stopSoundFrom (ShellSound i) w
anythingHitCirc :: Float -> Point2 -> Point2 -> World -> Bool
anythingHitCirc rad sp ep w = isJust hitCr || isJust (sequence hitWl)
anythingHitCirc rad sp ep w = hitCr || isJust (sequence hitWl)
where
hitCr = collideCircCrsPoint sp ep rad (_creatures w)
hitCr = runIdentity $ S.any_ (const True) $ overlap1SegCrs sp ep $ crsNearSeg sp ep w
hitWl = collideCircWallsStream sp ep rad $ wlsNearPoint ep w
-- this should probably be wallsOnLine or something