Cleanup zoning
This commit is contained in:
@@ -55,7 +55,7 @@ moveGrenade pj w
|
||||
-- this should maybe
|
||||
-- be wallsAlongLine
|
||||
-- or something vvv
|
||||
| otherwise = case bounceBall 1 oldPos newPos 4 $ wallsNearPoint newPos w of
|
||||
| otherwise = case bounceBall 1 oldPos newPos 4 $ wlsNearPoint newPos w of
|
||||
Nothing -> w & props . ix pID %~ normalUpdate
|
||||
Just (p,v) -> w
|
||||
& soundStart (Tap 0) p tapQuietS Nothing
|
||||
@@ -186,7 +186,7 @@ moveRemoteBomb itid time pID w
|
||||
-- this is hacky, should use a version of collidePointWalls' that collides
|
||||
-- circles and walls
|
||||
invShift x = x -.- 5 *.* normalizeV (_pjVel pj)
|
||||
hitWl = bounceBall 1 oldPos newPos 4 $ wallsNearPoint newPos w
|
||||
hitWl = bounceBall 1 oldPos newPos 4 $ wlsNearPoint newPos w
|
||||
finalPos = maybe newPos (invShift . fst) hitWl
|
||||
setV v = set (props . ix pID . pjVel) v
|
||||
updateV = maybe id (setV . snd) hitWl
|
||||
|
||||
@@ -335,7 +335,7 @@ anythingHitCirc :: Float -> Point2 -> Point2 -> World -> Bool
|
||||
anythingHitCirc rad sp ep w = isJust hitCr || isJust (sequence hitWl)
|
||||
where
|
||||
hitCr = collideCircCrsPoint sp ep rad (_creatures w)
|
||||
hitWl = collideCircWallsStream sp ep rad $ wallsNearPoint ep w
|
||||
hitWl = collideCircWallsStream sp ep rad $ wlsNearPoint ep w
|
||||
-- this should probably be wallsOnLine or something
|
||||
|
||||
explodeRemoteRocket
|
||||
|
||||
@@ -123,8 +123,8 @@ itemBlips p r = IM.elems . IM.filter f . fmap _flItPos . _floorItems
|
||||
|
||||
wallBlips :: Point2 -> Float -> World -> [Point2]
|
||||
wallBlips p r w = runIdentity . S.toList_ $ S.mapMaybe (uncurry (intersectCircSegFirst p r) . _wlLine)
|
||||
$ S.map (over wlLine swp) (wallsInsideCirc p r w)
|
||||
<> wallsInsideCirc p r w
|
||||
$ S.map (over wlLine swp) (wlsInsideCirc p r w)
|
||||
<> wlsInsideCirc p r w
|
||||
where
|
||||
swp (a,b) = (b,a)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user