Remove instantBullets

This commit is contained in:
2024-12-24 12:50:00 +00:00
parent a28ec07ffb
commit 75958c1e2c
9 changed files with 25 additions and 23 deletions
+2 -3
View File
@@ -44,7 +44,6 @@ doMagnetBuBu mg bu = if isclose
MagnetAttract -> bu & buVel %~ vecTurnTo (10 * pi / (d+40)) bpos mpos
MagnetRepulse -> bu & buVel %~ vecTurnTo (10 * pi / (d+40)) bpos (2*bpos - mpos)
else bu
where
bvel = bu ^. buVel
mpos = mg ^. mgPos
@@ -126,7 +125,7 @@ useBulletPayload bu = case _buPayload bu of
BulBall FlashBall -> Just makeFlashBall
makeFragBullets :: Point2 -> World -> World
makeFragBullets p w = w & cWorld . lWorld . instantBullets .++~ bus
makeFragBullets p w = w & cWorld . lWorld . bullets .++~ bus
where
bus = zipWith f (take 10 as) (take 10 ss)
as = randomRs (0, 2 * pi) $ _randGen w
@@ -141,7 +140,7 @@ makeFragBullets p w = w & cWorld . lWorld . instantBullets .++~ bus
]
makeFlak :: Bullet -> Point2 -> World -> World
makeFlak bu _ w = w & cWorld . lWorld . instantBullets .++~ [f x | x <- xs]
makeFlak bu _ w = w & cWorld . lWorld . bullets .++~ [f x | x <- xs]
where
s = min 10 (0.5 * magV (_buVel bu))
xs = take 5 $ randomRs (-s,s) $ _randGen w