Beef up minigun

This commit is contained in:
2021-08-28 12:09:39 +01:00
parent 1168da0531
commit 882a8e9824
17 changed files with 263 additions and 237 deletions
+22
View File
@@ -7,6 +7,7 @@ import Geometry
import Picture
import Control.Lens
import Data.Bifunctor
aGenBulAt
:: Maybe Int -- ^ Pass-through creature id
@@ -26,6 +27,27 @@ aGenBulAt maycid pos vel hiteff width = Bul'
, _btTimer' = 100
, _btHitEffect' = hiteff
}
aDelayedBulAt
:: Float -- ^ Start velocity step factor
-> Maybe Int -- ^ Pass-through creature id
-> Point2 -- ^ Start position
-> Point2 -- ^ Velocity
-> HitEffect
-> Float -- ^ Bullet width
-> Particle
aDelayedBulAt vfact maycid pos vel hiteff width = Bul'
{ _ptDraw = drawBul
, _ptUpdate' = \w -> resetVel . mvGenBullet w
, _btVel' = vfact *.* vel
, _btColor' = V4 2 2 2 2
, _btTrail' = [pos]
, _btPassThrough' = maycid
, _btWidth' = width
, _btTimer' = 100
, _btHitEffect' = hiteff
}
where
resetVel = second $ fmap $ (ptUpdate' .~ mvGenBullet) . (btVel' .~ vel)
aCurveBulAt
:: Maybe Int -- ^ Pass-through creature id