This commit is contained in:
2021-12-15 22:21:58 +00:00
parent 9dadea2c36
commit 9ead5b3979
11 changed files with 130 additions and 174 deletions
+7 -7
View File
@@ -21,8 +21,8 @@ createBarrelSpark pos dir maycid time colid = instantParticles .:~ BulletPt
, _ptUpdate = mvBullet
, _ptVel = rotateV dir (V2 5 0)
, _btDrag = 0.9
, _btColor' = numColor colid
, _btTrail' = [pos]
, _ptColor = numColor colid
, _ptTrail = [pos]
, _btPassThrough' = maycid
, _btWidth' = 1
, _btTimer' = time
@@ -31,7 +31,7 @@ createBarrelSpark pos dir maycid time colid = instantParticles .:~ BulletPt
where
sparkEff bt p cr = creatures . ix (_crID cr) . crState . crDamage .:~ SparkDam 1 sp p ep
where
sp = head (_btTrail' bt)
sp = head (_ptTrail bt)
ep = sp +.+ _ptVel bt
colSpark :: Int -> Color -> Point2 -> Float -> World -> World
colSpark = colSparkRandDir 0.7
@@ -47,14 +47,14 @@ colSparkRandDir randDir time col pos baseDir w = w
, _ptUpdate = mvBullet
, _btDrag = 0.9
, _ptVel = rotateV dir (V2 5 0)
, _btColor' = col
, _btTrail' = [pos]
, _ptColor = col
, _ptTrail = [pos]
, _btPassThrough' = Nothing
, _btWidth' = 1
, _btTimer' = time
, _btHitEffect' = destroyOnImpact sparkEff noEff
}
sparkEff bt p cr = creatures . ix (_crID cr) . crState . crDamage %~ ( SparkDam 1 sp p ep : )
sparkEff bt p cr = creatures . ix (_crID cr) . crState . crDamage .:~ SparkDam 1 sp p ep
where
sp = head (_btTrail' bt)
sp = head (_ptTrail bt)
ep = sp +.+ _ptVel bt