Improve pulse laser/ball hit detection
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user