Initial implementation of bezier bullet

This commit is contained in:
2021-03-15 13:11:01 +01:00
parent 5ce9b4487b
commit a5e0dc65da
6 changed files with 43 additions and 349 deletions
+17 -1
View File
@@ -231,6 +231,22 @@ aGenBulAt' maycid col pos vel hiteff width = Bul'
, _btTrail' = [pos]
, _btPassThrough' = maycid
, _btWidth' = width
, _btTimer' = 90
, _btTimer' = 100
, _btHitEffect' = hiteff
}
aCurveBulAt :: Maybe Int -> Color -> Point2 -> Point2 -> Point2 -> HitEffect' -> Float -> Particle'
aCurveBulAt maycid col pos control targ hiteff width = Bul'
{ _ptPict' = blank
, _ptUpdate' = mvBulletTrajectory f
, _btVel' = (0,0)
, _btColor' = col
, _btTrail' = [pos]
, _btPassThrough' = maycid
, _btWidth' = width
, _btTimer' = 100
, _btHitEffect' = hiteff
}
where f i = g $ (100 - fromIntegral i) / 10
g x = map (bf . (+ x)) [0,0.01..0.09]
bf = bQuadToF (pos,control,targ)