Move radar blips into own grouping, work on data-ifying particles

This commit is contained in:
2022-07-10 12:38:32 +01:00
parent ce5b596d4f
commit 23022d85a1
10 changed files with 290 additions and 32 deletions
+5 -3
View File
@@ -129,7 +129,7 @@ concBall p = return Shockwave
aStaticBall :: Point2 -> State g Particle
aStaticBall p = return PtZ
aStaticBall p = return PtStaticBall
{ _ptDraw = drawStaticBall
, _ptUpdate = moveStaticBall
, _ptVel = 0
@@ -153,7 +153,7 @@ makeFlamelet
-> World
makeFlamelet (V2 x y) z vel maycid size time w = w
& randGen .~ g
& instantParticles .:~ PtZ
& instantParticles .:~ PtIncBall
{ _ptDraw = drawFlameletZ rot
, _ptUpdate = moveFlamelet
, _ptVel = vel
@@ -164,6 +164,7 @@ makeFlamelet (V2 x y) z vel maycid size time w = w
, _ptTimer = time
, _ptHitEff = expireAndDamage $ simpleDam FLAMING 20
, _ptZ = z
, _ptRot = rot
}
where
(rot ,g) = randomR (0,3) $ _randGen w
@@ -255,7 +256,7 @@ cloudPoisonDamage c w = w & dodamagesto (S.filter f $ crsNearPoint clpos w)
incBall :: RandomGen g => Point2 -> State g Particle
incBall p = do
rot <- state $ randomR (0,3)
return PtZ
return PtIncBall
{ _ptDraw = drawFlameletZ rot
, _ptUpdate = moveFlamelet
, _ptVel = 0
@@ -266,6 +267,7 @@ incBall p = do
, _ptTimer = 20
, _ptHitEff = expireAndDamage $ simpleDam FLAMING 20
, _ptZ = 20
, _ptRot = rot
}
drawFlameletZ
:: Float -- ^ Rotation