Stop bullets when they hit walls
This commit is contained in:
@@ -31,12 +31,13 @@ thingsHit sp ep w
|
||||
where
|
||||
hitCrs = IM.elems
|
||||
$ IM.filter (\cr -> circOnSeg sp ep (_crPos cr) (_crRad cr))
|
||||
$ _creatures w
|
||||
-- $ creaturesAlongLine sp ep w
|
||||
crPs = map (\cr -> ssaTriPoint ep (_crPos cr) sp (_crRad cr)) hitCrs
|
||||
-- $ _creatures w
|
||||
$ creaturesAlongLine sp ep w
|
||||
crPs = map (\cr -> ssaTriPoint ep (_crPos cr) sp (_crRad cr)) hitCrs
|
||||
crs = zip crPs (map Left hitCrs)
|
||||
hitWls = wallsOnLine sp ep (IM.unions [f b $ f a $ _znObjects $ _wallsZone w | a<-[x-1,x,x+1]
|
||||
, b<-[y-1,y,y+1]])
|
||||
--hitWls = wallsOnLine sp ep $ _walls w
|
||||
(x,y) = zoneOfPoint (0.5 *.* (sp +.+ ep))
|
||||
f i m = case IM.lookup i m of
|
||||
Just val -> val
|
||||
|
||||
Reference in New Issue
Block a user