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
+1 -1
View File
@@ -5,6 +5,6 @@ import Dodge.Data
import Picture
drawBul :: Particle -> Picture
drawBul pt = setLayer 1 . setDepth 20 . color thecolor $ thickLine (take 2 $ _btTrail' pt) (_btWidth' pt)
drawBul pt = setLayer 1 . setDepth 20 . color thecolor $ thickLine (take 3 $ _btTrail' pt) (_btWidth' pt)
where
thecolor = _btColor' pt
+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