More streaming refactoring
This commit is contained in:
@@ -52,7 +52,7 @@ moveGrenade pj w
|
||||
| _pjTimer pj <= 0 = w
|
||||
& props %~ IM.delete pID
|
||||
& _pjPayload pj (_prPos (_props w IM.! pID))
|
||||
| otherwise = case collideCircWalls oldPos newPos 4 $ wallsNearPoint newPos w of
|
||||
| otherwise = case collideCircWallsList oldPos newPos 4 $ wallsNearPoint' newPos w of
|
||||
Nothing -> w & props . ix pID %~ normalUpdate
|
||||
Just (p,v) -> w
|
||||
& soundStart (Tap 0) p tapQuietS Nothing
|
||||
@@ -182,7 +182,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 = collideCircWalls oldPos newPos 4 $ wallsNearPoint newPos w
|
||||
hitWl = collideCircWallsList oldPos newPos 4 $ wallsNearPoint' newPos w
|
||||
finalPos = maybe newPos (invShift . fst) hitWl
|
||||
setV v = set (props . ix pID . pjVel) v
|
||||
updateV = maybe id (setV . snd) hitWl
|
||||
|
||||
@@ -336,7 +336,7 @@ anythingHitCirc :: Float -> Point2 -> Point2 -> World -> Bool
|
||||
anythingHitCirc rad sp ep w = isJust $ hitCr <|> hitWl
|
||||
where
|
||||
hitCr = fst <$> collideCircCrsPoint sp ep rad (_creatures w)
|
||||
hitWl = fst <$> collideCircWalls sp ep rad (wallsNearPoint ep w)
|
||||
hitWl = fst <$> collideCircWallsList sp ep rad (wallsNearPoint' ep w)
|
||||
-- this should probably be wallsOnLine or something
|
||||
|
||||
explodeRemoteRocket
|
||||
|
||||
Reference in New Issue
Block a user