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
+12 -2
View File
@@ -25,9 +25,16 @@ import LensHelp
import System.Random
muzFlareAt :: Color -> Point3 -> Float -> World -> World
muzFlareAt col tranv dir w = w & instantParticles .:~ Particle
muzFlareAt col tranv dir w = w & instantParticles .:~ PtMuzFlare
{ _ptDraw = const $ setLayer BloomNoZWrite . translate3 tranv $ theShape
, _ptUpdate = ptSimpleTime 2
, _ptPoly =
[ V2 0 0
, V2 a (-b)
, V2 c d
]
, _ptColor = col
, _ptTran3 = tranv
}
where
theShape = rotate dir . color col $ polygon
@@ -38,10 +45,13 @@ muzFlareAt col tranv dir w = w & instantParticles .:~ Particle
(a:b:c:d:_) = randomRs (2,20) (_randGen w)
flareCircleAt :: Color -> Float -> Point3 -> World -> World
flareCircleAt col alphax tranv = instantParticles .:~ Particle
flareCircleAt col alphax tranv = instantParticles .:~ PtCircFlare
{ _ptDraw = const . setLayer BloomNoZWrite . translate3 tranv
$ circleSolidCol (withAlpha 0 0) (withAlpha alphax col) 50
, _ptUpdate = ptSimpleTime 1
, _ptColor = col
, _ptAlpha = alphax
, _ptTran3 = tranv
}
explosionFlashAt :: Point2 -> World -> World