This commit is contained in:
2022-07-10 12:51:20 +01:00
parent 23022d85a1
commit 7a1dbbb3f9
13 changed files with 35 additions and 198 deletions
+3 -11
View File
@@ -26,9 +26,8 @@ import System.Random
muzFlareAt :: Color -> Point3 -> Float -> World -> World
muzFlareAt col tranv dir w = w & instantParticles .:~ PtMuzFlare
{ _ptDraw = const $ setLayer BloomNoZWrite . translate3 tranv $ theShape
, _ptUpdate = ptSimpleTime 2
, _ptPoly =
{ _ptUpdate = ptSimpleTime 2
, _ptPoly = map (rotateV dir)
[ V2 0 0
, V2 a (-b)
, V2 c d
@@ -37,18 +36,11 @@ muzFlareAt col tranv dir w = w & instantParticles .:~ PtMuzFlare
, _ptTran3 = tranv
}
where
theShape = rotate dir . color col $ polygon
[ V2 0 0
, V2 a (-b)
, V2 c d
]
(a:b:c:d:_) = randomRs (2,20) (_randGen w)
flareCircleAt :: Color -> Float -> Point3 -> World -> World
flareCircleAt col alphax tranv = instantParticles .:~ PtCircFlare
{ _ptDraw = const . setLayer BloomNoZWrite . translate3 tranv
$ circleSolidCol (withAlpha 0 0) (withAlpha alphax col) 50
, _ptUpdate = ptSimpleTime 1
{ _ptUpdate = ptSimpleTime 1
, _ptColor = col
, _ptAlpha = alphax
, _ptTran3 = tranv