Improve pulse laser/ball hit detection

This commit is contained in:
2026-03-26 15:07:33 +00:00
parent 40f5d22d88
commit c53e60b956
13 changed files with 193 additions and 185 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ colCrWall :: World -> Creature -> Creature
colCrWall w c = cornpush . wallpush $ pushthrough c
where
cornpush = crPos . _xy %~ pushOutFromCorners r ls'
wallpush = pushCr' wls
wallpush = pushCr wls
pushthrough = crPos . _xy %~ fst . flip (collidePoint p1) wls -- check push throughs
r = crRad (c ^. crType) + wallBuffer
p1 = c ^. crOldPos . _xy
@@ -33,8 +33,8 @@ colCrWall w c = cornpush . wallpush $ pushthrough c
wls = filter notff $ wlsNearCirc p2 r w
notff x = x ^. wlMaterial /= ForceField
pushCr' :: [Wall] -> Creature -> Creature
pushCr' wls cr
pushCr :: [Wall] -> Creature -> Creature
pushCr wls cr
| dist ep sp > r && dist ep ap > r =
ecr
& crDamage <>~ [Crushing 1000 0]